public class SimpleTypeImpl extends AbstractType implements SimpleType
EMPTY_SUPERTYPES, F_NOTNULL, F_READONLY| Constructor and Description |
|---|
SimpleTypeImpl(SimpleType superType,
String schema,
String name) |
SimpleTypeImpl(TypeRef<? extends SimpleType> superType,
String schema,
String name) |
| Modifier and Type | Method and Description |
|---|---|
Object |
convert(Object value)
Converts the given value to an object compatible with the associated type.
|
Object |
decode(String str)
Decodes the string representation into an object of this type.
|
String |
encode(Object value)
Encodes the given object that is assumed to be of this type into a string
representation.
|
Constraint[] |
getConstraints() |
SimpleType |
getPrimitiveType() |
TypeRef<? extends SimpleType> |
getRef()
Gets a proxy (or reference to this type).
|
boolean |
isPrimitive()
Tests whether this type is a primitive type.
|
boolean |
isSimpleType()
Tests whether this type is a simple type.
|
Object |
newInstance()
Creates a new instance according to this type and filled with default
values.
|
void |
setConstraints(Constraint[] constraints) |
boolean |
validate(Object object)
Tests whether the given object is of this type.
|
getHelper, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAny, isAnyType, isComplexType, isCompositeType, isListType, isNotNull, isReadOnly, isSuperTypeOf, setNotNull, setReadOnlyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHelper, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isNotNull, isReadOnly, isSuperTypeOfpublic SimpleTypeImpl(SimpleType superType, String schema, String name)
public SimpleTypeImpl(TypeRef<? extends SimpleType> superType, String schema, String name)
public boolean validate(Object object) throws TypeException
Typevalidate in interface Typevalidate in class AbstractTypeobject - the object to testTypeException - if an error occurs trying to retrieve the
supertypespublic void setConstraints(Constraint[] constraints)
public Constraint[] getConstraints()
public SimpleType getPrimitiveType()
getPrimitiveType in interface SimpleTypepublic boolean isPrimitive()
SimpleTypeisPrimitive in interface SimpleTypepublic boolean isSimpleType()
TypeisSimpleType in interface TypeisSimpleType in class AbstractTypepublic Object decode(String str)
TypeReturns null if the string can not be decoded.
decode in interface Typedecode in class AbstractTypestr - the string to decodepublic String encode(Object value)
TypeNull is returned if the object cannot be converted.
encode in interface Typeencode in class AbstractTypevalue - the object to convertpublic Object convert(Object value) throws TypeException
ValueConverterconvert in interface ValueConvertervalue - the value to convertTypeException - if the value to convert is not compatible with the associated typepublic Object newInstance()
TypenewInstance in interface TypenewInstance in class AbstractTypepublic TypeRef<? extends SimpleType> getRef()
TypegetRef in interface SimpleTypegetRef in interface TypegetRef in class AbstractTypeCopyright © 2011 Nuxeo SA. All Rights Reserved.