a48dfea7e1ebb9a3f62e3dd34bac0414f31af54f
[jalviewjs.git] / site / swingjs / j2s / org / xml / sax / helpers / XMLReaderAdapter.js
1 Clazz.declarePackage ("org.xml.sax.helpers");
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 () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.xmlReader = null;
5 this.documentHandler = null;
6 this.qAtts = null;
7 if (!Clazz.isClassDefined ("org.xml.sax.helpers.XMLReaderAdapter.AttributesAdapter")) {
8 org.xml.sax.helpers.XMLReaderAdapter.$XMLReaderAdapter$AttributesAdapter$ ();
9 }
10 Clazz.instantialize (this, arguments);
11 }, org.xml.sax.helpers, "XMLReaderAdapter", null, [org.xml.sax.Parser, org.xml.sax.ContentHandler]);
12 Clazz.makeConstructor (c$, 
13 function () {
14 this.setup (org.xml.sax.helpers.XMLReaderFactory.createXMLReader ());
15 });
16 Clazz.makeConstructor (c$, 
17 function (xmlReader) {
18 this.setup (xmlReader);
19 }, "org.xml.sax.XMLReader");
20 Clazz.defineMethod (c$, "setup", 
21  function (xmlReader) {
22 if (xmlReader == null) {
23 throw  new NullPointerException ("XMLReader must not be null");
24 }this.xmlReader = xmlReader;
25 this.qAtts = Clazz.innerTypeInstance (org.xml.sax.helpers.XMLReaderAdapter.AttributesAdapter, this, null);
26 }, "org.xml.sax.XMLReader");
27 Clazz.overrideMethod (c$, "setLocale", 
28 function (locale) {
29 throw  new org.xml.sax.SAXNotSupportedException ("setLocale not supported");
30 }, "java.util.Locale");
31 Clazz.overrideMethod (c$, "setEntityResolver", 
32 function (resolver) {
33 this.xmlReader.setEntityResolver (resolver);
34 }, "org.xml.sax.EntityResolver");
35 Clazz.overrideMethod (c$, "setDTDHandler", 
36 function (handler) {
37 this.xmlReader.setDTDHandler (handler);
38 }, "org.xml.sax.DTDHandler");
39 Clazz.overrideMethod (c$, "setDocumentHandler", 
40 function (handler) {
41 this.documentHandler = handler;
42 }, "org.xml.sax.DocumentHandler");
43 Clazz.overrideMethod (c$, "setErrorHandler", 
44 function (handler) {
45 this.xmlReader.setErrorHandler (handler);
46 }, "org.xml.sax.ErrorHandler");
47 Clazz.defineMethod (c$, "parse", 
48 function (systemId) {
49 this.parse ( new org.xml.sax.InputSource (systemId));
50 }, "~S");
51 Clazz.defineMethod (c$, "parse", 
52 function (input) {
53 this.setupXMLReader ();
54 this.xmlReader.parse (input);
55 }, "org.xml.sax.InputSource");
56 Clazz.defineMethod (c$, "setupXMLReader", 
57  function () {
58 this.xmlReader.setFeature ("http://xml.org/sax/features/namespace-prefixes", true);
59 try {
60 this.xmlReader.setFeature ("http://xml.org/sax/features/namespaces", false);
61 } catch (e) {
62 if (Clazz.exceptionOf (e, org.xml.sax.SAXException)) {
63 } else {
64 throw e;
65 }
66 }
67 this.xmlReader.setContentHandler (this);
68 });
69 Clazz.overrideMethod (c$, "setDocumentLocator", 
70 function (locator) {
71 if (this.documentHandler != null) this.documentHandler.setDocumentLocator (locator);
72 }, "org.xml.sax.Locator");
73 Clazz.overrideMethod (c$, "startDocument", 
74 function () {
75 if (this.documentHandler != null) this.documentHandler.startDocument ();
76 });
77 Clazz.overrideMethod (c$, "endDocument", 
78 function () {
79 if (this.documentHandler != null) this.documentHandler.endDocument ();
80 });
81 Clazz.overrideMethod (c$, "startPrefixMapping", 
82 function (prefix, uri) {
83 }, "~S,~S");
84 Clazz.overrideMethod (c$, "endPrefixMapping", 
85 function (prefix) {
86 }, "~S");
87 Clazz.overrideMethod (c$, "startElement", 
88 function (uri, localName, qName, atts) {
89 if (this.documentHandler != null) {
90 this.qAtts.setAttributes (atts);
91 this.documentHandler.startElement (qName, this.qAtts);
92 }}, "~S,~S,~S,org.xml.sax.Attributes");
93 Clazz.overrideMethod (c$, "endElement", 
94 function (uri, localName, qName) {
95 if (this.documentHandler != null) this.documentHandler.endElement (qName);
96 }, "~S,~S,~S");
97 Clazz.overrideMethod (c$, "characters", 
98 function (ch, start, length) {
99 if (this.documentHandler != null) this.documentHandler.characters (ch, start, length);
100 }, "~A,~N,~N");
101 Clazz.overrideMethod (c$, "ignorableWhitespace", 
102 function (ch, start, length) {
103 if (this.documentHandler != null) this.documentHandler.ignorableWhitespace (ch, start, length);
104 }, "~A,~N,~N");
105 Clazz.overrideMethod (c$, "processingInstruction", 
106 function (target, data) {
107 if (this.documentHandler != null) this.documentHandler.processingInstruction (target, data);
108 }, "~S,~S");
109 Clazz.overrideMethod (c$, "skippedEntity", 
110 function (name) {
111 }, "~S");
112 c$.$XMLReaderAdapter$AttributesAdapter$ = function () {
113 Clazz.pu$h(self.c$);
114 c$ = Clazz.decorateAsClass (function () {
115 Clazz.prepareCallback (this, arguments);
116 this.attributes = null;
117 Clazz.instantialize (this, arguments);
118 }, org.xml.sax.helpers.XMLReaderAdapter, "AttributesAdapter", null, org.xml.sax.AttributeList);
119 Clazz.makeConstructor (c$, 
120 function () {
121 });
122 Clazz.defineMethod (c$, "setAttributes", 
123 function (a) {
124 this.attributes = a;
125 }, "org.xml.sax.Attributes");
126 Clazz.overrideMethod (c$, "getLength", 
127 function () {
128 return this.attributes.getLength ();
129 });
130 Clazz.overrideMethod (c$, "getName", 
131 function (a) {
132 return this.attributes.getQName (a);
133 }, "~N");
134 Clazz.defineMethod (c$, "getType", 
135 function (a) {
136 return this.attributes.getType (a);
137 }, "~N");
138 Clazz.defineMethod (c$, "getValue", 
139 function (a) {
140 return this.attributes.getValue (a);
141 }, "~N");
142 Clazz.defineMethod (c$, "getType", 
143 function (a) {
144 return this.attributes.getType (a);
145 }, "~S");
146 Clazz.defineMethod (c$, "getValue", 
147 function (a) {
148 return this.attributes.getValue (a);
149 }, "~S");
150 c$ = Clazz.p0p ();
151 };
152 });