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
Primitive type (basic types like long, string, boolean, etc.).
- See Also:
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.schema.types.AbstractType
constraints, EMPTY_SUPERTYPES, name, schema, superType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionProvides aObjectResolver
if this type is a reference to an external entity.Gets the super type.Type[]
Gets the entire hierarchy of super-types.boolean
Tests whether this type is a primitive type.boolean
Tests whether this type is a simple type.protected boolean
abstract boolean
support
(Class<? extends Constraint> constraint) abstract boolean
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
-
Field Details
-
PRIMITIVE_TYPE_STRICT_VALIDATION_PROPERTY
- Since:
- 2023.8
- See Also:
-
-
Constructor Details
-
PrimitiveType
-
-
Method Details
-
validate
Description copied from interface:Type
Tests whether the given object is of this type.- Specified by:
validate
in interfaceType
- Overrides:
validate
in classAbstractType
- Parameters:
object
- the object to test- Returns:
- true if the given object if of this type, false otherwise
-
getObjectResolver
Description copied from interface:Type
Provides aObjectResolver
if this type is a reference to an external entity.- Specified by:
getObjectResolver
in interfaceType
- Overrides:
getObjectResolver
in classAbstractType
- Returns:
- a resolver if available, null otherwise.
-
getSuperType
Description copied from interface:Type
Gets the super type.- Specified by:
getSuperType
in interfaceType
- Overrides:
getSuperType
in classAbstractType
- Returns:
- the super type or null if this is a primitive type
-
getTypeHierarchy
Description copied from interface:Type
Gets 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
ANY
type.- Specified by:
getTypeHierarchy
in interfaceType
- Overrides:
getTypeHierarchy
in classAbstractType
- Returns:
- an array containing the supertypes of this type
-
isPrimitive
public boolean isPrimitive()Description copied from interface:SimpleType
Tests whether this type is a primitive type.- Specified by:
isPrimitive
in interfaceSimpleType
- Returns:
- true if this type is a primitive type, false otherwise
-
isSimpleType
public boolean isSimpleType()Description copied from interface:Type
Tests whether this type is a simple type.- Specified by:
isSimpleType
in interfaceType
- Overrides:
isSimpleType
in classAbstractType
- Returns:
- true if this type is a simple type, false otherwise
-
getPrimitiveType
- Specified by:
getPrimitiveType
in interfaceSimpleType
-
support
- Returns:
- true if this primitive types supports this constraints, false otherwise.
- Since:
- 7.1
-
getConstraints
- Specified by:
getConstraints
in interfaceType
- Overrides:
getConstraints
in classAbstractType
- Returns:
- this type's constraints
-
isStrictValidation
protected boolean isStrictValidation()
-