Class XmlSimpleFeatureParser

  • All Implemented Interfaces:
    GetParser<SimpleFeature>

    public class XmlSimpleFeatureParser
    extends Object
    implements GetParser<SimpleFeature>
    A GetParser implementation that uses plain xml pull to parse a GetFeature response.
    Since:
    2.5.x

    Author:
    Gabriel Roldan (TOPP)
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlSimpleFeatureParser​(InputStream getFeatureResponseStream, SimpleFeatureType targetType, QName featureDescriptorName, String axisOrder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the parser.
      FeatureType getFeatureType()
      Get the feature type that the parser is targeting.
      int getNumberOfFeatures()
      Returns the number of features if advertised by the server and the parser was able to get that information for example from the wfs:FeatureCollection "numberOfFeatures" xml attribute, or -1 if unknown.
      SimpleFeature parse()  
      void setGeometryFactory​(GeometryFactory geometryFactory)
      Set the geometry factory.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlSimpleFeatureParser

        public XmlSimpleFeatureParser​(InputStream getFeatureResponseStream,
                                      SimpleFeatureType targetType,
                                      QName featureDescriptorName,
                                      String axisOrder)
                               throws IOException
        Throws:
        IOException
    • Method Detail

      • setGeometryFactory

        public void setGeometryFactory​(GeometryFactory geometryFactory)
        Description copied from interface: GetParser
        Set the geometry factory.
        Specified by:
        setGeometryFactory in interface GetParser<SimpleFeature>
        Parameters:
        geometryFactory - The geometry factory to use.
      • getNumberOfFeatures

        public int getNumberOfFeatures()
        Description copied from interface: GetParser
        Returns the number of features if advertised by the server and the parser was able to get that information for example from the wfs:FeatureCollection "numberOfFeatures" xml attribute, or -1 if unknown.
        Specified by:
        getNumberOfFeatures in interface GetParser<SimpleFeature>
        Returns:
        number of features advertised by server, or -1 if unknown
      • close

        public void close()
                   throws IOException
        Description copied from interface: GetParser
        Close the parser.
        Specified by:
        close in interface GetParser<SimpleFeature>
        Throws:
        IOException - Throws IOException if there was a problem closing the parser.
      • parse

        public SimpleFeature parse()
                            throws IOException
        Specified by:
        parse in interface GetParser<SimpleFeature>
        Returns:
        the next feature in the stream or null if there are no more features to parse.
        Throws:
        IOException