1 package com.sun.tools.xjc.runtime; 2 3 import org.xml.sax.Attributes ; 4 import org.xml.sax.SAXException ; 5 6 12 class Discarder implements UnmarshallingEventHandler { 13 14 private final UnmarshallingContext context; 15 16 private int depth = 0; 18 19 20 public Discarder(UnmarshallingContext _ctxt) { 21 this.context = _ctxt; 22 } 23 24 public void enterAttribute(String uri, String local, String qname) throws SAXException { 25 } 26 27 public void enterElement(String uri, String local, String qname, Attributes atts) throws SAXException { 28 depth++; 29 } 30 31 public void leaveAttribute(String uri, String local, String qname) throws SAXException { 32 } 33 34 public void leaveElement(String uri, String local, String qname) throws SAXException { 35 depth--; 36 if(depth==0) 37 context.popContentHandler(); 38 } 39 40 public Object owner() { 41 return null; 42 } 43 44 public void text(String s) throws SAXException { 45 } 46 47 public void leaveChild(int nextState) throws SAXException { 48 } 49 50 } 51 | Popular Tags |