Class AbstractGetFeatureResponseParserFactory
- Object
-
- AbstractWFSResponseFactory
-
- AbstractGetFeatureResponseParserFactory
-
- All Implemented Interfaces:
WFSResponseFactory
- Direct Known Subclasses:
ComplexGetFeatureResponseParserFactory,GetFeatureResponseParserFactory,GmlGetFeatureResponseParserFactory
public abstract class AbstractGetFeatureResponseParserFactory extends AbstractWFSResponseFactory
An abstract WFS response parser factory for GetFeature requests in GML output formats. Treats feature type's that implement SimpleFeatureType
-
-
Constructor Summary
Constructors Constructor Description AbstractGetFeatureResponseParserFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanProcess(WFSOperationType operation)booleancanProcess(WFSRequest request, String contentType)Checks if this factory can create a parser for the potential responses of the given WFS request.protected WFSResponsecreateResponseImpl(WFSRequest request, HTTPResponse response, InputStream in)Has to be implemented to turn the request and response into a properWFSResponse.protected FeatureTypegetRequestedType(GetFeatureRequest request)protected abstract List<String>getSupportedVersions()booleanisAvailable()Indicates whether the factory instance is able to create parser instances.protected booleanisValidResponseHead(String head)protected abstract GetParser<SimpleFeature>parser(GetFeatureRequest request, InputStream in)-
Methods inherited from class AbstractWFSResponseFactory
createResponse, parseException
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface WFSResponseFactory
getSupportedOutputFormats
-
-
-
-
Method Detail
-
isAvailable
public boolean isAvailable()
Description copied from interface:WFSResponseFactoryIndicates whether the factory instance is able to create parser instances.- Returns:
trueif there's nothing preventing the creation of the parsers this factory should produce- See Also:
WFSResponseFactory.isAvailable()
-
canProcess
public boolean canProcess(WFSRequest request, String contentType)
Checks if this factory can create a parser for the potential responses of the given WFS request.For instance, this factory can create a parser as long as the request is a
GetFeaturerequest and the request output format matches"text/xml; subtype=gml/3.1.1".It also checks that the requested type is a SimpleFeatureType
- Returns:
trueif this factory can create a parser for the responses of the given request- See Also:
WFSResponseFactory.canProcess(WFSRequest, String)
-
createResponseImpl
protected WFSResponse createResponseImpl(WFSRequest request, HTTPResponse response, InputStream in) throws IOException
Description copied from class:AbstractWFSResponseFactoryHas to be implemented to turn the request and response into a properWFSResponse.- Specified by:
createResponseImplin classAbstractWFSResponseFactoryin- The stream to read the response from. It is safe not to close this stream explicitly but to dispose the response instead.- Returns:
- The actual response
- Throws:
IOException
-
isValidResponseHead
protected boolean isValidResponseHead(String head)
- Specified by:
isValidResponseHeadin classAbstractWFSResponseFactory- Parameters:
head- The first couple of characters from the response, typically the first 512- Returns:
- true, if head is an indicator for the expected XML result structure.
-
canProcess
public boolean canProcess(WFSOperationType operation)
-
getRequestedType
protected FeatureType getRequestedType(GetFeatureRequest request)
-
parser
protected abstract GetParser<SimpleFeature> parser(GetFeatureRequest request, InputStream in) throws IOException
- Throws:
IOException
-
-