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:
  • Field Details

    • PRIMITIVE_TYPE_STRICT_VALIDATION_PROPERTY

      public static final String PRIMITIVE_TYPE_STRICT_VALIDATION_PROPERTY
      Since:
      2023.8
      See Also:
  • Constructor Details

    • PrimitiveType

      protected PrimitiveType(String name)
  • Method Details

    • validate

      public abstract boolean validate(Object object)
      Description copied from interface: Type
      Tests whether the given object is of this type.
      Specified by:
      validate in interface Type
      Overrides:
      validate in class AbstractType
      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: Type
      Provides a ObjectResolver if this type is a reference to an external entity.
      Specified by:
      getObjectResolver in interface Type
      Overrides:
      getObjectResolver in class AbstractType
      Returns:
      a resolver if available, null otherwise.
    • getSuperType

      public Type getSuperType()
      Description copied from interface: Type
      Gets the super type.
      Specified by:
      getSuperType in interface Type
      Overrides:
      getSuperType in class AbstractType
      Returns:
      the super type or null if this is a primitive type
    • getTypeHierarchy

      public 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 interface Type
      Overrides:
      getTypeHierarchy in class AbstractType
      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 interface SimpleType
      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 interface Type
      Overrides:
      isSimpleType in class AbstractType
      Returns:
      true if this type is a simple type, false otherwise
    • getPrimitiveType

      public PrimitiveType getPrimitiveType()
      Specified by:
      getPrimitiveType in interface SimpleType
    • 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:
      getConstraints in interface Type
      Overrides:
      getConstraints in class AbstractType
      Returns:
      this type's constraints
    • isStrictValidation

      protected boolean isStrictValidation()