Class Descriptor

All Implemented Interfaces:
Serializable, 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:
  • Field Details

  • Constructor Details

    • Descriptor

      public Descriptor()
  • Method Details

    • getQualifier

      public 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 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(Object o)
      Makes descriptors comparable by their qualifer (case insensitive).
      Specified by:
      compareTo in interface 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.