abstract class WktVariant
extends java.lang.Object
There exist several dailects for WKT (e.g. postgis EWKT, SFS version 1.2.1 WKT). Instances of WktVariant
capture these differences. This allows easy customization of the WktTokenizer for particular WKT variants
or dialects.
| Modifier and Type | Field and Description |
|---|---|
private WktPunctuationToken |
closeList |
private WktPunctuationToken |
elementSeparator |
private WktPunctuationToken |
end |
private WktPunctuationToken |
openList |
| Modifier | Constructor and Description |
|---|---|
protected |
WktVariant(char openList,
char closeList,
char elementSeparator)
Constructs an instance with the specified punctuation tokens.
|
| Modifier and Type | Method and Description |
|---|---|
WktPunctuationToken |
end() |
WktPunctuationToken |
getCloseList() |
char |
getCloseListChar() |
WktPunctuationToken |
getElementSeparator() |
char |
getElemSepChar() |
WktPunctuationToken |
getOpenList() |
char |
getOpenListChar() |
protected abstract java.util.Set<WktKeywordToken> |
getWktKeywords()
Returns all
WktPatternTokens in this instance. |
WktKeywordToken |
matchKeyword(java.lang.CharSequence wkt,
int currentPos,
int endPos)
Attempts to match the specified subsequence of a
CharSequence to a keyword for the
this WktVariant. |
private final WktPunctuationToken openList
private final WktPunctuationToken closeList
private final WktPunctuationToken elementSeparator
private final WktPunctuationToken end
protected WktVariant(char openList,
char closeList,
char elementSeparator)
openList - the character that indicates the start of a list, e.g. '(' or '['closeList - the character that indicates the end of a list, e.g. ')' or ']'elementSeparator - the character that separates individual elements in a structure (usually ',')public WktKeywordToken matchKeyword(java.lang.CharSequence wkt, int currentPos, int endPos)
CharSequence to a keyword for the
this WktVariant.wkt - the input textcurrentPos - the start position for the matchendPos - the end position for the matchWktKeywordTokenWktDecodeException - if nothing matches at the specified substring.protected abstract java.util.Set<WktKeywordToken> getWktKeywords()
WktPatternTokens in this instance.public WktPunctuationToken getOpenList()
public WktPunctuationToken getCloseList()
public WktPunctuationToken getElementSeparator()
public WktPunctuationToken end()
public char getOpenListChar()
public char getCloseListChar()
public char getElemSepChar()