Class Descriptor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable
    Direct Known Subclasses:
    AttributeDescriptor

    public abstract class Descriptor
    extends TypeManagerManaged
    Base class of all descriptor items.

    Basically it just owns a qualifier and a value type.

    See Also:
    Serialized Form
    • Field Detail

      • ATTRIBUTETYPE

        public static final java.lang.String ATTRIBUTETYPE
        The attribute type attribute string constant.
        See Also:
        Constant Field Values
      • QUALIFIER

        public static final java.lang.String QUALIFIER
        The qualifier attribute string constant.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Descriptor

        public Descriptor()
    • Method Detail

      • getQualifier

        public java.lang.String getQualifier()
        Returns the qualifier of this descriptor.
      • getAttributeType

        public Type getAttributeType()
        Returns the type of this descriptor. Please note that the current session context is condiered. This means you will get the type describing the result value of Item.getAttribute(String) with the same session context.

        E.g. with present context language a localized field descriptor will not return its map type but the return type. To get the map type just set the context language to null.

      • getAttributeType

        public Type getAttributeType​(SessionContext ctx)
        Returns the type of this field. Please note that the specified session context is condiered. This means you will get the type describing the result value of Item.getAttribute(String) with the same session context.

        E.g. with present context language a localized field descriptor will not return its map type but the return type. To get the map type just set the context language to null.

      • getRealAttributeType

        public Type getRealAttributeType()
        Returns the real type if this descriptor without translating it according to the current session context.
      • getContextAdjustedAttributeType

        protected Type getContextAdjustedAttributeType​(SessionContext ctx,
                                                       Type realtype)
        Translates the real type of this descriptor into the one matching the given session context.

        By now this only applies to map types describing localized field: if a context language is set this method will return its argument type.

        Parameters:
        ctx - the session context
        realtype - this descriptors real type
      • toString

        public java.lang.String toString()
        The string representation of this descriptor.
        Overrides:
        toString in class Item
        Returns:
        the String representation of this item.
      • getDescriptorImpl

        protected Descriptor.DescriptorImpl getDescriptorImpl()
        Internal access to persistence layer implementation.
      • compareTo

        public int compareTo​(java.lang.Object o)
        Makes descriptors comparable by their qualifer (case insensitive).
        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.