Class TLcdWFSProxyModel.Builder
- Enclosing class:
TLcdWFSProxyModel
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.
Example usages
-
Creating a model optimized for visualization
TLcdWFSProxyModel proxyModel = TLcdWFSProxyModel.Builder.newBuilder() .server( "http://localhost:8081/LuciadFusion/wfs" ) .featureTypeName( "riversType" ) .build();
-
Creating a model to execute a single query
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();
- Since:
- 2016.1
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newTLcdWFSProxyModel
for the specified settings, which is optimized for being visualized on the map.dataSource
(ILcdDataSource aDataSource) Specifies theserver
andfeatureTypeName
parameters using the given data source.featureTypeName
(String aFeatureTypeName) Specifies the name of the feature type.featureTypeName
(QName aFeatureTypeName) Specifies the name of the feature type as a qualified name.modelDecoder
(ILcdWFSModelDecoder aModelDecoder) Specifies the WFS model decoder that will be used to decode the response from the WFS servermodelDecoder
(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.modelReferenceParser
(ILcdModelReferenceParser aModelReferenceParser) Specifies the reference parser that will be used by the proxy model.static TLcdWFSProxyModel.Builder
Returns a newBuilder
instance.requestProperty
(String aKey, String aValue) Sets the general request property.server
(TLcdWFSClient aWFSClient) Specifies the address of the WFS server.server
(TLcdWFSCapabilities aWFSCapabilities) Specifies the address of the WFS server.Specifies the address of the WFS server.Specifies the address of the WFS server.
-
Method Details
-
newBuilder
Returns a newBuilder
instance.- Returns:
- a new
Builder
instance.
-
server
Specifies the address of the WFS server.- Parameters:
aServerAddress
- The address of the WFS server as a string.- Returns:
- this builder instance
-
server
Specifies the address of the WFS server.- Parameters:
aServerURI
- The address of the WFS server as a URI- Returns:
- this builder instance
-
server
Specifies the address of the WFS server.- Parameters:
aWFSClient
- A WFS client instance configured for the WFS server for which aTLcdWFSProxyModel
is under construction.- Returns:
- this builder instance
-
server
Specifies the address of the WFS server.- Parameters:
aWFSCapabilities
- A WFS capabilities instance configured for the WFS server for which aTLcdWFSProxyModel
is under construction.- Returns:
- this builder instance
-
dataSource
Specifies theserver
andfeatureTypeName
parameters using the given data source.- Parameters:
aDataSource
- the data source which has the information to fill builder parameters.- Returns:
- this builder instance
- Since:
- 2018.0
-
featureTypeName
Specifies the name of the feature type. If the name is specified as{namespace}localPart
, the name is interpreted as a fully qualified name, consisting of a namespace and a local part. If the name is specified asprefix: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 methodfeatureTypeName(QName)
.- Parameters:
aFeatureTypeName
- the name of the feature type- Returns:
- this builder instance
- See Also:
-
featureTypeName
Specifies the name of the feature type as a qualified name.- Parameters:
aFeatureTypeName
- the name of the feature type- Returns:
- this builder instance
- See Also:
-
modelDecoder
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.
- Parameters:
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 decoder- Returns:
- This builder
- Since:
- 2017.0
-
modelDecoder
Specifies the WFS model decoder that will be used to decode the response from the WFS server- Parameters:
aModelDecoder
- The model decoder- Returns:
- this builder instance
-
modelReferenceParser
public 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:
- Parsing the
defaultSRS
of the feature type of the proxy model. - Decoding
srsNames
that occur in results of 'GetFeature' requests in case no custom model decoder is used.
- Parameters:
aModelReferenceParser
- The model reference parser- Returns:
- this builder instance
- Parsing the
-
requestProperty
Sets the general request property. If a property with the key already exists, overwrite its value with the new value. Ifnull
is specified as value, the property is removed.- Parameters:
aKey
- the keyword by which the request is known (for example"accept"
)aValue
- the value associated with it- Returns:
- this builder instance
- See Also:
-
build
Returns a new
TLcdWFSProxyModel
for the specified settings, which is optimized for being visualized on the map. You need to call one of theserver
methods and one of thefeatureTypeName
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.
- Returns:
- a new
TLcdWFSProxyModel
instance. - Throws:
IOException
- if the proxy model cannot be created
-