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 intGet the class of the value.final voidsetDefault(String value) A default value for this attribute.final voidsetMaxLength(int maxLength) The maximum number of characters allowed for this field (default: unlimited).final voidvalidateValue(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:
setDefaultin 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:PrimitiveAttributeValidation of the value from a request.- Overrides:
validateValuein classPrimitiveAttribute<String>- Parameters:
value- The value from a request.
-
getValueType
Description copied from interface:AttributeGet the class of the value.- Returns:
- the value class
-