Package org.mapfish.print.attribute
Class PrimitiveAttribute<VALUE>
java.lang.Object
org.mapfish.print.attribute.PrimitiveAttribute<VALUE>
- Type Parameters:
VALUE
- The value type of the attribute
- All Implemented Interfaces:
Attribute
,ConfigurationObject
- Direct Known Subclasses:
BooleanAttribute
,FloatAttribute
,IntegerAttribute
,StringArrayAttribute
,StringAttribute
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns a string that is a technical description of the type.final VALUE
Get the attribute value.final void
printClientConfig
(org.json.JSONWriter json, Template template) Write this attribute out the the json writer so that clients can know what attributes are expected.final void
setConfigName
(String configName) Set the name of the attribute as set in the configuration file.abstract void
setDefault
(VALUE value) A default value for this attribute.void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.void
validateValue
(Object value) Validation of the value from a request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.mapfish.print.attribute.Attribute
getValueType
-
Field Details
-
defaultValue
The default value.
-
-
Constructor Details
-
PrimitiveAttribute
Constructor.- Parameters:
valueClass
- the type of the value of this attribute
-
-
Method Details
-
getValueClass
-
getDefault
-
setDefault
A default value for this attribute.- Parameters:
value
- The default value.
-
setConfigName
Description copied from interface:Attribute
Set the name of the attribute as set in the configuration file.- Specified by:
setConfigName
in interfaceAttribute
- Parameters:
configName
- the name of the attribute
-
validate
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Specified by:
validate
in interfaceConfigurationObject
- Parameters:
validationErrors
- a list to add any detected errors to.configuration
- the containing configuration
-
validateValue
Validation of the value from a request.- Parameters:
value
- The value from a request.
-
printClientConfig
public final void printClientConfig(org.json.JSONWriter json, Template template) throws org.json.JSONException Description copied from interface:Attribute
Write this attribute out the the json writer so that clients can know what attributes are expected.- Specified by:
printClientConfig
in interfaceAttribute
- Parameters:
json
- the json writer to write totemplate
- the template that this attribute is part of- Throws:
org.json.JSONException
-
clientConfigTypeDescription
Returns a string that is a technical description of the type. In other words, a string that the client software (user of the capabilities response) can use to create a request or UI. -
getValue
public Object getValue(@Nonnull Template template, @Nonnull String attributeName, @Nonnull PObject requestJsonAttributes) Description copied from interface:Attribute
Get the attribute value.
-