| org.apache.cocoon.woody.datatype.Datatype
All known Subclasses: org.apache.cocoon.woody.datatype.typeimpl.AbstractDatatype,
Datatype | public interface Datatype (Code) | | A Datatype encapsulates the functionality for working with specific
kinds of data like integers, deciamals or dates.
I provides:
- Methods for converting between String and Object representation of the data
- For validating the data (usually against a set of validation rules)
- optionally a selection list
Each datatype can be marked as an "arraytype". Currently, this only has an
influence on the
Datatype.validate(Object,ExpressionContext) method, which should in that case be passed
an array of objects. See also
Datatype.isArrayType() .
version: $Id: Datatype.java 433543 2006-08-22 06:22:54Z crossley $ |
getConvertor | Convertor getConvertor()(Code) | | Returns the convertor used by this datatype.
|
getDescriptiveName | String getDescriptiveName()(Code) | | Returns a descriptive name for the base type of this datatype,
i.e. something like 'string', 'long', 'decimal', ...
|
getPlainConvertor | Convertor getPlainConvertor()(Code) | | Returns the "plain convertor". This is convertor that should have a locale-independent
string encoding, and guarantees perfect roundtripping. It is used if a value of this
datatype needs to be stored but not displayed to the user.
|
getTypeClass | Class getTypeClass()(Code) | | Gets the class object for the type represented by this datatype. E.g. Long, String, ...
The objects returned from the convertFromString* methods are of this type, and the object
passed to the convertToString* or validate methods should be of this type.
|
isArrayType | boolean isArrayType()(Code) | | Indicates wether this datatype represents an array type. This approach has been
chosen instead of creating a seperate ArrayDatatype interface (and corresponding
implementations), since almost all functionality is the same between the scalar
and array types. The main difference is that the validate() method will be passed
arrays instead of single values, and hence different validation rules will be
required.
|
|
|