Class Type

    • Field Detail

      • DEFAULTVALUE

        public static final java.lang.String DEFAULTVALUE
        The default value attribute string constant.
      • DESCRIPTION

        public static final java.lang.String DESCRIPTION
        The description attribute string constant.
      • CODE

        public static final java.lang.String CODE
        The code attribute string constant.
      • XMLDEFINITION

        public static final java.lang.String XMLDEFINITION
        The xml definition attribute string constant.
    • Constructor Detail

      • Type

        public Type()
    • Method Detail

      • getCode

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

        public java.lang.Object getDefaultValue()
        Returns the default value of this type.
      • getDefaultValue

        public java.lang.Object getDefaultValue​(SessionContext ctx)
        Returns the default value of this type.
      • isAssignableFrom

        public abstract boolean isAssignableFrom​(Type type)
        Tests if this type is assignable from a given type.

        This is true if this type equals or is supertype of the given type.

        Parameters:
        type - the type to be checked.
      • isInstance

        public abstract boolean isInstance​(java.lang.Object o)
        Test whether an object is an instance of this type or not.

        This is true if this type is type of this object or is supertype of the object's type.

        Parameters:
        o - the object to be checked.
      • getDescription

        public java.lang.String getDescription()
        Returns:
        the description of this type localized for the current session language.
      • getDescription

        public java.lang.String getDescription​(SessionContext ctx)
        Returns:
        the description of this type localized by the given session context.
      • setDescription

        public void setDescription​(java.lang.String description)
        Changes the type description for the current session language.
        Parameters:
        description - the new description.
      • setDescription

        public void setDescription​(SessionContext ctx,
                                   java.lang.String description)
        Changes the type description for the given session context language.
        Parameters:
        ctx - the session context defining the language to set the description for
        description - the new description.
      • getAllDescriptions

        public java.util.Map getAllDescriptions()
        Returns:
        all descriptions at once in form of a language-to-description map.
      • getAllDescriptions

        public java.util.Map getAllDescriptions​(SessionContext ctx)
        Returns:
        all descriptions at once in form of a language-to-description map.
      • setAllDescriptions

        public void setAllDescriptions​(java.util.Map descriptions)
        Changes all descriptions by specifying a language-to-description map. All previous descriptions are removed.
        Parameters:
        descriptions - all new names as language-to-description map
      • setAllDescriptions

        public void setAllDescriptions​(SessionContext ctx,
                                       java.util.Map descriptions)
        Changes all descriptions by specifying a language-to-description map. All previous descriptions are removed.
        Parameters:
        descriptions - all new descriptions as language-to-description map
      • toString

        public java.lang.String toString()
        Provides a string representation of this type.
        Overrides:
        toString in class Item
        Returns:
        the String representation of this item.
      • getXMLDefinition

        public abstract java.lang.String getXMLDefinition()
        Returns the XML definition string as expected by items.xml .
      • getTypeImpl

        protected Type.TypeImpl getTypeImpl()
        Internal access to persistence layer implementation.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Makes types comparable by their code (case insenesitive).
        Specified by:
        compareTo in interface java.lang.Comparable
        Overrides:
        compareTo in class Item
        Parameters:
        o - which will be compared to this item.
        Returns:
        the value 0 if the argument item pk is equal to this item pk; a value less than 0 if this item pk is lexicographically less than the argument item pk; and a value greater than 0 if this item pk is lexicographically greater than the argument item pk.