|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.gml.GMLTokenizer
public class 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
The type constant for '&' |
protected static int |
CLOSE
The closing brace type constant ']' |
protected static int |
COMMENT
The type constant for a comment in a gml file |
protected static int |
DIGIT
The type constant for a digit in GML |
protected static int |
EOF
The type constant for the end of file token |
protected static int |
LETTER
The type constant for a letter in GML |
protected static int |
NEWLINE
The type constant for a newline in a gml file |
protected static int |
OPEN
The opening brace type constant '[' |
protected static int |
QUOTE
The type constant for '"' |
protected static int |
UNKNOWN
The type constant for anything that cannot be categorized in GML |
protected static int |
WHITESPACE
The type constant for any type of whitespace in GML |
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(java.io.PushbackReader reader)
takes a look at the next character in the stream and classifies it using one of the constants. |
protected void |
parse(java.io.PushbackReader pbReader)
this is the actual parsing method |
void |
parse(java.io.Reader reader)
starts the parsing and will fire events to the registered callback |
protected void |
parseComment(java.io.PushbackReader reader)
parses a comment whitespace |
protected char |
parseEntity(java.io.PushbackReader reader)
parses an entity from a GML "instring" |
protected java.lang.String |
parseInString(java.io.PushbackReader reader)
parses the GML "instring" |
protected java.lang.String |
parseKey(java.io.PushbackReader reader)
parses a key |
protected java.util.List |
parseList(java.io.PushbackReader reader)
parses a GML list |
protected java.lang.Number |
parseNumber(java.io.PushbackReader reader)
parses a Number (Double or Integer) |
protected java.lang.String |
parseString(java.io.PushbackReader reader)
parses a GML String, i.e. removes the quotes and replaces ISO 8859-1 entities with their corresponding characters. |
protected java.lang.Object |
parseValue(java.io.PushbackReader reader)
parses a value, which might be either a String, or a Number, i.e. either Integer or Double |
protected void |
parseWhiteSpace(java.io.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(java.io.Reader reader) throws java.io.IOException
reader
- the stream to be parsed
java.io.IOException
- in the case of an I/O Exceptionprotected int lookAhead(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader from which to read
java.io.IOException
- in the case of an I/O Exceptionprotected void parse(java.io.PushbackReader pbReader) throws java.io.IOException
pbReader
- the reader which will be used to parse the stream
java.io.IOException
- in the case of an I/O Exceptionprotected int classify(char c)
c
- the character
protected void parseWhiteSpace(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- in the case of an I/O Exceptionprotected void parseComment(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- in the case of an I/O Exceptionprotected java.lang.String parseKey(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- in the case of an I/O Exceptionprotected java.lang.Object parseValue(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- in the case of an I/O Exceptionprotected java.lang.Number parseNumber(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- in the case of an I/O Exceptionprotected java.lang.String parseString(java.io.PushbackReader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- in the case of an I/O Exceptionprotected java.lang.String parseInString(java.io.PushbackReader reader) throws java.io.IOException
java.io.IOException
protected char parseEntity(java.io.PushbackReader reader) throws java.io.IOException
java.io.IOException
protected java.util.List parseList(java.io.PushbackReader reader) throws java.io.IOException
java.io.IOException
public GMLTokenizer.Callback getCallback()
public void setCallback(GMLTokenizer.Callback callback)
callback
- New value of property callback.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |