Package org.mapfish.print.map.geotools
Class FeatureLayer.Plugin
- java.lang.Object
-
- org.mapfish.print.map.geotools.AbstractFeatureSourceLayerPlugin<FeatureLayer.FeatureLayerParam>
-
- org.mapfish.print.map.geotools.FeatureLayer.Plugin
-
- All Implemented Interfaces:
MapLayerFactoryPlugin<FeatureLayer.FeatureLayerParam>
- Enclosing class:
- FeatureLayer
public static final class FeatureLayer.Plugin extends AbstractFeatureSourceLayerPlugin<FeatureLayer.FeatureLayerParam>
Parser for creatingFeatureLayer
layers from request data.
-
-
Field Summary
-
Fields inherited from class org.mapfish.print.map.geotools.AbstractFeatureSourceLayerPlugin
forkJoinPool, parser
-
-
Constructor Summary
Constructors Constructor Description Plugin()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeatureLayer.FeatureLayerParam
createParameter()
Create an instance of a param object.protected StyleSupplier<org.geotools.api.data.FeatureSource>
createStyleFunction(Template template, java.lang.String styleString, java.lang.String defaultStyleName)
Create a function that will create the style on demand.FeatureLayer
parse(Template template, FeatureLayer.FeatureLayerParam param)
Inspect the json data and return Optional<MapLayer> or Optional.absent().-
Methods inherited from class org.mapfish.print.map.geotools.AbstractFeatureSourceLayerPlugin
createStyleFunction, getTypeNames, setParser
-
-
-
-
Method Detail
-
createParameter
public FeatureLayer.FeatureLayerParam createParameter()
Description copied from interface:MapLayerFactoryPlugin
Create an instance of a param object. Each instance must be new and unique. Instances must NOT be shared.The object will be populated from the json. Each public field will be populated by looking up the value in the json.
The same mechanism used for reading from the JSON into the param object is also used for parsing the JSON into
Attribute
value objects. SeeReflectiveAttribute.createValue(org.mapfish.print.config.Template)
()} for details on how the parsing mechanism works.
-
parse
@Nonnull public FeatureLayer parse(@Nonnull Template template, @Nonnull FeatureLayer.FeatureLayerParam param)
Description copied from interface:MapLayerFactoryPlugin
Inspect the json data and return Optional<MapLayer> or Optional.absent().- Parameters:
template
- the configuration related to the current request.param
- an object populated from the json for the layer
-
createStyleFunction
protected StyleSupplier<org.geotools.api.data.FeatureSource> createStyleFunction(Template template, java.lang.String styleString, java.lang.String defaultStyleName)
Create a function that will create the style on demand. This is called later in a separate thread so any blocking calls will not block the parsing of the layer attributes.- Parameters:
template
- the template for this mapstyleString
- a string that identifies a style.defaultStyleName
- a custom name for the default style. If null, the default style is selected depending on the geometry type.
-
-