Class XmlSimpleFeatureParser
Object
XmlSimpleFeatureParser
- All Implemented Interfaces:
GetParser<SimpleFeature>
A
GetParser<SimpleFeature>
implementation that uses plain xml pull to parse a GetFeature response.- Since:
- 2.5.x
- Author:
- Gabriel Roldan (TOPP)
-
Constructor Summary
ConstructorsConstructorDescriptionXmlSimpleFeatureParser
(InputStream getFeatureResponseStream, SimpleFeatureType targetType, QName featureDescriptorName, String axisOrder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the parser.Get the feature type that the parser is targeting.int
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-1
if unknown.parse()
void
setGeometryFactory
(GeometryFactory geometryFactory) Set the geometry factory.
-
Constructor Details
-
XmlSimpleFeatureParser
public XmlSimpleFeatureParser(InputStream getFeatureResponseStream, SimpleFeatureType targetType, QName featureDescriptorName, String axisOrder) throws IOException - Throws:
IOException
-
-
Method Details
-
setGeometryFactory
Description copied from interface:GetParser
Set the geometry factory.- Specified by:
setGeometryFactory
in interfaceGetParser<SimpleFeature>
- Parameters:
geometryFactory
- The geometry factory to use.
-
getFeatureType
Description copied from interface:GetParser
Get the feature type that the parser is targeting.- Specified by:
getFeatureType
in interfaceGetParser<SimpleFeature>
- 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 thewfs:FeatureCollection
"numberOfFeatures" xml attribute, or-1
if unknown.- Specified by:
getNumberOfFeatures
in interfaceGetParser<SimpleFeature>
- Returns:
- number of features advertised by server, or
-1
if unknown
-
close
Description copied from interface:GetParser
Close the parser.- Specified by:
close
in interfaceGetParser<SimpleFeature>
- Throws:
IOException
- Throws IOException if there was a problem closing the parser.
-
parse
- Specified by:
parse
in interfaceGetParser<SimpleFeature>
- Returns:
- the next feature in the stream or
null
if there are no more features to parse. - Throws:
IOException
-