Package org.nuxeo.ecm.core.schema.types
Class PrimitiveType
- java.lang.Object
-
- org.nuxeo.ecm.core.schema.types.AbstractType
-
- org.nuxeo.ecm.core.schema.types.PrimitiveType
-
- All Implemented Interfaces:
Serializable,SimpleType,Type
- Direct Known Subclasses:
BinaryType,BooleanType,DateType,DoubleType,IntegerType,LongType,StringType
public abstract class PrimitiveType extends AbstractType implements SimpleType
Primitive type (basic types like long, string, boolean, etc.).- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.core.schema.types.AbstractType
constraints, EMPTY_SUPERTYPES, name, schema, superType
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPrimitiveType(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Set<Constraint>getConstraints()ObjectResolvergetObjectResolver()Provides aObjectResolverif this type is a reference to an external entity.PrimitiveTypegetPrimitiveType()TypegetSuperType()Gets the super type.Type[]getTypeHierarchy()Gets the entire hierarchy of super-types.booleanisPrimitive()Tests whether this type is a primitive type.booleanisSimpleType()Tests whether this type is a simple type.abstract booleansupport(Class<? extends Constraint> constraint)abstract booleanvalidate(Object object)Tests whether the given object is of this type.-
Methods inherited from class org.nuxeo.ecm.core.schema.types.AbstractType
addConstraints, decode, encode, getName, getSchema, getSchemaName, isAny, isAnyType, isComplexType, isCompositeType, isListType, isSuperTypeOf, newInstance, validateConstraints
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.schema.types.Type
convert, decode, encode, getName, getSchema, getSchemaName, isAnyType, isComplexType, isCompositeType, isListType, isSuperTypeOf, newInstance
-
-
-
-
Constructor Detail
-
PrimitiveType
protected PrimitiveType(String name)
-
-
Method Detail
-
validate
public abstract boolean validate(Object object)
Description copied from interface:TypeTests whether the given object is of this type.- Specified by:
validatein interfaceType- Overrides:
validatein classAbstractType- Parameters:
object- the object to test- Returns:
- true if the given object if of this type, false otherwise
-
getObjectResolver
public ObjectResolver getObjectResolver()
Description copied from interface:TypeProvides aObjectResolverif this type is a reference to an external entity.- Specified by:
getObjectResolverin interfaceType- Overrides:
getObjectResolverin classAbstractType- Returns:
- a resolver if available, null otherwise.
-
getSuperType
public Type getSuperType()
Description copied from interface:TypeGets the super type.- Specified by:
getSuperTypein interfaceType- Overrides:
getSuperTypein classAbstractType- Returns:
- the super type or null if this is a primitive type
-
getTypeHierarchy
public Type[] getTypeHierarchy()
Description copied from interface:TypeGets the entire hierarchy of super-types.The array is ordered as follows:
- the direct super type is the first element,
- the super super type is the second element,
- and so on.
The returned array is never null. An empty array is returned in the case of
ANYtype.- Specified by:
getTypeHierarchyin interfaceType- Overrides:
getTypeHierarchyin classAbstractType- Returns:
- an array containing the supertypes of this type
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:SimpleTypeTests whether this type is a primitive type.- Specified by:
isPrimitivein interfaceSimpleType- Returns:
- true if this type is a primitive type, false otherwise
-
isSimpleType
public boolean isSimpleType()
Description copied from interface:TypeTests whether this type is a simple type.- Specified by:
isSimpleTypein interfaceType- Overrides:
isSimpleTypein classAbstractType- Returns:
- true if this type is a simple type, false otherwise
-
getPrimitiveType
public PrimitiveType getPrimitiveType()
- Specified by:
getPrimitiveTypein interfaceSimpleType
-
support
public abstract boolean support(Class<? extends Constraint> constraint)
- Returns:
- true if this primitive types supports this constraints, false otherwise.
- Since:
- 7.1
-
getConstraints
public Set<Constraint> getConstraints()
- Specified by:
getConstraintsin interfaceType- Overrides:
getConstraintsin classAbstractType- Returns:
- this type's constraints
-
-