|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--superwaba.ext.xplat.util.xml.XmlLiteParser
This is a fast and simple parser for a lite version of XML format. You can use this parser with SuperWaba VM to parse data from an open Stream.
The parser looks for:
When the parser finds these elements it calls respectively:
The parsing algorithm is based on DFA (Deterministic Finite Automata)
theory and Regular Expression theory. See the following schema:
In order to use this parser you need to extend the XmlListener class and override the above methods. To start parsing, call the method parse(byte inputBytes, int length).
See also superwaba/examples/util/xml.
| Field Summary | |
protected XmlListener |
listener
Listener of this parser |
protected int |
pos
pos in buffer |
protected int |
state
current state |
| Constructor Summary | |
XmlLiteParser(XmlListener listener)
|
|
| Method Summary | |
void |
parse(byte[] input,
int size)
This method parses the given array of bytes. |
protected void |
parseBuffer(byte[] input,
int size)
This method does the actual parsing and call backs working for the current values of pos, len, start and state. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
| Field Detail |
protected XmlListener listener
protected int state
protected int pos
| Constructor Detail |
public XmlLiteParser(XmlListener listener)
| Method Detail |
public void parse(byte[] input,
int size)
throws ParserException
input - The input byte array.size - The size of bytes to be parsed. Normally should be input.length
protected void parseBuffer(byte[] input,
int size)
throws ParserException
size -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||