|
Nuxeo Enterprise Platform 5.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuxeo.ecm.core.schema.types.AbstractType
public abstract class AbstractType
| Field Summary | |
|---|---|
protected ValueConverter |
converter
|
static Type[] |
EMPTY_SUPERTYPES
|
static int |
F_NOTNULL
|
static int |
F_READONLY
|
protected int |
flags
|
protected TypeHelper |
helper
|
protected String |
name
|
protected String |
schema
|
protected TypeRef<?> |
superType
|
| Fields inherited from interface org.nuxeo.ecm.core.schema.types.Type |
|---|
ANY |
| Constructor Summary | |
|---|---|
protected |
AbstractType(TypeRef<? extends Type> superType,
String schema,
String name)
|
| Method Summary | |
|---|---|
protected void |
clearFlags(int flags)
|
Object |
convert(Object object)
Converts the given value to an object compatible with the associated type. |
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. |
ValueConverter |
getConverter()
Gets the value converter used on this type. |
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. |
protected boolean |
isFlagSet(int flags)
|
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 |
setConverter(ValueConverter converter)
Sets the value converter to be used by this type. |
protected void |
setFlags(int flags)
|
void |
setNotNull(boolean val)
|
void |
setReadOnly(boolean val)
|
boolean |
validate(Object object)
Tests whether the given object is of this type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Type[] EMPTY_SUPERTYPES
public static final int F_READONLY
public static final int F_NOTNULL
protected final String name
protected final TypeRef<?> superType
protected final String schema
protected int flags
protected ValueConverter converter
protected TypeHelper helper
| Constructor Detail |
|---|
protected AbstractType(TypeRef<? extends Type> superType,
String schema,
String name)
| Method Detail |
|---|
public TypeRef<? extends Type> getRef()
Type
getRef in interface Typepublic TypeHelper getHelper()
TypeThe type helper is used to handle operations on value of that type
getHelper in interface Typepublic Type getSuperType()
Type
getSuperType in interface Typepublic String getName()
Type
getName in interface Typepublic String getSchemaName()
Type
getSchemaName in interface Typepublic Schema getSchema()
Type
getSchema in interface Typepublic boolean isSuperTypeOf(Type type)
Type
isSuperTypeOf in interface Typetype - the type to test
public 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()
Type
isSimpleType in interface Typepublic boolean isComplexType()
Type
isComplexType in interface Typepublic boolean isListType()
Type
isListType in interface Typepublic boolean isAnyType()
Type
isAnyType in interface Typepublic boolean isCompositeType()
Type
isCompositeType in interface Typepublic boolean isNotNull()
Type
isNotNull in interface Typepublic boolean isReadOnly()
Type
isReadOnly in interface Type
public boolean validate(Object object)
throws TypeException
Type
validate in interface Typeobject - the object to test
TypeException - if an error occurs trying to retrieve the
supertypespublic void setNotNull(boolean val)
public void setReadOnly(boolean val)
protected final void setFlags(int flags)
protected final void clearFlags(int flags)
protected final boolean isFlagSet(int flags)
public Object decode(String string)
TypeReturns null if the string can not be decoded.
decode in interface Typestring - the string to decode
public String encode(Object object)
TypeNull is returned if the object cannot be converted.
encode in interface Typeobject - the object to convert
public Object newInstance()
Type
newInstance in interface Type
public Object convert(Object object)
throws TypeException
ValueConverter
convert in interface ValueConverterobject - the value to convert
TypeException - if the value to convert is not compatible with the associated typepublic void setConverter(ValueConverter converter)
Type
setConverter in interface Typeconverter - the value converterpublic ValueConverter getConverter()
Type
getConverter in interface Type
|
Nuxeo Enterprise Platform 5.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||