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
public abstract class PrimitiveAttribute<VALUE> extends java.lang.Object implements Attribute
A type of attribute whose value is a primitive type.String
String
[]Integer
Double
Boolean
-
-
Field Summary
Fields Modifier and Type Field Description protected VALUE
defaultValue
The default value.
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrimitiveAttribute(java.lang.Class<VALUE> valueClass)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
clientConfigTypeDescription()
Returns a string that is a technical description of the type.VALUE
getDefault()
java.lang.Object
getValue(Template template, java.lang.String attributeName, PObject requestJsonAttributes)
Get the attribute value.java.lang.Class<VALUE>
getValueClass()
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.void
setConfigName(java.lang.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(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
validate that the configuration was correct.void
validateValue(java.lang.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 Detail
-
defaultValue
protected VALUE defaultValue
The default value.
-
-
Constructor Detail
-
PrimitiveAttribute
protected PrimitiveAttribute(java.lang.Class<VALUE> valueClass)
Constructor.- Parameters:
valueClass
- the type of the value of this attribute
-
-
Method Detail
-
getValueClass
public final java.lang.Class<VALUE> getValueClass()
-
getDefault
public final VALUE getDefault()
-
setDefault
public abstract void setDefault(VALUE value)
A default value for this attribute.- Parameters:
value
- The default value.
-
setConfigName
public final void setConfigName(java.lang.String configName)
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
public void validate(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
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
public void validateValue(java.lang.Object value)
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
protected java.lang.String 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.
-
-