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, setReadOnly
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHelper, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isNotNull, isReadOnly, isSuperTypeOf
public SimpleTypeImpl(SimpleType superType, String schema, String name)
public SimpleTypeImpl(TypeRef<? extends SimpleType> superType, String schema, String name)
public boolean validate(Object object) throws TypeException
Type
validate
in interface Type
validate
in class AbstractType
object
- 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 SimpleType
public boolean isPrimitive()
SimpleType
isPrimitive
in interface SimpleType
public boolean isSimpleType()
Type
isSimpleType
in interface Type
isSimpleType
in class AbstractType
public Object decode(String str)
Type
Returns null if the string can not be decoded.
decode
in interface Type
decode
in class AbstractType
str
- the string to decodepublic String encode(Object value)
Type
Null is returned if the object cannot be converted.
encode
in interface Type
encode
in class AbstractType
value
- the object to convertpublic Object convert(Object value) throws TypeException
ValueConverter
convert
in interface ValueConverter
value
- the value to convertTypeException
- if the value to convert is not compatible with the associated typepublic Object newInstance()
Type
newInstance
in interface Type
newInstance
in class AbstractType
public TypeRef<? extends SimpleType> getRef()
Type
getRef
in interface SimpleType
getRef
in interface Type
getRef
in class AbstractType
Copyright © 2011 Nuxeo SA. All Rights Reserved.