Class XmlFeatureParser<FT extends FeatureType,​F extends Feature>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected XMLStreamReader parser  
      protected FT targetType  
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlFeatureParser​(InputStream getFeatureResponseStream, FT targetType, QName featureDescriptorName, WFSStrategy strategy)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the parser.
      FT 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.
      protected Object parseAttributeValue​(AttributeDescriptor attribute)
      Parses the value of the current attribute, parser cursor shall be on a feature attribute START_ELEMENT event.
      protected String seekFeature()  
      void setGeometryFactory​(GeometryFactory geometryFactory)
      Set the geometry factory.
      • Methods inherited from class Object

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

      • parser

        protected XMLStreamReader parser
    • Constructor Detail

      • XmlFeatureParser

        public XmlFeatureParser​(InputStream getFeatureResponseStream,
                                FT targetType,
                                QName featureDescriptorName,
                                WFSStrategy strategy)
                         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<FT extends FeatureType>
        Parameters:
        geometryFactory - The geometry factory to use.
      • getFeatureType

        public FT getFeatureType()
        Description copied from interface: GetParser
        Get the feature type that the parser is targeting.
        Specified by:
        getFeatureType in interface GetParser<FT extends FeatureType>
        Returns:
        The feature type that the parser is targeting.
      • 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<FT extends FeatureType>
        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<FT extends FeatureType>
        Throws:
        IOException - Throws IOException if there was a problem closing the parser.
      • parseAttributeValue

        protected Object parseAttributeValue​(AttributeDescriptor attribute)
                                      throws XMLStreamException,
                                             IOException
        Parses the value of the current attribute, parser cursor shall be on a feature attribute START_ELEMENT event.
        Throws:
        XMLStreamException
        IOException
      • seekFeature

        protected String seekFeature()
                              throws IOException,
                                     XMLStreamException
        Throws:
        IOException
        XMLStreamException