Class NorthArrowAttribute
- All Implemented Interfaces:
Attribute,ConfigurationObject
CreateNorthArrowProcessor (see !createNorthArrow processor).
[[examples=verboseExample,print_osm_new_york_nosubreports]]-
Nested Class Summary
Nested Classes -
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.final Booleanfinal IntegergetSize()final Class<? extends NorthArrowAttribute.NorthArrowAttributeValues> Return the type created byReflectiveAttribute.createValue(Template).final voidsetCreateSubReport(Boolean createSubReport) Specifies whether a subreport should be created, or only a graphic.final voidThe size (width and height) of the north-arrow graphic in the JasperReport template.final voidvalidate(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
-
NorthArrowAttribute
public NorthArrowAttribute()
-
-
Method Details
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Parameters:
validationErrors- a list to add any detected errors to.configuration- the containing configuration
-
createValue
Description copied from class:ReflectiveAttributeCreate 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
HasDefaultValueannotation then no exception will be thrown if the json does not contain a value.Fields in the object with the
OneOfannotation must have one of the fields in the request data.StringIntegerFloatDoubleShortBooleanCharacterByteEnum- 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:
createValuein classReflectiveAttribute<NorthArrowAttribute.NorthArrowAttributeValues>- Parameters:
template- the template that this attribute is part of.
-
getValueType
Description copied from class:ReflectiveAttributeReturn the type created byReflectiveAttribute.createValue(Template).- Specified by:
getValueTypein interfaceAttribute- Specified by:
getValueTypein classReflectiveAttribute<NorthArrowAttribute.NorthArrowAttributeValues>- Returns:
- the value class
-
getSize
-
setSize
The size (width and height) of the north-arrow graphic in the JasperReport template.The graphic is a square so that the arrow can be rotated properly.
- Parameters:
size- The size (width and height).
-
getCreateSubReport
-
setCreateSubReport
Specifies whether a subreport should be created, or only a graphic.- Parameters:
createSubReport- Create a sub-report?
-