public interface Type extends Serializable, ValueConverter
There are two groups of content types:
.+@.+
There is a root type called ANY
type.
Apart this special type, each type has a super type (a type from which it is
derived)
On top of this typing system there are two high level content types:
:
character. This character may
be used internally to prefix the type name so it must not be used in the type
name.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 |
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.
|
boolean |
validate(Object object)
Tests whether the given object is of this type.
|
convert
static final AnyType ANY
String getName()
String getSchemaName()
Schema getSchema()
TypeHelper getHelper()
The type helper is used to handle operations on value of that type.
TypeRef<? extends Type> getRef()
Type getSuperType()
Type[] getTypeHierarchy()
The array is ordered as follows:
The returned array is never null. An empty array is returned in the case
of ANY
type.
boolean isSuperTypeOf(Type type)
type
- the type to testboolean isSimpleType()
boolean isComplexType()
boolean isListType()
boolean isAnyType()
boolean isCompositeType()
boolean isNotNull()
boolean isReadOnly()
boolean validate(Object object) throws TypeException
object
- the object to testTypeException
- if an error occurs trying to retrieve the
supertypesObject decode(String string)
Returns null if the string can not be decoded.
string
- the string to decodeString encode(Object object)
Null is returned if the object cannot be converted.
object
- the object to convertObject newInstance()
Copyright © 2011 Nuxeo SA. All Rights Reserved.