|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.forms.datatype.typeimpl.AbstractDatatype
public abstract class AbstractDatatype
Abstract base class for Datatype implementations. Most concreate datatypes will derive from this class.
Constructor Summary | |
---|---|
AbstractDatatype()
|
Method Summary | |
---|---|
void |
addValidationRule(ValidationRule validationRule)
|
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. |
Convertor |
getPlainConvertor()
Returns the "plain convertor". |
boolean |
isArrayType()
Indicates wether this datatype represents an array type. |
protected void |
setArrayType(boolean arrayType)
|
protected void |
setBuilder(DatatypeBuilder builder)
|
void |
setConvertor(Convertor convertor)
|
ValidationError |
validate(Object value,
org.outerj.expression.ExpressionContext expressionContext)
Returns null if validation is successful, otherwise returns a ValidationError instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.forms.datatype.Datatype |
---|
getDescriptiveName, getTypeClass |
Constructor Detail |
---|
public AbstractDatatype()
Method Detail |
---|
public ValidationError validate(Object value, org.outerj.expression.ExpressionContext expressionContext)
Datatype
ValidationError
instance.
validate
in interface Datatype
value
- an Object of the correct type for this datatype (see
Datatype.getTypeClass()
, or if Datatype.isArrayType()
returns true, an array of objects of that type.public void addValidationRule(ValidationRule validationRule)
public boolean isArrayType()
Datatype
isArrayType
in interface Datatype
protected void setArrayType(boolean arrayType)
public void setConvertor(Convertor convertor)
protected void setBuilder(DatatypeBuilder builder)
public Convertor getPlainConvertor()
Datatype
getPlainConvertor
in interface Datatype
public DatatypeBuilder getBuilder()
Datatype
getBuilder
in interface Datatype
public Convertor getConvertor()
Datatype
getConvertor
in interface Datatype
public ConversionResult convertFromString(String value, Locale locale)
Datatype
Convertor
as returned by the Datatype.getConvertor()
method.
convertFromString
in interface Datatype
public String convertToString(Object value, Locale locale)
Datatype
Convertor
as returned by the
Datatype.getConvertor()
method.
convertToString
in interface Datatype
public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException
Datatype
generateSaxFragment
in interface Datatype
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |