public abstract class AbstractType extends Object implements Type
| Modifier and Type | Field and Description |
|---|---|
static Type[] |
EMPTY_SUPERTYPES |
static int |
F_NOTNULL |
static int |
F_READONLY |
| Modifier and Type | Method and Description |
|---|---|
Object |
decode(String string)
Decodes the string representation into an object of this type.
|
String |
encode(Object object)
Encodes the given object that is assumed to be of this type into a string
representation.
|
TypeHelper |
getHelper()
Get the type helper.
|
String |
getName()
Gets the name of this type.
|
TypeRef<? extends Type> |
getRef()
Gets a proxy (or reference to this type).
|
Schema |
getSchema()
Gets the schema defining this type.
|
String |
getSchemaName()
Gets the local name of this type.
|
Type |
getSuperType()
Gets the super type.
|
Type[] |
getTypeHierarchy()
Gets the entire hierarchy of super-types.
|
boolean |
isAny() |
boolean |
isAnyType()
Tests whether this type is the ANY type.
|
boolean |
isComplexType()
Tests whether this type is a complex type.
|
boolean |
isCompositeType()
Tests whether this is a composite type.
|
boolean |
isListType()
Tests whether this type is a list type.
|
boolean |
isNotNull()
Tests whether this type supports null values.
|
boolean |
isReadOnly()
Tests whether this type is read-only.
|
boolean |
isSimpleType()
Tests whether this type is a simple type.
|
boolean |
isSuperTypeOf(Type type)
Tests whether the given type is derived from this type.
|
Object |
newInstance()
Creates a new instance according to this type and filled with default
values.
|
void |
setNotNull(boolean val) |
void |
setReadOnly(boolean val) |
boolean |
validate(Object object)
Tests whether the given object is of this type.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertpublic static final Type[] EMPTY_SUPERTYPES
public static final int F_READONLY
public static final int F_NOTNULL
public TypeRef<? extends Type> getRef()
Typepublic TypeHelper getHelper()
TypeThe type helper is used to handle operations on value of that type.
public Type getSuperType()
TypegetSuperType in interface Typepublic String getSchemaName()
TypegetSchemaName in interface Typepublic Schema getSchema()
Typepublic boolean isSuperTypeOf(Type type)
TypeisSuperTypeOf in interface Typetype - the type to testpublic boolean isAny()
public Type[] getTypeHierarchy()
TypeThe array is ordered as follows:
The returned array is never null. An empty array is returned in the case
of ANY type.
getTypeHierarchy in interface Typepublic boolean isSimpleType()
TypeisSimpleType in interface Typepublic boolean isComplexType()
TypeisComplexType in interface Typepublic boolean isListType()
TypeisListType in interface Typepublic boolean isAnyType()
Typepublic boolean isCompositeType()
TypeisCompositeType in interface Typepublic boolean isNotNull()
Typepublic boolean isReadOnly()
TypeisReadOnly in interface Typepublic boolean validate(Object object) throws TypeException
Typevalidate in interface Typeobject - the object to testTypeException - if an error occurs trying to retrieve the
supertypespublic void setNotNull(boolean val)
public void setReadOnly(boolean val)
public Object decode(String string)
TypeReturns null if the string can not be decoded.
public String encode(Object object)
TypeNull is returned if the object cannot be converted.
public Object newInstance()
TypenewInstance in interface TypeCopyright © 2011 Nuxeo SA. All Rights Reserved.