KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > japex > testsuite > impl > runtime > Discarder


1 //
2
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.3-b18-fcs
3
// See <a HREF="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4
// Any modifications to this file will be lost upon recompilation of the source schema.
5
// Generated on: 2005.06.14 at 12:02:17 PDT
6
//
7

8 package com.sun.japex.testsuite.impl.runtime;
9
10 import org.xml.sax.Attributes JavaDoc;
11 import org.xml.sax.SAXException JavaDoc;
12
13 /**
14  * UnmarshallingEventHandler implementation that discards the whole sub-tree.
15  *
16  * @author
17  * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
18  */

19 class Discarder implements UnmarshallingEventHandler {
20     
21     private final UnmarshallingContext context;
22
23     // nest level of elements.
24
private int depth = 0;
25     
26     
27     public Discarder(UnmarshallingContext _ctxt) {
28         this.context = _ctxt;
29     }
30
31     public void enterAttribute(String JavaDoc uri, String JavaDoc local, String JavaDoc qname) throws SAXException JavaDoc {
32     }
33
34     public void enterElement(String JavaDoc uri, String JavaDoc local, String JavaDoc qname, Attributes JavaDoc atts) throws SAXException JavaDoc {
35         depth++;
36     }
37
38     public void leaveAttribute(String JavaDoc uri, String JavaDoc local, String JavaDoc qname) throws SAXException JavaDoc {
39     }
40
41     public void leaveElement(String JavaDoc uri, String JavaDoc local, String JavaDoc qname) throws SAXException JavaDoc {
42         depth--;
43         if(depth==0)
44             context.popContentHandler();
45     }
46
47     public Object JavaDoc owner() {
48         return null;
49     }
50
51     public void text(String JavaDoc s) throws SAXException JavaDoc {
52     }
53
54     public void leaveChild(int nextState) throws SAXException JavaDoc {
55     }
56
57 }
58
Popular Tags