class SimpleGeoJSONPolygonParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.Object> |
coordinates |
(package private) java.lang.String |
input |
private java.lang.String |
polyType |
private int |
upto |
Constructor and Description |
---|
SimpleGeoJSONPolygonParser(java.lang.String input) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
isJSONWhitespace(char ch) |
private boolean |
isValidGeometryPath(java.lang.String path)
Returns true if the object path is a valid location to see a Multi/Polygon geometry
|
private java.text.ParseException |
newParseException(java.lang.String details)
When calling this, upto should be at the position of the incorrect character!
|
Polygon[] |
parse() |
private java.util.List<java.lang.Object> |
parseArray(java.lang.String path) |
private java.lang.Number |
parseNumber() |
private void |
parseObject(java.lang.String path)
path is the "address" by keys of where we are, e.g.
|
private double[][] |
parsePoints(java.util.List<java.lang.Object> o)
Parses [[lat, lon], [lat, lon] ...] into 2d double array
|
private Polygon |
parsePolygon(java.util.List<java.lang.Object> coordinates) |
private java.lang.String |
parseString() |
private char |
peek() |
private void |
readEnd() |
private void |
scan(char expected)
Scans across whitespace and consumes the expected character, or throws
ParseException if the character is wrong |
private void |
scan(java.lang.String expected)
Scans the expected string, or throws
ParseException |
final java.lang.String input
private int upto
private java.lang.String polyType
private java.util.List<java.lang.Object> coordinates
public SimpleGeoJSONPolygonParser(java.lang.String input)
public Polygon[] parse() throws java.text.ParseException
java.text.ParseException
private void parseObject(java.lang.String path) throws java.text.ParseException
java.text.ParseException
private boolean isValidGeometryPath(java.lang.String path)
private Polygon parsePolygon(java.util.List<java.lang.Object> coordinates) throws java.text.ParseException
java.text.ParseException
private double[][] parsePoints(java.util.List<java.lang.Object> o) throws java.text.ParseException
java.text.ParseException
private java.util.List<java.lang.Object> parseArray(java.lang.String path) throws java.text.ParseException
java.text.ParseException
private java.lang.Number parseNumber() throws java.text.ParseException
java.text.ParseException
private java.lang.String parseString() throws java.text.ParseException
java.text.ParseException
private char peek() throws java.text.ParseException
java.text.ParseException
private void scan(char expected) throws java.text.ParseException
ParseException
if the character is wrongjava.text.ParseException
private void readEnd() throws java.text.ParseException
java.text.ParseException
private void scan(java.lang.String expected) throws java.text.ParseException
ParseException
java.text.ParseException
private static boolean isJSONWhitespace(char ch)
private java.text.ParseException newParseException(java.lang.String details) throws java.text.ParseException
java.text.ParseException