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

    Constructors
    Constructor
    Description
    FeatureTypeHandler(boolean nullValuesEncoded)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
     
    boolean
     
    org.geotools.api.feature.simple.SimpleFeatureType
     
    boolean
     
    boolean
     
    boolean
     

    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 interface org.json.simple.parser.ContentHandler
      Overrides:
      startObjectEntry in class org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
      Throws:
      org.json.simple.parser.ParseException
      IOException
    • startArray

      public boolean startArray() throws org.json.simple.parser.ParseException, IOException
      Specified by:
      startArray in interface org.json.simple.parser.ContentHandler
      Overrides:
      startArray in class org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
      Throws:
      org.json.simple.parser.ParseException
      IOException
    • endObject

      public boolean endObject() throws org.json.simple.parser.ParseException, IOException
      Specified by:
      endObject in interface org.json.simple.parser.ContentHandler
      Overrides:
      endObject in class org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
      Throws:
      org.json.simple.parser.ParseException
      IOException
    • primitive

      public boolean primitive(Object value) throws org.json.simple.parser.ParseException, IOException
      Specified by:
      primitive in interface org.json.simple.parser.ContentHandler
      Overrides:
      primitive in class org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
      Throws:
      org.json.simple.parser.ParseException
      IOException
    • endObjectEntry

      public boolean endObjectEntry() throws org.json.simple.parser.ParseException, IOException
      Specified by:
      endObjectEntry in interface org.json.simple.parser.ContentHandler
      Overrides:
      endObjectEntry in class org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>
      Throws:
      org.json.simple.parser.ParseException
      IOException
    • endJSON

      public void endJSON() throws org.json.simple.parser.ParseException, IOException
      Specified by:
      endJSON in interface org.json.simple.parser.ContentHandler
      Overrides:
      endJSON in class org.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 interface org.geotools.geojson.IContentHandler<org.geotools.api.feature.simple.SimpleFeatureType>
      Overrides:
      getValue in class org.geotools.geojson.DelegatingHandler<org.geotools.api.feature.simple.SimpleFeatureType>