Class XmlSimpleFeatureParser
- Object
-
- XmlSimpleFeatureParser
-
- All Implemented Interfaces:
GetParser<SimpleFeature>
public class XmlSimpleFeatureParser extends Object implements GetParser<SimpleFeature>
AGetParserimplementation 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 voidclose()Close the parser.FeatureTypegetFeatureType()Get the feature type that the parser is targeting.intgetNumberOfFeatures()Returns the number of features if advertised by the server and the parser was able to get that information for example from thewfs:FeatureCollection"numberOfFeatures" xml attribute, or-1if unknown.SimpleFeatureparse()voidsetGeometryFactory(GeometryFactory geometryFactory)Set the geometry factory.
-
-
-
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:GetParserSet the geometry factory.- Specified by:
setGeometryFactoryin interfaceGetParser<SimpleFeature>- Parameters:
geometryFactory- The geometry factory to use.
-
getFeatureType
public FeatureType getFeatureType()
Description copied from interface:GetParserGet the feature type that the parser is targeting.- Specified by:
getFeatureTypein interfaceGetParser<SimpleFeature>- Returns:
- The feature type that the parser is targeting.
-
getNumberOfFeatures
public int getNumberOfFeatures()
Description copied from interface:GetParserReturns the number of features if advertised by the server and the parser was able to get that information for example from thewfs:FeatureCollection"numberOfFeatures" xml attribute, or-1if unknown.- Specified by:
getNumberOfFeaturesin interfaceGetParser<SimpleFeature>- Returns:
- number of features advertised by server, or
-1if unknown
-
close
public void close() throws IOExceptionDescription copied from interface:GetParserClose the parser.- Specified by:
closein interfaceGetParser<SimpleFeature>- Throws:
IOException- Throws IOException if there was a problem closing the parser.
-
parse
public SimpleFeature parse() throws IOException
- Specified by:
parsein interfaceGetParser<SimpleFeature>- Returns:
- the next feature in the stream or
nullif there are no more features to parse. - Throws:
IOException
-
-