public static final class TLcdWFSProxyModel.Builder extends Object
A builder class for TLcdWFSProxyModel
instances.
You should at least call one of the server
methods
and one of the featureTypeName
methods before you
can call the build()
method.
TLcdWFSProxyModel proxyModel =
TLcdWFSProxyModel.Builder.newBuilder()
.server( "http://localhost:8081/LuciadFusion/wfs" )
.featureTypeName( "riversType" )
.build();
TLcdWFSProxyModel proxyModel =
TLcdWFSProxyModel.Builder.newBuilder()
.server( "http://localhost:8081/LuciadFusion/wfs" )
.featureTypeName( "riversType" )
.build();
//Disable the caching to ensure that a fresh query is sent to the server
proxyModel.setCachingMode(TLcdWFSProxyModel.NO_CACHE);
//Further configure the query parameters on the model
proxyModel.setFilter( ... );
proxyModel.setMaxFeatures( 100 );
//Perform the query
Enumeration elements = proxyModel.elements();
Modifier and Type | Method and Description |
---|---|
TLcdWFSProxyModel |
build()
Returns a new
TLcdWFSProxyModel for the specified settings, which is optimized for being visualized on the map. |
TLcdWFSProxyModel.Builder |
dataSource(ILcdDataSource aDataSource)
Specifies the
server and featureTypeName parameters using the given data source. |
TLcdWFSProxyModel.Builder |
featureTypeName(QName aFeatureTypeName)
Specifies the name of the feature type as a qualified name.
|
TLcdWFSProxyModel.Builder |
featureTypeName(String aFeatureTypeName)
Specifies the name of the feature type.
|
TLcdWFSProxyModel.Builder |
modelDecoder(ILcdWFSModelDecoder aModelDecoder)
Specifies the WFS model decoder that will be used to decode the response from the WFS server
|
TLcdWFSProxyModel.Builder |
modelDecoder(String aOutputFormat,
ILcdWFSModelDecoder aModelDecoder)
Specifies the WFS model decoder that will be used to decode the response from the WFS server when this response
is in the specified output format.
|
TLcdWFSProxyModel.Builder |
modelReferenceParser(ILcdModelReferenceParser aModelReferenceParser)
Specifies the reference parser that will be used by the proxy model.
|
static TLcdWFSProxyModel.Builder |
newBuilder()
Returns a new
Builder instance. |
TLcdWFSProxyModel.Builder |
requestProperty(String aKey,
String aValue)
Sets the general request property.
|
TLcdWFSProxyModel.Builder |
server(String aServerAddress)
Specifies the address of the WFS server.
|
TLcdWFSProxyModel.Builder |
server(TLcdWFSCapabilities aWFSCapabilities)
Specifies the address of the WFS server.
|
TLcdWFSProxyModel.Builder |
server(TLcdWFSClient aWFSClient)
Specifies the address of the WFS server.
|
TLcdWFSProxyModel.Builder |
server(URI aServerURI)
Specifies the address of the WFS server.
|
public static TLcdWFSProxyModel.Builder newBuilder()
Builder
instance.Builder
instance.public TLcdWFSProxyModel.Builder server(String aServerAddress)
aServerAddress
- The address of the WFS server as a string.public TLcdWFSProxyModel.Builder server(URI aServerURI)
aServerURI
- The address of the WFS server as a URIpublic TLcdWFSProxyModel.Builder server(TLcdWFSClient aWFSClient)
aWFSClient
- A WFS client instance configured for the WFS server for which a TLcdWFSProxyModel
is under construction.public TLcdWFSProxyModel.Builder server(TLcdWFSCapabilities aWFSCapabilities)
aWFSCapabilities
- A WFS capabilities instance configured for the WFS server for which a TLcdWFSProxyModel
is under construction.public TLcdWFSProxyModel.Builder dataSource(ILcdDataSource aDataSource)
server
and featureTypeName
parameters using the given data source.aDataSource
- the data source which has the information to fill builder parameters.public TLcdWFSProxyModel.Builder featureTypeName(String aFeatureTypeName)
{namespace}localPart
, the name is interpreted as a fully qualified name,
consisting of a namespace and a local part.
If the name is specified as prefix:localPart
, the name is interpreted as a prefixed name,
consisting of a prefix and a local part.
In all other cases, the name is interpreted as an unqualified name, not linked to a namespace or prefix.
An alternative approach to specify a qualified or prefixed name is to use the method featureTypeName(QName)
.aFeatureTypeName
- the name of the feature typefeatureTypeName(QName)
public TLcdWFSProxyModel.Builder featureTypeName(QName aFeatureTypeName)
aFeatureTypeName
- the name of the feature typefeatureTypeName(String)
public TLcdWFSProxyModel.Builder modelDecoder(String aOutputFormat, ILcdWFSModelDecoder aModelDecoder)
Specifies the WFS model decoder that will be used to decode the response from the WFS server when this response
is in the specified output format.
For that output format, it will take precedence over the model decoder specified with modelDecoder(ILcdWFSModelDecoder)
.
Note that this method only allows to specify one model decoder for each output format. If you call this method multiple times for the same format, only the model decoder of the last call will be considered.
See How to receive GeoJSON data via a WFS request for an example usage of this method.
aOutputFormat
- The output format.
The output format should be one of the output formats exposed in the WFS capabilities
(see the <wfs:OutputFormats>
or the <ows:Parameter name="outputFormat">
in the capabilities).aModelDecoder
- The model decoderpublic TLcdWFSProxyModel.Builder modelDecoder(ILcdWFSModelDecoder aModelDecoder)
aModelDecoder
- The model decoderpublic TLcdWFSProxyModel.Builder modelReferenceParser(ILcdModelReferenceParser aModelReferenceParser)
Specifies the reference parser that will be used by the proxy model. This should only be used to support servers that use custom reference names.
The reference parser will be used for:
defaultSRS
of the feature type of the proxy model.srsNames
that occur in results of 'GetFeature' requests in case no custom model decoder is used.aModelReferenceParser
- The model reference parserpublic TLcdWFSProxyModel.Builder requestProperty(String aKey, String aValue)
null
is specified as value, the property is removed.aKey
- the keyword by which the request is known (for example "accept"
)aValue
- the value associated with itURLConnection.setRequestProperty(String, String)
public TLcdWFSProxyModel build() throws IOException
Returns a new TLcdWFSProxyModel
for the specified settings, which is optimized for being visualized on the map.
You need to call one of the server
methods and one of the featureTypeName
methods on this builder
before attempting to build the model.
After calling this method, the builder can no longer be used. Any further interactions with it will throw exceptions.
TLcdWFSProxyModel
instance.IOException
- if the proxy model cannot be created