Package org.geotools.geojson.feature
Class FeatureTypeHandler
java.lang.Object
org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
org.geotools.geojson.feature.FeatureTypeHandler
- All Implemented Interfaces:
org.geotools.geojson.IContentHandler<org.geotools.api.feature.simple.SimpleFeatureType>
,org.json.simple.parser.ContentHandler
public class FeatureTypeHandler
extends org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
implements org.geotools.geojson.IContentHandler<org.geotools.api.feature.simple.SimpleFeatureType>
Obtains a complete feature type from GeoJSON by parsing beyond first feature and finding attributes that did not appear in the first feature or had null values.
If null values are encoded, parsing will stop when all data types are found. In the worst case, all features will be parsed. If null values are not encoded, all features will be parsed anyway.
-
Field Summary
Fields inherited from class org.geotools.geojson.DelegatingHandler
delegate, handlers, NULL, NULL_LIST, UNINITIALIZED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endJSON()
boolean
boolean
org.geotools.api.feature.simple.SimpleFeatureType
getValue()
boolean
boolean
boolean
startObjectEntry
(String key) Methods inherited from class org.geotools.geojson.DelegatingHandler
createDelegate, endArray, getDelegate, lookupDelegate, startJSON, startObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.json.simple.parser.ContentHandler
endArray, startJSON, startObject
-
Constructor Details
-
FeatureTypeHandler
public FeatureTypeHandler(boolean nullValuesEncoded)
-
-
Method Details
-
startObjectEntry
public boolean startObjectEntry(String key) throws org.json.simple.parser.ParseException, IOException - Specified by:
startObjectEntry
in interfaceorg.json.simple.parser.ContentHandler
- Overrides:
startObjectEntry
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Throws:
org.json.simple.parser.ParseException
IOException
-
startArray
- Specified by:
startArray
in interfaceorg.json.simple.parser.ContentHandler
- Overrides:
startArray
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Throws:
org.json.simple.parser.ParseException
IOException
-
endObject
- Specified by:
endObject
in interfaceorg.json.simple.parser.ContentHandler
- Overrides:
endObject
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Throws:
org.json.simple.parser.ParseException
IOException
-
primitive
- Specified by:
primitive
in interfaceorg.json.simple.parser.ContentHandler
- Overrides:
primitive
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Throws:
org.json.simple.parser.ParseException
IOException
-
endObjectEntry
- Specified by:
endObjectEntry
in interfaceorg.json.simple.parser.ContentHandler
- Overrides:
endObjectEntry
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Throws:
org.json.simple.parser.ParseException
IOException
-
endJSON
- Specified by:
endJSON
in interfaceorg.json.simple.parser.ContentHandler
- Overrides:
endJSON
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Throws:
org.json.simple.parser.ParseException
IOException
-
getValue
public org.geotools.api.feature.simple.SimpleFeatureType getValue()- Specified by:
getValue
in interfaceorg.geotools.geojson.IContentHandler<org.geotools.api.feature.simple.SimpleFeatureType>
- Overrides:
getValue
in classorg.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
-