Package org.mapfish.print.attribute
Class StringAttribute
- java.lang.Object
-
- org.mapfish.print.attribute.PrimitiveAttribute<java.lang.String>
-
- org.mapfish.print.attribute.StringAttribute
-
- All Implemented Interfaces:
Attribute
,ConfigurationObject
public class StringAttribute extends PrimitiveAttribute<java.lang.String>
Attribute that reads a string from the request data. [[examples=verboseExample]]
-
-
Field Summary
-
Fields inherited from class org.mapfish.print.attribute.PrimitiveAttribute
defaultValue
-
-
Constructor Summary
Constructors Constructor Description StringAttribute()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaxLength()
java.lang.Class
getValueType()
Get the class of the value.void
setDefault(java.lang.String value)
A default value for this attribute.void
setMaxLength(int maxLength)
The maximum number of characters allowed for this field (default: unlimited).void
validateValue(java.lang.Object value)
Validation of the value from a request.-
Methods inherited from class org.mapfish.print.attribute.PrimitiveAttribute
clientConfigTypeDescription, getDefault, getValue, getValueClass, printClientConfig, setConfigName, validate
-
-
-
-
Method Detail
-
setDefault
public final void setDefault(java.lang.String value)
A default value for this attribute. Example:attributes: title: !string default: The title
- Specified by:
setDefault
in classPrimitiveAttribute<java.lang.String>
- Parameters:
value
- The default value.
-
getMaxLength
public final int getMaxLength()
-
setMaxLength
public final void setMaxLength(int maxLength)
The maximum number of characters allowed for this field (default: unlimited).- Parameters:
maxLength
- Maximum number of characters.
-
validateValue
public final void validateValue(java.lang.Object value)
Description copied from class:PrimitiveAttribute
Validation of the value from a request.- Overrides:
validateValue
in classPrimitiveAttribute<java.lang.String>
- Parameters:
value
- The value from a request.
-
getValueType
public java.lang.Class getValueType()
Description copied from interface:Attribute
Get the class of the value.- Returns:
- the value class
-
-