Package org.mapfish.print.attribute
Class StringAttribute
- All Implemented Interfaces:
Attribute
,ConfigurationObject
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Get the class of the value.final void
setDefault
(String value) A default value for this attribute.final void
setMaxLength
(int maxLength) The maximum number of characters allowed for this field (default: unlimited).final void
validateValue
(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
-
Constructor Details
-
StringAttribute
public StringAttribute()Constructor.
-
-
Method Details
-
setDefault
A default value for this attribute. Example:attributes: title: !string default: The title
- Specified by:
setDefault
in classPrimitiveAttribute<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
Description copied from class:PrimitiveAttribute
Validation of the value from a request.- Overrides:
validateValue
in classPrimitiveAttribute<String>
- Parameters:
value
- The value from a request.
-
getValueType
Description copied from interface:Attribute
Get the class of the value.- Returns:
- the value class
-