Value - The value type of the attributepublic abstract class PrimitiveAttribute<Value> extends java.lang.Object implements Attribute
Stringjava.lang.String[]IntegerDoubleBoolean| Modifier and Type | Field and Description |
|---|---|
protected Value |
defaultValue
The default value.
|
| Constructor and Description |
|---|
PrimitiveAttribute(java.lang.Class<Value> valueClass)
Constructor.
|
| Modifier and Type | Method and 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetValueTypeprotected Value defaultValue
public PrimitiveAttribute(java.lang.Class<Value> valueClass)
valueClass - the type of the value of this attributepublic final java.lang.Class<Value> getValueClass()
public final Value getDefault()
public abstract void setDefault(Value value)
A default value for this attribute.
value - The default value.public final void setConfigName(java.lang.String configName)
AttributesetConfigName in interface AttributeconfigName - the name of the attributepublic void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationpublic void validateValue(java.lang.Object value)
value - The value from a request.public final void printClientConfig(org.json.JSONWriter json,
Template template)
throws org.json.JSONException
AttributeprintClientConfig in interface Attributejson - the json writer to write totemplate - the template that this attribute is part oforg.json.JSONExceptionprotected java.lang.String clientConfigTypeDescription()