org.geotools.geojson.feature
Class FeatureTypeHandler

Object
  extended by DelegatingHandler<SimpleFeatureType>
      extended by FeatureTypeHandler
All Implemented Interfaces:
IContentHandler<SimpleFeatureType>, ContentHandler

public class FeatureTypeHandler
extends DelegatingHandler<SimpleFeatureType>
implements IContentHandler<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 DelegatingHandler
delegate, handlers, NULL, NULL_LIST, UNINITIALIZED
 
Constructor Summary
FeatureTypeHandler(boolean nullValuesEncoded)
           
 
Method Summary
 void endJSON()
           
 boolean endObject()
           
 boolean endObjectEntry()
           
 SimpleFeatureType getValue()
           
 boolean primitive(Object value)
           
 boolean startArray()
           
 boolean startObjectEntry(String key)
           
 
Methods inherited from class DelegatingHandler
createDelegate, endArray, getDelegate, lookupDelegate, startJSON, startObject
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ContentHandler
endArray, startJSON, startObject
 

Constructor Detail

FeatureTypeHandler

public FeatureTypeHandler(boolean nullValuesEncoded)
Method Detail

startObjectEntry

public boolean startObjectEntry(String key)
                         throws ParseException,
                                IOException
Specified by:
startObjectEntry in interface ContentHandler
Overrides:
startObjectEntry in class DelegatingHandler<SimpleFeatureType>
Throws:
ParseException
IOException

startArray

public boolean startArray()
                   throws ParseException,
                          IOException
Specified by:
startArray in interface ContentHandler
Overrides:
startArray in class DelegatingHandler<SimpleFeatureType>
Throws:
ParseException
IOException

endObject

public boolean endObject()
                  throws ParseException,
                         IOException
Specified by:
endObject in interface ContentHandler
Overrides:
endObject in class DelegatingHandler<SimpleFeatureType>
Throws:
ParseException
IOException

primitive

public boolean primitive(Object value)
                  throws ParseException,
                         IOException
Specified by:
primitive in interface ContentHandler
Overrides:
primitive in class DelegatingHandler<SimpleFeatureType>
Throws:
ParseException
IOException

endObjectEntry

public boolean endObjectEntry()
                       throws ParseException,
                              IOException
Specified by:
endObjectEntry in interface ContentHandler
Overrides:
endObjectEntry in class DelegatingHandler<SimpleFeatureType>
Throws:
ParseException
IOException

endJSON

public void endJSON()
             throws ParseException,
                    IOException
Specified by:
endJSON in interface ContentHandler
Overrides:
endJSON in class DelegatingHandler<SimpleFeatureType>
Throws:
ParseException
IOException

getValue

public SimpleFeatureType getValue()
Specified by:
getValue in interface IContentHandler<SimpleFeatureType>
Overrides:
getValue in class DelegatingHandler<SimpleFeatureType>


Copyright © 1996-2014 Geotools. All Rights Reserved.