Clazz.declarePackage ("JSV.source");
Clazz.load (null, "JSV.source.JSVXmlReader", ["java.lang.Character", "java.util.Hashtable", "JU.SB"], function () {
c$ = Clazz.decorateAsClass (function () {
this.thisEvent = null;
this.buffer = null;
if (!Clazz.isClassDefined ("JSV.source.JSVXmlReader.DataBuffer")) {
JSV.source.JSVXmlReader.$JSVXmlReader$DataBuffer$ ();
}
if (!Clazz.isClassDefined ("JSV.source.JSVXmlReader.DataString")) {
JSV.source.JSVXmlReader.$JSVXmlReader$DataString$ ();
}
if (!Clazz.isClassDefined ("JSV.source.JSVXmlReader.XmlEvent")) {
JSV.source.JSVXmlReader.$JSVXmlReader$XmlEvent$ ();
}
if (!Clazz.isClassDefined ("JSV.source.JSVXmlReader.Tag")) {
JSV.source.JSVXmlReader.$JSVXmlReader$Tag$ ();
}
Clazz.instantialize (this, arguments);
}, JSV.source, "JSVXmlReader");
Clazz.prepareFields (c$, function () {
this.thisEvent = Clazz.innerTypeInstance (JSV.source.JSVXmlReader.XmlEvent, this, null, 0);
});
Clazz.makeConstructor (c$, 
function (br) {
this.buffer = Clazz.innerTypeInstance (JSV.source.JSVXmlReader.DataBuffer, this, null, br);
}, "java.io.BufferedReader");
$_M(c$, "getBufferData", 
function () {
return (this.buffer == null ? null : this.buffer.data.toString ().substring (0, this.buffer.ptr));
});
$_M(c$, "thisValue", 
function () {
return this.buffer.nextEvent ().toString ().trim ();
});
$_M(c$, "qualifiedValue", 
function () {
this.buffer.nextTag ();
var value = this.buffer.nextEvent ().toString ().trim ();
this.buffer.nextTag ();
return value;
});
$_M(c$, "peek", 
function () {
this.thisEvent = this.buffer.peek ();
return this.thisEvent.getEventType ();
});
$_M(c$, "hasNext", 
function () {
return this.buffer.hasNext ();
});
$_M(c$, "nextTag", 
function () {
while ((this.thisEvent = this.buffer.nextTag ()).eventType == 6) {
}
});
$_M(c$, "nextEvent", 
function () {
this.thisEvent = this.buffer.nextEvent ();
return this.thisEvent.getEventType ();
});
$_M(c$, "nextStartTag", 
function () {
this.thisEvent = this.buffer.nextTag ();
while (!this.thisEvent.isStartElement ()) this.thisEvent = this.buffer.nextTag ();

});
$_M(c$, "getTagName", 
function () {
return this.thisEvent.getTagName ();
});
$_M(c$, "getTagType", 
function () {
return this.thisEvent.getTagType ();
});
$_M(c$, "getEndTag", 
function () {
return this.thisEvent.getTagName ();
});
$_M(c$, "nextValue", 
function () {
this.buffer.nextTag ();
return this.buffer.nextEvent ().toString ().trim ();
});
$_M(c$, "getAttributeList", 
function () {
return this.thisEvent.toString ().toLowerCase ();
});
$_M(c$, "getAttrValueLC", 
function (key) {
return this.getAttrValue (key).toLowerCase ();
}, "~S");
$_M(c$, "getAttrValue", 
function (name) {
var a = this.thisEvent.getAttributeByName (name);
return (a == null ? "" : a);
}, "~S");
$_M(c$, "getCharacters", 
function () {
var sb =  new JU.SB ();
this.thisEvent = this.buffer.peek ();
var eventType = this.thisEvent.getEventType ();
while (eventType != 4) this.thisEvent = this.buffer.nextEvent ();

while (eventType == 4) {
this.thisEvent = this.buffer.nextEvent ();
eventType = this.thisEvent.getEventType ();
if (eventType == 4) sb.append (this.thisEvent.toString ());
}
return sb.toString ();
});
$_M(c$, "requiresEndTag", 
function () {
var tagType = this.thisEvent.getTagType ();
return tagType != 3 && tagType != 6;
});
c$.$JSVXmlReader$DataBuffer$ = function () {
Clazz.pu$h ();
c$ = Clazz.decorateAsClass (function () {
Clazz.prepareCallback (this, arguments);
Clazz.instantialize (this, arguments);
}, JSV.source.JSVXmlReader, "DataBuffer", JSV.source.JSVXmlReader.DataString, null, Clazz.innerTypeInstance (JSV.source.JSVXmlReader.DataString, this, null, Clazz.inheritArgs));
Clazz.makeConstructor (c$, 
function (a) {
Clazz.superConstructor (this, JSV.source.JSVXmlReader.DataBuffer, []);
this.reader = a;
}, "java.io.BufferedReader");
$_M(c$, "hasNext", 
function () {
if (this.ptr == this.ptEnd) try {
this.readLine ();
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
return false;
} else {
throw e;
}
}
return this.ptr < this.ptEnd;
});
$_V(c$, "readLine", 
function () {
var a = this.reader.readLine ();
if (a == null) {
return false;
}this.data.append (a + "\n");
this.ptEnd = this.data.length ();
return true;
});
$_M(c$, "peek", 
function () {
if (this.ptEnd - this.ptr < 2) try {
this.readLine ();
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
return Clazz.innerTypeInstance (JSV.source.JSVXmlReader.XmlEvent, this, null, 8);
} else {
throw e;
}
}
var a = this.ptr;
var b = Clazz.innerTypeInstance (JSV.source.JSVXmlReader.XmlEvent, this, null, this);
this.ptr = a;
return b;
});
$_M(c$, "nextTag", 
function () {
this.flush ();
this.skipTo ('<', false);
var a = Clazz.innerTypeInstance (JSV.source.JSVXmlReader.XmlEvent, this, null, this);
return a;
});
$_M(c$, "nextEvent", 
function () {
this.flush ();
return Clazz.innerTypeInstance (JSV.source.JSVXmlReader.XmlEvent, this, null, this);
});
c$ = Clazz.p0p ();
};
c$.$JSVXmlReader$DataString$ = function () {
Clazz.pu$h ();
c$ = Clazz.decorateAsClass (function () {
Clazz.prepareCallback (this, arguments);
this.data = null;
this.reader = null;
this.ptr = 0;
this.ptEnd = 0;
Clazz.instantialize (this, arguments);
}, JSV.source.JSVXmlReader, "DataString");
Clazz.makeConstructor (c$, 
function () {
this.data =  new JU.SB ();
});
Clazz.makeConstructor (c$, 
function (a) {
this.data = a;
this.ptEnd = a.length ();
}, "JU.SB");
$_M(c$, "getNCharactersRemaining", 
function () {
return this.ptEnd - this.ptr;
});
$_M(c$, "flush", 
function () {
if (this.data.length () < 1000 || this.ptEnd - this.ptr > 100) return;
this.data =  new JU.SB ().append (this.data.substring (this.ptr));
this.ptr = 0;
this.ptEnd = this.data.length ();
});
$_M(c$, "substring", 
function (a, b) {
return this.data.toString ().substring (a, b);
}, "~N,~N");
$_M(c$, "skipOver", 
function (a, b) {
if (this.skipTo (a, b) > 0 && this.ptr != this.ptEnd) {
this.ptr++;
}return this.ptr;
}, "~S,~B");
$_M(c$, "skipTo", 
function (a, b) {
if (this.data == null) return -1;
var c;
if (this.ptr == this.ptEnd) {
if (this.reader == null) return -1;
this.readLine ();
}var d = this.ptEnd - 1;
while (this.ptr < this.ptEnd && (c = this.data.charAt (this.ptr)) != a) {
if (b && c == '\\' && this.ptr < d) {
if ((c = this.data.charAt (this.ptr + 1)) == '"' || c == '\\') this.ptr++;
} else if (c == '"') {
this.ptr++;
if (this.skipTo ('"', true) < 0) return -1;
}if (++this.ptr == this.ptEnd) {
if (this.reader == null) return -1;
this.readLine ();
}}
return this.ptr;
}, "~S,~B");
$_M(c$, "readLine", 
function () {
return false;
});
c$ = Clazz.p0p ();
};
c$.$JSVXmlReader$XmlEvent$ = function () {
Clazz.pu$h ();
c$ = Clazz.decorateAsClass (function () {
Clazz.prepareCallback (this, arguments);
this.eventType = 0;
this.ptr = 0;
this.tag = null;
this.data = null;
Clazz.instantialize (this, arguments);
}, JSV.source.JSVXmlReader, "XmlEvent");
$_V(c$, "toString", 
function () {
return (this.data != null ? this.data : this.tag != null ? this.tag.text : null);
});
Clazz.makeConstructor (c$, 
function (a) {
this.eventType = a;
}, "~N");
Clazz.makeConstructor (c$, 
function (a) {
this.ptr = a.ptr;
var b = a.getNCharactersRemaining ();
this.eventType = (b == 0 ? 8 : b == 1 || a.data.charAt (a.ptr) != '<' ? 4 : a.data.charAt (a.ptr + 1) != '/' ? 1 : 2);
if (this.eventType == 8) return;
if (this.eventType == 4) {
a.skipTo ('<', false);
this.data = a.data.toString ().substring (this.ptr, a.ptr);
} else {
a.skipOver ('>', false);
var c = a.data.toString ().substring (this.ptr, a.ptr);
if (c.startsWith ("<!--")) this.eventType = 6;
this.tag = Clazz.innerTypeInstance (JSV.source.JSVXmlReader.Tag, this, null, c);
}}, "JSV.source.JSVXmlReader.DataBuffer");
$_M(c$, "getEventType", 
function () {
return this.eventType;
});
$_M(c$, "isStartElement", 
function () {
return (this.eventType & 1) != 0;
});
$_M(c$, "getTagName", 
function () {
return (this.tag == null ? null : this.tag.getName ());
});
$_M(c$, "getTagType", 
function () {
return (this.tag == null ? 0 : this.tag.tagType);
});
$_M(c$, "getAttributeByName", 
function (a) {
return (this.tag == null ? null : this.tag.getAttributeByName (a));
}, "~S");
c$ = Clazz.p0p ();
};
c$.$JSVXmlReader$Tag$ = function () {
Clazz.pu$h ();
c$ = Clazz.decorateAsClass (function () {
Clazz.prepareCallback (this, arguments);
this.tagType = 0;
this.name = null;
this.text = null;
this.attributes = null;
Clazz.instantialize (this, arguments);
}, JSV.source.JSVXmlReader, "Tag");
Clazz.makeConstructor (c$, 
function () {
});
Clazz.makeConstructor (c$, 
function (a) {
this.text = a;
this.tagType = (a.startsWith ("<!--") ? 6 : a.charAt (1) == '/' ? 2 : a.charAt (a.length - 2) == '/' ? 3 : 1);
}, "~S");
$_M(c$, "getName", 
function () {
if (this.name != null) return this.name;
var a = (this.tagType == 2 ? 2 : 1);
var b = this.text.length - (this.tagType == 3 ? 2 : 1);
while (a < b && Character.isWhitespace (this.text.charAt (a))) a++;

var c = a;
while (a < b && !Character.isWhitespace (this.text.charAt (a))) a++;

return this.name = this.text.substring (c, a).toLowerCase ().trim ();
});
$_M(c$, "getAttributeByName", 
function (a) {
if (this.attributes == null) this.getAttributes ();
return this.attributes.get (a.toLowerCase ());
}, "~S");
$_M(c$, "getAttributes", 
($fz = function () {
this.attributes =  new java.util.Hashtable ();
var a = Clazz.innerTypeInstance (JSV.source.JSVXmlReader.DataString, this, null,  new JU.SB ().append (this.text));
try {
if (a.skipTo (' ', false) < 0) return;
var b;
while ((b = ++a.ptr) >= 0) {
if (a.skipTo ('=', false) < 0) return;
var c = a.substring (b, a.ptr).trim ().toLowerCase ();
a.skipTo ('"', false);
b = ++a.ptr;
a.skipTo ('"', true);
var d = a.substring (b, a.ptr);
this.attributes.put (c, d);
var e = c.indexOf (":");
if (e >= 0) {
c = c.substring (e).trim ();
this.attributes.put (c, d);
}}
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
} else {
throw e;
}
}
}, $fz.isPrivate = true, $fz));
c$ = Clazz.p0p ();
};
Clazz.defineStatics (c$,
"TAG_NONE", 0,
"START_ELEMENT", 1,
"END_ELEMENT", 2,
"START_END_ELEMENT", 3,
"CHARACTERS", 4,
"COMMENT", 6,
"EOF", 8);
});
