Class ScalebarAttribute
- java.lang.Object
-
- org.mapfish.print.attribute.ReflectiveAttribute<ScalebarAttribute.ScalebarAttributeValues>
-
- org.mapfish.print.attribute.ScalebarAttribute
-
- All Implemented Interfaces:
Attribute
,ConfigurationObject
public class ScalebarAttribute extends ReflectiveAttribute<ScalebarAttribute.ScalebarAttributeValues>
The attributes forCreateScalebarProcessor
(see !createScalebar processor). [[examples=verboseExample,print_osm_new_york_EPSG_3857,print_osm_new_york_nosubreports]]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ScalebarAttribute.ScalebarAttributeValues
The value ofScalebarAttribute
.
-
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 Constructor Description ScalebarAttribute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScalebarAttribute.ScalebarAttributeValues
createValue(Template template)
Create an instance of a attribute value object.java.lang.Boolean
getCreateSubReport()
java.lang.Integer
getHeight()
java.lang.Class<? extends ScalebarAttribute.ScalebarAttributeValues>
getValueType()
Return the type created byReflectiveAttribute.createValue(Template)
.java.lang.Integer
getWidth()
void
setCreateSubReport(java.lang.Boolean createSubReport)
Specifies whether a subreport should be created, or only a graphic.void
setHeight(java.lang.Integer height)
The height of the scalebar in pixels.void
setWidth(java.lang.Integer width)
The width of the scalebar in pixels.void
validate(java.util.List<java.lang.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
-
-
-
-
Method Detail
-
validate
public final void validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
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
-
createValue
public final ScalebarAttribute.ScalebarAttributeValues 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<ScalebarAttribute.ScalebarAttributeValues>
- Parameters:
template
- the template that this attribute is part of.
-
getValueType
public final java.lang.Class<? extends ScalebarAttribute.ScalebarAttributeValues> getValueType()
Description copied from class:ReflectiveAttribute
Return the type created byReflectiveAttribute.createValue(Template)
.- Specified by:
getValueType
in interfaceAttribute
- Specified by:
getValueType
in classReflectiveAttribute<ScalebarAttribute.ScalebarAttributeValues>
- Returns:
- the value class
-
getWidth
public final java.lang.Integer getWidth()
-
setWidth
public final void setWidth(java.lang.Integer width)
The width of the scalebar in pixels. This value should match the width of the sub-report in the JasperReport template.- Parameters:
width
- Width
-
getHeight
public final java.lang.Integer getHeight()
-
setHeight
public final void setHeight(java.lang.Integer height)
The height of the scalebar in pixels. This value should match the height of the sub-report in the JasperReport template.- Parameters:
height
- Height
-
getCreateSubReport
public final java.lang.Boolean getCreateSubReport()
-
setCreateSubReport
public final void setCreateSubReport(java.lang.Boolean createSubReport)
Specifies whether a subreport should be created, or only a graphic.- Parameters:
createSubReport
- Create a sub-report?
-
-