Class PullParserFeatureReader
- Object
-
- PullParserFeatureReader
-
- All Implemented Interfaces:
GetParser<SimpleFeature>
public class PullParserFeatureReader extends Object implements GetParser<SimpleFeature>
GetParser
forWFSFeatureReader
that uses the geotoolsPullParser
to fetch Features out of a WFS GetFeature response.- Author:
- Niels Charlier
-
-
Constructor Summary
Constructors Constructor Description PullParserFeatureReader(Configuration wfsConfiguration, InputStream getFeatureResponseStream, FeatureType featureType, String axisOrder)
PullParserFeatureReader(Configuration wfsConfiguration, InputStream getFeatureResponseStream, FeatureType featureType, String axisOrder, HTTPClient client)
Initialise a feature reader with the used http client, to ensure reuse of the configuration.
-
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 thewfs:FeatureCollection
"numberOfFeatures" xml attribute, or-1
if unknown.SimpleFeature
parse()
void
setContextCustomizer(ParserHandler.ContextCustomizer contextCustomizer)
void
setGeometryFactory(GeometryFactory geometryFactory)
Set the geometry factory.
-
-
-
Constructor Detail
-
PullParserFeatureReader
public PullParserFeatureReader(Configuration wfsConfiguration, InputStream getFeatureResponseStream, FeatureType featureType, String axisOrder) throws IOException
- Throws:
IOException
-
PullParserFeatureReader
public PullParserFeatureReader(Configuration wfsConfiguration, InputStream getFeatureResponseStream, FeatureType featureType, String axisOrder, HTTPClient client) throws IOException
Initialise a feature reader with the used http client, to ensure reuse of the configuration.- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOException
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.- See Also:
GetParser.close()
-
parse
public SimpleFeature parse() throws IOException
- 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
- See Also:
GetParser.parse()
-
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 - See Also:
GetParser.getNumberOfFeatures()
-
getFeatureType
public FeatureType 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.
-
setGeometryFactory
public void setGeometryFactory(GeometryFactory geometryFactory)
Description copied from interface:GetParser
Set the geometry factory.- Specified by:
setGeometryFactory
in interfaceGetParser<SimpleFeature>
- Parameters:
geometryFactory
- The geometry factory to use.
-
setContextCustomizer
public void setContextCustomizer(ParserHandler.ContextCustomizer contextCustomizer)
-
-