public interface ILcdWFSModelDecoder
ILcdModel
s from WFS data sources.
In general, it is recommended to create a model by using
TLcdWFSProxyModel's builder
and specifying the WFS server URL and desired feature type name. This approach commonly works in case the WFS can
output the data according to a GML 2, 3.1.1 or 3.2 application schema. In case of a different exchange format or
if a customized decoding process is needed, an implementation of this interface can be created and used to decode
the data obtained from a WFS.
Implementations of this class can be supplied to the builder in TLcdWFSProxyModel
, the
recommended convenience class to create a model for a WFS data source. Alternatively, implementations can be
used in combination with TLcdWFSClient
, which provides low-level API methods to execute
GetFeature
requests and get the result as an input stream.
Implementations of this class should solely focus on decoding feature data content. Decoding and interpretation
of service exception reports in case of errors are automatically handled by TLcdWFSModelDecoderDecorator
,
which acts as a decorator for an ILcdWFSModelDecoder
. For convenience,
TLcdWFSProxyModel
automatically decorates any supplied ILcdWFSModelDecoder
with a
TLcdWFSModelDecoderDecorator
.
TLcdWFSProxyModel
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeModel(String aOutputFormat)
Given the name of an output format advertised by a WFS, determines whether
or not that format can be read by this decoder.
|
ILcdModel |
decodeModel(String aOutputFormat,
String aContentType,
InputStream aInputStream,
String aSourceName,
Properties aRequestProperties)
Decodes a model from the given input stream.
|
default ILcdModel |
decodeModel(String aOutputFormat,
String aWFSVersion,
String aContentType,
InputStream aInputStream,
String aSourceName,
Properties aRequestProperties)
Decodes a model from the given input stream.
|
boolean canDecodeModel(String aOutputFormat)
aOutputFormat
- the name of a format, e.g. "GML2"ILcdModel decodeModel(String aOutputFormat, String aContentType, InputStream aInputStream, String aSourceName, Properties aRequestProperties) throws IOException
aOutputFormat
- the format of the data contained in the given input stream,
as advertised in the WFS capabilities (e.g. "GML32)aContentType
- the MIME content type of the data contained in the given input stream (e.g. "text/xml")aInputStream
- the input stream containing the response of a WFS GetFeature
requestaSourceName
- the WFS server's URL, which could be used to build relative paths if needed.
Can be null
if unknown.aRequestProperties
- an optional set of request properties that could be used for additional web service connections
(e.g. XML Schema links contained in the WFS feature data).
Can be null
if not required / applicable.IOException
- if the model could not be decodeddefault ILcdModel decodeModel(String aOutputFormat, String aWFSVersion, String aContentType, InputStream aInputStream, String aSourceName, Properties aRequestProperties) throws IOException
decodeModel
, but you can override this to obtain the WFS version information.aOutputFormat
- the format of the data contained in the given input stream,
as advertised in the WFS capabilities (e.g. "GML32)aWFSVersion
- the WFS version of the response, null
if unknownaContentType
- the MIME content type of the data contained in the given input stream (e.g. "text/xml")aInputStream
- the input stream containing the response of a WFS GetFeature
requestaSourceName
- the WFS server's URL, which could be used to build relative paths if needed.
Can be null
.aRequestProperties
- an optional set of request properties that could be used for additional web service connections
(e.g. XML Schema links contained in the WFS feature data).
Can be null
.IOException
- if the model could not be decoded