public abstract class XmlFeatureParser<FT extends FeatureType,F extends Feature> extends Object implements GetParser<F>
XmlSimpleFeatureParser.| Modifier and Type | Field and Description | 
|---|---|
| protected XmlPullParser | parser | 
| protected FT | targetType | 
| Constructor and Description | 
|---|
| XmlFeatureParser(InputStream getFeatureResponseStream,
                FT targetType,
                QName featureDescriptorName) | 
| Modifier and Type | Method and 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-1if unknown. | 
| protected Object | parseAttributeValue(AttributeDescriptor attribute)Parses the value of the current attribute, parser cursor shall be on a feature attribute
 START_TAG event. | 
| protected Geometry | parseGeom()Precondition: parser cursor positioned on a geometry property (eg,  gml:Point, etc)
 Postcondition: parser gets positioned at the end tag of the element it started parsing the
 geometry at | 
| protected String | seekFeature() | 
| void | setGeometryFactory(GeometryFactory geometryFactory)Set the geometry factory. | 
protected FT extends FeatureType targetType
protected XmlPullParser parser
public XmlFeatureParser(InputStream getFeatureResponseStream, FT targetType, QName featureDescriptorName) throws IOException
IOExceptionpublic void setGeometryFactory(GeometryFactory geometryFactory)
GetParsersetGeometryFactory in interface GetParser<F extends Feature>geometryFactory - The geometry factory to use.public FT getFeatureType()
GetParsergetFeatureType in interface GetParser<F extends Feature>public int getNumberOfFeatures()
GetParserwfs:FeatureCollection "numberOfFeatures" xml
 attribute, or -1 if unknown.getNumberOfFeatures in interface GetParser<F extends Feature>-1 if unknownpublic void close()
           throws IOException
GetParserclose in interface GetParser<F extends Feature>IOException - Throws IOException if there was a problem closing the parser.protected Object parseAttributeValue(AttributeDescriptor attribute) throws XmlPullParserException, IOException
IOExceptionXmlPullParserExceptionFactoryExceptionNoSuchAuthorityCodeExceptionprotected Geometry parseGeom()
                      throws NoSuchAuthorityCodeException,
                             FactoryException,
                             XmlPullParserException,
                             IOException
gml:Point, etc)
 Postcondition: parser gets positioned at the end tag of the element it started parsing the geometry at
FactoryExceptionNoSuchAuthorityCodeExceptionIOExceptionXmlPullParserExceptionprotected String seekFeature() throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionCopyright © 1996–2019 Geotools. All rights reserved.