1 Clazz.declarePackage ("org.xml.sax.helpers");
\r
2 Clazz.load (["org.xml.sax.AttributeList", "$.ContentHandler", "$.Parser"], "org.xml.sax.helpers.XMLReaderAdapter", ["java.lang.NullPointerException", "org.xml.sax.InputSource", "$.SAXNotSupportedException", "org.xml.sax.helpers.XMLReaderFactory"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.xmlReader = null;
\r
5 this.documentHandler = null;
\r
7 if (!Clazz.isClassDefined ("org.xml.sax.helpers.XMLReaderAdapter.AttributesAdapter")) {
\r
8 org.xml.sax.helpers.XMLReaderAdapter.$XMLReaderAdapter$AttributesAdapter$ ();
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, org.xml.sax.helpers, "XMLReaderAdapter", null, [org.xml.sax.Parser, org.xml.sax.ContentHandler]);
\r
12 Clazz.makeConstructor (c$,
\r
14 this.setup (org.xml.sax.helpers.XMLReaderFactory.createXMLReader ());
\r
16 Clazz.makeConstructor (c$,
\r
17 function (xmlReader) {
\r
18 this.setup (xmlReader);
\r
19 }, "org.xml.sax.XMLReader");
\r
20 Clazz.defineMethod (c$, "setup",
\r
21 function (xmlReader) {
\r
22 if (xmlReader == null) {
\r
23 throw new NullPointerException ("XMLReader must not be null");
\r
24 }this.xmlReader = xmlReader;
\r
25 this.qAtts = Clazz.innerTypeInstance (org.xml.sax.helpers.XMLReaderAdapter.AttributesAdapter, this, null);
\r
26 }, "org.xml.sax.XMLReader");
\r
27 Clazz.overrideMethod (c$, "setLocale",
\r
29 throw new org.xml.sax.SAXNotSupportedException ("setLocale not supported");
\r
30 }, "java.util.Locale");
\r
31 Clazz.overrideMethod (c$, "setEntityResolver",
\r
32 function (resolver) {
\r
33 this.xmlReader.setEntityResolver (resolver);
\r
34 }, "org.xml.sax.EntityResolver");
\r
35 Clazz.overrideMethod (c$, "setDTDHandler",
\r
36 function (handler) {
\r
37 this.xmlReader.setDTDHandler (handler);
\r
38 }, "org.xml.sax.DTDHandler");
\r
39 Clazz.overrideMethod (c$, "setDocumentHandler",
\r
40 function (handler) {
\r
41 this.documentHandler = handler;
\r
42 }, "org.xml.sax.DocumentHandler");
\r
43 Clazz.overrideMethod (c$, "setErrorHandler",
\r
44 function (handler) {
\r
45 this.xmlReader.setErrorHandler (handler);
\r
46 }, "org.xml.sax.ErrorHandler");
\r
47 Clazz.defineMethod (c$, "parse",
\r
48 function (systemId) {
\r
49 this.parse ( new org.xml.sax.InputSource (systemId));
\r
51 Clazz.defineMethod (c$, "parse",
\r
53 this.setupXMLReader ();
\r
54 this.xmlReader.parse (input);
\r
55 }, "org.xml.sax.InputSource");
\r
56 Clazz.defineMethod (c$, "setupXMLReader",
\r
58 this.xmlReader.setFeature ("http://xml.org/sax/features/namespace-prefixes", true);
\r
60 this.xmlReader.setFeature ("http://xml.org/sax/features/namespaces", false);
\r
62 if (Clazz.exceptionOf (e, org.xml.sax.SAXException)) {
\r
67 this.xmlReader.setContentHandler (this);
\r
69 Clazz.overrideMethod (c$, "setDocumentLocator",
\r
70 function (locator) {
\r
71 if (this.documentHandler != null) this.documentHandler.setDocumentLocator (locator);
\r
72 }, "org.xml.sax.Locator");
\r
73 Clazz.overrideMethod (c$, "startDocument",
\r
75 if (this.documentHandler != null) this.documentHandler.startDocument ();
\r
77 Clazz.overrideMethod (c$, "endDocument",
\r
79 if (this.documentHandler != null) this.documentHandler.endDocument ();
\r
81 Clazz.overrideMethod (c$, "startPrefixMapping",
\r
82 function (prefix, uri) {
\r
84 Clazz.overrideMethod (c$, "endPrefixMapping",
\r
87 Clazz.overrideMethod (c$, "startElement",
\r
88 function (uri, localName, qName, atts) {
\r
89 if (this.documentHandler != null) {
\r
90 this.qAtts.setAttributes (atts);
\r
91 this.documentHandler.startElement (qName, this.qAtts);
\r
92 }}, "~S,~S,~S,org.xml.sax.Attributes");
\r
93 Clazz.overrideMethod (c$, "endElement",
\r
94 function (uri, localName, qName) {
\r
95 if (this.documentHandler != null) this.documentHandler.endElement (qName);
\r
97 Clazz.overrideMethod (c$, "characters",
\r
98 function (ch, start, length) {
\r
99 if (this.documentHandler != null) this.documentHandler.characters (ch, start, length);
\r
101 Clazz.overrideMethod (c$, "ignorableWhitespace",
\r
102 function (ch, start, length) {
\r
103 if (this.documentHandler != null) this.documentHandler.ignorableWhitespace (ch, start, length);
\r
105 Clazz.overrideMethod (c$, "processingInstruction",
\r
106 function (target, data) {
\r
107 if (this.documentHandler != null) this.documentHandler.processingInstruction (target, data);
\r
109 Clazz.overrideMethod (c$, "skippedEntity",
\r
112 c$.$XMLReaderAdapter$AttributesAdapter$ = function () {
\r
113 Clazz.pu$h(self.c$);
\r
114 c$ = Clazz.decorateAsClass (function () {
\r
115 Clazz.prepareCallback (this, arguments);
\r
116 this.attributes = null;
\r
117 Clazz.instantialize (this, arguments);
\r
118 }, org.xml.sax.helpers.XMLReaderAdapter, "AttributesAdapter", null, org.xml.sax.AttributeList);
\r
119 Clazz.makeConstructor (c$,
\r
122 Clazz.defineMethod (c$, "setAttributes",
\r
124 this.attributes = a;
\r
125 }, "org.xml.sax.Attributes");
\r
126 Clazz.overrideMethod (c$, "getLength",
\r
128 return this.attributes.getLength ();
\r
130 Clazz.overrideMethod (c$, "getName",
\r
132 return this.attributes.getQName (a);
\r
134 Clazz.defineMethod (c$, "getType",
\r
136 return this.attributes.getType (a);
\r
138 Clazz.defineMethod (c$, "getValue",
\r
140 return this.attributes.getValue (a);
\r
142 Clazz.defineMethod (c$, "getType",
\r
144 return this.attributes.getType (a);
\r
146 Clazz.defineMethod (c$, "getValue",
\r
148 return this.attributes.getValue (a);
\r