1 8 package com.sun.japex.testsuite.impl.runtime; 9 10 import org.xml.sax.Attributes ; 11 import org.xml.sax.SAXException ; 12 13 19 class Discarder implements UnmarshallingEventHandler { 20 21 private final UnmarshallingContext context; 22 23 private int depth = 0; 25 26 27 public Discarder(UnmarshallingContext _ctxt) { 28 this.context = _ctxt; 29 } 30 31 public void enterAttribute(String uri, String local, String qname) throws SAXException { 32 } 33 34 public void enterElement(String uri, String local, String qname, Attributes atts) throws SAXException { 35 depth++; 36 } 37 38 public void leaveAttribute(String uri, String local, String qname) throws SAXException { 39 } 40 41 public void leaveElement(String uri, String local, String qname) throws SAXException { 42 depth--; 43 if(depth==0) 44 context.popContentHandler(); 45 } 46 47 public Object owner() { 48 return null; 49 } 50 51 public void text(String s) throws SAXException { 52 } 53 54 public void leaveChild(int nextState) throws SAXException { 55 } 56 57 } 58 | Popular Tags |