|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.io.gml.GMLTokenizer
This class is used to parse a valid stream from a reader, which contains well formed gml. A callback method must be registered with this class, whose methods will be invoked during the parsing of the stream.
Nested Class Summary | |
static interface |
GMLTokenizer.Callback
The interface used for the callback during parsing. |
static class |
GMLTokenizer.DebugCallback
An implementation of the callback which can be used to debug the parser. |
static class |
GMLTokenizer.EncoderCallback
An implementation of the callback, which will call the appropriate methods on an encoder. |
Field Summary | |
protected static int |
AMPERSAND
|
protected static int |
CLOSE
|
protected static int |
COMMENT
|
protected static int |
DIGIT
|
protected static int |
EOF
|
protected static int |
LETTER
|
protected static int |
NEWLINE
|
protected static int |
OPEN
|
protected static int |
QUOTE
|
protected static int |
UNKNOWN
|
protected static int |
WHITESPACE
|
Constructor Summary | |
GMLTokenizer()
Creates a new instance of GMLTokenizer |
|
GMLTokenizer(GMLTokenizer.Callback callback)
Creates a new instance of GMLTokenizer and installs the given callback |
Method Summary | |
protected int |
classify(char c)
classifies the given character |
GMLTokenizer.Callback |
getCallback()
Getter for property callback. |
protected int |
lookAhead(PushbackReader reader)
takes a look at the next character in the stream and classifies it using one of the constants. |
protected void |
parse(PushbackReader pbReader)
this is the actual parsing method |
void |
parse(Reader reader)
starts the parsing and will fire events to the registered callback |
protected void |
parseComment(PushbackReader reader)
parses a comment whitespace |
protected char |
parseEntity(PushbackReader reader)
parses an entity from a GML "instring" |
protected String |
parseInString(PushbackReader reader)
parses the GML "instring" |
protected String |
parseKey(PushbackReader reader)
parses a key |
protected List |
parseList(PushbackReader reader)
parses a GML list |
protected Number |
parseNumber(PushbackReader reader)
parses a Number (Double or Integer) |
protected String |
parseString(PushbackReader reader)
parses a GML String, i.e. removes the quotes and replaces ISO 8859-1 entities with their corresponding characters. |
protected Object |
parseValue(PushbackReader reader)
parses a value, which might be either a String, or a Number, i.e. either Integer or Double |
protected void |
parseWhiteSpace(PushbackReader reader)
parses whitespace |
void |
setCallback(GMLTokenizer.Callback callback)
Setter for property callback. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int OPEN
protected static final int CLOSE
protected static final int AMPERSAND
protected static final int QUOTE
protected static final int WHITESPACE
protected static final int LETTER
protected static final int DIGIT
protected static final int EOF
protected static final int NEWLINE
protected static final int COMMENT
protected static final int UNKNOWN
Constructor Detail |
public GMLTokenizer()
public GMLTokenizer(GMLTokenizer.Callback callback)
callback
- the callback to be usedMethod Detail |
public void parse(Reader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the stream to be parsedprotected int lookAhead(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the reader from which to read
protected void parse(PushbackReader pbReader) throws IOException
IOException
- in the case of an I/O ExceptionpbReader
- the reader which will be used to parse the streamprotected int classify(char c)
c
- the character
protected void parseWhiteSpace(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the readerprotected void parseComment(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the readerprotected String parseKey(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the reader
protected Object parseValue(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the reader
protected Number parseNumber(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the reader
protected String parseString(PushbackReader reader) throws IOException
IOException
- in the case of an I/O Exceptionreader
- the reader
protected String parseInString(PushbackReader reader) throws IOException
IOException
protected char parseEntity(PushbackReader reader) throws IOException
IOException
protected List parseList(PushbackReader reader) throws IOException
IOException
public GMLTokenizer.Callback getCallback()
public void setCallback(GMLTokenizer.Callback callback)
callback
- New value of property callback.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |