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 StringReturns a string that is a technical description of the type.final VALUEGet the attribute value.final voidprintClientConfig(org.json.JSONWriter json, Template template) Write this attribute out the the json writer so that clients can know what attributes are expected.final voidsetConfigName(String configName) Set the name of the attribute as set in the configuration file.abstract voidsetDefault(VALUE value) A default value for this attribute.voidvalidate(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.voidvalidateValue(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, waitMethods 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:AttributeSet the name of the attribute as set in the configuration file.- Specified by:
setConfigNamein interfaceAttribute- Parameters:
configName- the name of the attribute
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Specified by:
validatein 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:AttributeWrite this attribute out the the json writer so that clients can know what attributes are expected.- Specified by:
printClientConfigin 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:AttributeGet the attribute value.
-