Class MapAttribute
- java.lang.Object
-
- org.mapfish.print.attribute.ReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
-
- org.mapfish.print.attribute.map.GenericMapAttribute
-
- org.mapfish.print.attribute.map.MapAttribute
-
- All Implemented Interfaces:
Attribute
,ConfigurationObject
public final class MapAttribute extends GenericMapAttribute
The attributes forCreateMapProcessor
(see !createMap processor). [[examples=verboseExample]]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MapAttribute.MapAttributeValues
The value ofMapAttribute
.class
MapAttribute.OverriddenMapAttributeValues
A wrapper around aMapAttribute.MapAttributeValues
instance and anOverviewMapAttribute.OverviewMapAttributeValues
instance, which is used to render the overview map.-
Nested classes/interfaces inherited from class org.mapfish.print.attribute.map.GenericMapAttribute
GenericMapAttribute.GenericMapAttributeValues
-
-
Field Summary
-
Fields inherited from class org.mapfish.print.attribute.map.GenericMapAttribute
JSON_DPI_SUGGESTIONS, JSON_MAP_HEIGHT, JSON_MAP_WIDTH, JSON_MAX_DPI, JSON_MAX_HEIGHT, JSON_MAX_WIDTH
-
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 Constructor Description MapAttribute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapAttribute.MapAttributeValues
createValue(Template template)
Create an instance of a attribute value object.java.lang.Class<MapAttribute.MapAttributeValues>
getValueType()
Return the type created byReflectiveAttribute.createValue(Template)
.-
Methods inherited from class org.mapfish.print.attribute.map.GenericMapAttribute
getClientInfo, getDpiSuggestions, getHeight, getMaxDpi, getMaxHeight, getMaxWidth, getWidth, parseProjection, setDpiSuggestions, setHeight, setMaxDpi, setMaxHeight, setMaxWidth, setWidth, setZoomLevels, setZoomLevelSnapStrategy, setZoomSnapGeodetic, setZoomSnapTolerance, validate
-
Methods inherited from class org.mapfish.print.attribute.ReflectiveAttribute
getAttributeName, getDefaultValue, getValue, printClientConfig, setConfigName, setDefault
-
-
-
-
Method Detail
-
getValueType
public java.lang.Class<MapAttribute.MapAttributeValues> getValueType()
Description copied from class:ReflectiveAttribute
Return the type created byReflectiveAttribute.createValue(Template)
.- Specified by:
getValueType
in interfaceAttribute
- Specified by:
getValueType
in classReflectiveAttribute<GenericMapAttribute.GenericMapAttributeValues>
- Returns:
- the value class
-
createValue
public MapAttribute.MapAttributeValues createValue(Template template)
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<GenericMapAttribute.GenericMapAttributeValues>
- Parameters:
template
- the template that this attribute is part of.
-
-