|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Datatype encapsulates the functionality for working with specific kinds of data like integers, decimals or dates.
It provides:
Each datatype can be marked as an "arraytype". Currently, this only has an
influence on the validate(Object, ExpressionContext)
method, which should in that case be passed
an array of objects. See also isArrayType()
.
Method Summary | |
ConversionResult |
convertFromString(String value,
Locale locale)
Converts a string to an object of this datatype. |
String |
convertToString(Object value,
Locale locale)
Converts an object of this datatype to a string representation. |
void |
generateSaxFragment(ContentHandler contentHandler,
Locale locale)
Generates a bit of information about this datatype. |
DatatypeBuilder |
getBuilder()
Returns the factory that built this datatype. |
Convertor |
getConvertor()
Returns the convertor used by this datatype. |
String |
getDescriptiveName()
Returns a descriptive name for the base type of this datatype, i.e. |
Convertor |
getPlainConvertor()
Returns the "plain convertor". |
Class |
getTypeClass()
Gets the class object for the type represented by this datatype. |
boolean |
isArrayType()
Indicates wether this datatype represents an array type. |
ValidationError |
validate(Object value,
org.outerj.expression.ExpressionContext expressionContext)
Returns null if validation is successful, otherwise returns a ValidationError instance. |
Method Detail |
public ConversionResult convertFromString(String value, Locale locale)
Convertor
as returned by the getConvertor()
method.
public String convertToString(Object value, Locale locale)
Convertor
as returned by the
getConvertor()
method.
public ValidationError validate(Object value, org.outerj.expression.ExpressionContext expressionContext)
ValidationError
instance.
value
- an Object of the correct type for this datatype (see
getTypeClass()
, or if isArrayType()
returns true, an array of objects of that type.public Class getTypeClass()
public String getDescriptiveName()
public boolean isArrayType()
public Convertor getConvertor()
public Convertor getPlainConvertor()
public DatatypeBuilder getBuilder()
public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException
SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |