Interface DataType


  • public interface DataType
    Represents a data type for structured content provided by a Content Fragment.

    Data types are used to extend text-based Content Fragments with structured, typed data. Fragments with structured data are called Structured Content Fragments.

    The defining type strings (@see getTypeString()} for available types are defined by BasicDataType.

    Additionally, arrays of each data type are supported ("multi-value").

    Since:
    1.1
    • Method Detail

      • getTypeString

        @Deprecated
        @NotNull
        @NotNull java.lang.String getTypeString()
        Deprecated.
        Gets the string representation of the data type.

        The string representation must be unique and is used to identify the type (and some related data like mappings, etc.) within the repository.

        Note that it is recommended to use getValueType() and getSemanticType(), which provide more precise and normalized access to the type information.

        Returns:
        The string representation of the data type
      • getValueType

        @NotNull
        @NotNull java.lang.String getValueType()
        Gets the value type of the data type.

        The value type defines how a value is persisted. The list of value types is provided through BasicDataType, except for the values deprecated there.

        Returns:
        The value type
      • getSemanticType

        @Nullable
        @Nullable java.lang.String getSemanticType()
        Gets the semantic type of the data type.

        The semantic type defines how the stored value should be interpreted and mapped to a Java object. For example, a semantic type content-fragment defines that a value of value type string provides the path to a (nested) Content Fragment.

        Content Fragments ship with a set of predefined semantic types, defined by the constants found in SemanticDataType.

        Returns:
        The semantic type
      • isMultiValue

        boolean isMultiValue()
        Determines if the data type represents an array of values.
        Returns:
        true if the data type represents a collection of values; false if the data type represents a single value