Class StaticLayersAttribute
- All Implemented Interfaces:
Attribute
,ConfigurationObject
AddStaticLayersProcessor
(see !addBackgroundLayers and !addOverlayLayers processor) which adds the layers
in this attribute to the layers in the map. The typical use is to add the background or overlay
layers as the "default" in the config.yaml file if the client desires it can override those
values. [[examples=add_overlay_layer,report]]-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The object used to parse the input parameters for this attribute object. -
Field Summary
Fields inherited from class org.mapfish.print.attribute.ReflectiveAttribute
JSON_ATTRIBUTE_DEFAULT, JSON_ATTRIBUTE_EMBEDDED_TYPE, JSON_ATTRIBUTE_IS_ARRAY, JSON_ATTRIBUTE_TYPE, JSON_CLIENT_INFO, JSON_CLIENT_PARAMS, JSON_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateValue
(Template template) Create an instance of a attribute value object.Return the type created byReflectiveAttribute.createValue(Template)
.void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.Methods inherited from class org.mapfish.print.attribute.ReflectiveAttribute
getAttributeName, getClientInfo, getDefaultValue, getValue, printClientConfig, setConfigName, setDefault
-
Constructor Details
-
StaticLayersAttribute
public StaticLayersAttribute()
-
-
Method Details
-
getValueType
Description copied from class:ReflectiveAttribute
Return the type created byReflectiveAttribute.createValue(Template)
.- Specified by:
getValueType
in interfaceAttribute
- Specified by:
getValueType
in classReflectiveAttribute<StaticLayersAttribute.StaticLayersAttributeValue>
- Returns:
- the value class
-
createValue
Description copied from class:ReflectiveAttribute
Create an instance of a attribute value 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.
If a field in the object has the
HasDefaultValue
annotation then no exception will be thrown if the json does not contain a value.Fields in the object with the
OneOf
annotation must have one of the fields in the request data.String
Integer
Float
Double
Short
Boolean
Character
Byte
Enum
- PJsonObject
- URL
- Any enum
- PJsonArray
- any type with a 0 argument constructor
- array of any of the above (String[], boolean[], PJsonObject[], ...)
"postConstruct"()
method then it will be called after the fields are all set.In the case where the a parameter type is a normal POJO (not a special case like PJsonObject, URL, enum, double, etc...) then it will be assumed that the json data is a json object and the parameters will be recursively parsed into the new object as if it is also MapLayer parameter object.
It is important to put values in the value object as public fields because reflection is used when printing client config as well as generating documentation. If a field is intended for the client software as information but is not intended to be set (or sent as part of the request data), the field can be a final field.
- Specified by:
createValue
in classReflectiveAttribute<StaticLayersAttribute.StaticLayersAttributeValue>
- Parameters:
template
- the template that this attribute is part of.
-
validate
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Parameters:
validationErrors
- a list to add any detected errors to.configuration
- the containing configuration
-