Class DataType

  • Direct Known Subclasses:
    CollectionDataType, MapDataType

    public class DataType
    extends java.lang.Object
    Holds meta information about a type, especially which attributes it has.
    • Field Detail

      • NULL

        public static final DataType NULL
      • NULL_COMPOUND

        public static final DataType NULL_COMPOUND
      • BOOLEAN

        public static final DataType BOOLEAN
      • STRING

        public static final DataType STRING
      • BYTE

        public static final DataType BYTE
      • CHARACTER

        public static final DataType CHARACTER
      • SHORT

        public static final DataType SHORT
      • INTEGER

        public static final DataType INTEGER
      • LONG

        public static final DataType LONG
      • FLOAT

        public static final DataType FLOAT
      • DOUBLE

        public static final DataType DOUBLE
      • BIG_DECIMAL

        public static final DataType BIG_DECIMAL
      • DATE

        public static final DataType DATE
    • Method Detail

      • getAttributes

        public java.util.Collection<DataAttribute> getAttributes()
        Returns the attributes this type provides, or an empty collection, if this type is atomic.
      • getClazz

        public java.lang.Class getClazz()
        Returns the corresponding java Class for this type.
      • getCode

        public java.lang.String getCode()
        Returns the (unique) code of this type.
      • getAttribute

        public DataAttribute getAttribute​(java.lang.String qualifier)
        Returns the DataAttribute for the given qualifier or null, if not existing.
      • isAtomic

        public boolean isAtomic()
        Returns true, if this Type is atomic (i.e. doesn't provide any attributes).
      • isEnum

        public boolean isEnum()
        Returns true, if this Type is an enumeration
      • getType

        public DataType.Type getType()
        Returns:
        Type's family
      • getLabel

        public java.lang.String getLabel​(java.util.Locale locale)
        Returns the label for the given locale.
      • getAllLabels

        public java.util.Map<java.util.Locale,​java.lang.String> getAllLabels()
        Returns all labels for this type.
      • getSubtypes

        public java.util.List<java.lang.String> getSubtypes()
        Returns a set of names of all available subtypes that directly inherit from the type (1-st level subtypes).
      • isSearchable

        public boolean isSearchable()
        Returns:
        true if the instances of the type may be found using search mechanism. For example database views may be declared as types but may not be a valid search target types.
      • getSuperType

        public java.lang.String getSuperType()
        Returns:
        Code of the supertype if exists, null otherwise.
      • isAbstract

        public boolean isAbstract()
        Returns:
        true if the type is abstract
      • isSingleton

        public boolean isSingleton()
        Returns:
        true if the type is a singleton ie. only one instance of the type is allowed
      • getAllSuperTypes

        public java.util.List<java.lang.String> getAllSuperTypes()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object