org.geotools.data.wfs.v1_1_0.parsers
Class Gml31GetFeatureResponseParserFactory

java.lang.Object
  extended by org.geotools.data.wfs.v1_1_0.parsers.Gml31GetFeatureResponseParserFactory
All Implemented Interfaces:
WFSResponseParserFactory

public class Gml31GetFeatureResponseParserFactory
extends java.lang.Object
implements WFSResponseParserFactory

A WFS response parser factory for GetFeature requests in text/xml; subtype=gml/3.1.1 output format.

Since:
2.6
Version:
$Id: Gml31GetFeatureResponseParserFactory.java 31888 2008-11-20 13:34:53Z groldan $
Author:
Gabriel Roldan (OpenGeo)

Constructor Summary
Gml31GetFeatureResponseParserFactory()
           
 
Method Summary
 boolean canProcess(org.eclipse.emf.ecore.EObject request)
          Checks if this factory can create a parser for the potential responses of the given WFS request.
 WFSResponseParser createParser(WFS_1_1_0_DataStore wfs, WFSResponse response)
          Returns either a FeatureCollectionParser or an ExceptionReportParser depending on what the server returned.
 boolean isAvailable()
          Indicates whether the factory instance is able to create parser instances.
protected  boolean isSupportedOutputFormat(java.lang.String outputFormat)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gml31GetFeatureResponseParserFactory

public Gml31GetFeatureResponseParserFactory()
Method Detail

isAvailable

public boolean isAvailable()
Description copied from interface: WFSResponseParserFactory
Indicates whether the factory instance is able to create parser instances.

Specified by:
isAvailable in interface WFSResponseParserFactory
Returns:
true if there's nothing preventing the creation of the parsers this factory should produce
See Also:
WFSResponseParserFactory.isAvailable()

canProcess

public boolean canProcess(org.eclipse.emf.ecore.EObject request)
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 GetFeature request and the request output format matches "text/xml; subtype=gml/3.1.1".

Specified by:
canProcess in interface WFSResponseParserFactory
Returns:
true if this factory can create a parser for the responses of the given request
See Also:
WFSResponseParserFactory#canProcess(WFSOperationType, String)

isSupportedOutputFormat

protected boolean isSupportedOutputFormat(java.lang.String outputFormat)

createParser

public WFSResponseParser createParser(WFS_1_1_0_DataStore wfs,
                                      WFSResponse response)
                               throws java.io.IOException
Returns either a FeatureCollectionParser or an ExceptionReportParser depending on what the server returned.

Ideally, the decision should only be taken based on the WFS response's content-type HTTP header. Truth is, some WFS implementations does not set proper HTTP response headers so a bit of an heuristic may be needed in order to identify the actual response.

Specified by:
createParser in interface WFSResponseParserFactory
Parameters:
wfs - the data store that issued the request that produced the given response
response - the handle to the response contents the WFS sent
Returns:
a WFSResponseParser that can deal with the given WFS response
Throws:
java.io.IOException
See Also:
WFSResponseParserFactory.createParser(WFS_1_1_0_DataStore, WFSResponse), FeatureCollectionParser, ExceptionReportParser


Copyright © 1996-2010 Geotools. All Rights Reserved.