Class ScalebarAttribute

All Implemented Interfaces:
Attribute, ConfigurationObject

public class ScalebarAttribute extends ReflectiveAttribute<ScalebarAttribute.ScalebarAttributeValues>
The attributes for CreateScalebarProcessor (see !createScalebar processor). [[examples=verboseExample,print_osm_new_york_EPSG_3857,print_osm_new_york_nosubreports]]
  • Constructor Details

    • ScalebarAttribute

      public ScalebarAttribute()
  • Method Details

    • validate

      public final void validate(List<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.

      If there is a public "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 class ReflectiveAttribute<ScalebarAttribute.ScalebarAttributeValues>
      Parameters:
      template - the template that this attribute is part of.
    • getValueType

      public final Class<? extends ScalebarAttribute.ScalebarAttributeValues> getValueType()
      Description copied from class: ReflectiveAttribute
      Return the type created by ReflectiveAttribute.createValue(Template).
      Specified by:
      getValueType in interface Attribute
      Specified by:
      getValueType in class ReflectiveAttribute<ScalebarAttribute.ScalebarAttributeValues>
      Returns:
      the value class
    • getWidth

      public final Integer getWidth()
    • setWidth

      public final void setWidth(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 Integer getHeight()
    • setHeight

      public final void setHeight(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 Boolean getCreateSubReport()
    • setCreateSubReport

      public final void setCreateSubReport(Boolean createSubReport)
      Specifies whether a subreport should be created, or only a graphic.
      Parameters:
      createSubReport - Create a sub-report?