Class XmlFeatureParser<FT extends FeatureType,F extends Feature>
Object
XmlFeatureParser<FT,F>
- All Implemented Interfaces:
GetParser<F>
- Direct Known Subclasses:
XmlComplexFeatureParser
public abstract class XmlFeatureParser<FT extends FeatureType,F extends Feature>
extends Object
implements GetParser<F>
Abstract form of XmlFeatureParser. Mostly taken out from @
XmlSimpleFeatureParser
.- Author:
- Adam Brown (Curtin University of Technology)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXmlFeatureParser
(InputStream getFeatureResponseStream, FT targetType, QName featureDescriptorName, WFSStrategy strategy) -
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.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
void
setGeometryFactory
(GeometryFactory geometryFactory) Set the geometry factory.
-
Field Details
-
targetType
-
parser
-
-
Constructor Details
-
XmlFeatureParser
public XmlFeatureParser(InputStream getFeatureResponseStream, FT targetType, QName featureDescriptorName, WFSStrategy strategy) throws IOException - Throws:
IOException
-
-
Method Details
-
setGeometryFactory
Description copied from interface:GetParser
Set the geometry factory.- Specified by:
setGeometryFactory
in interfaceGetParser<FT extends FeatureType>
- 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<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 thewfs:FeatureCollection
"numberOfFeatures" xml attribute, or-1
if unknown.- Specified by:
getNumberOfFeatures
in interfaceGetParser<FT extends FeatureType>
- 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<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
- Throws:
IOException
XMLStreamException
-