Class RoleDescriptor

java.lang.Object
wt.introspection.RoleDescriptor
All Implemented Interfaces:
Externalizable, Serializable, LocalizableMessage, Message

public class RoleDescriptor extends Object implements LocalizableMessage, Externalizable
RoleDescriptor supplies meta-data information for a role of a Link (AssociationEnd).

Supported API: true

Extendable: false
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object compareRole)
    Equals is true if both sets of role names are the same, and either the link classes are type compatible, or both sets of role classes are type compatible, and the opposite side classes are not the same class.
    final int
    Gets the cardinality (multiplicity) of this role.
    Gets the display name for this role descriptor.
    Gets the display name for this role, for the specified locale.
    Gets the LinkInfo that owns this role.
    Gets the localized message for this role, for the specified locale.
    final String
    Gets the name of this Role.
    Gets the other RoleDescriptor, for the association that owns them.
    Gets the valid ClassInfo for this role.
    int
    Return hashcode that is consistent with equals implementation.
    final boolean
    Determines if a class that plays this role in the association represents the "part" in an aggregation (whole-part) relationship.
    final boolean
    Determines if this role of the association will be automatically read from the database, along with the other side object.
    final boolean
    Determines if a class that plays this role in the association represents the "owned" object in a composite aggregation.
    final boolean
    Determines if this class is a dependency of the opposite-side class.
    final boolean
    Determines if there can be multiple objects that play this role in a particular association.
    final boolean
    Determines if this role of the association can be navigated to, from the object on the other side of the association.
    final boolean
    Determines if it is valid for no objects to play this role in a particular association.
    final boolean
    Determines if the number of objects that play this role in a particular association, is unlimited.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • equals

      public boolean equals(Object compareRole)
      Equals is true if both sets of role names are the same, and either the link classes are type compatible, or both sets of role classes are type compatible, and the opposite side classes are not the same class.

      Supported API: true
      Overrides:
      equals in class Object
      Returns:
      true, if names match
    • hashCode

      public int hashCode()
      Return hashcode that is consistent with equals implementation.

      Supported API: true
      Overrides:
      hashCode in class Object
      Returns:
      hashCode of relavent data elements.
    • getCardinality

      public final int getCardinality()
      Gets the cardinality (multiplicity) of this role.

      Supported API: true
      Returns:
      cardinality of role
    • getDisplayName

      public String getDisplayName()
      Gets the display name for this role descriptor.

      Supported API: true
      Returns:
      The display name string.
      See Also:
    • getDisplayName

      public String getDisplayName(Locale locale)
      Gets the display name for this role, for the specified locale.

      Supported API: true
      Returns:
      The display name string.
    • getLinkInfo

      public LinkInfo getLinkInfo() throws WTIntrospectionException
      Gets the LinkInfo that owns this role.

      Supported API: true
      Returns:
      The LinkInfo that owns this role.
      Throws:
      WTIntrospectionException
    • getLocalizedMessage

      public String getLocalizedMessage(Locale locale)
      Gets the localized message for this role, for the specified locale.

      Supported API: true
      Specified by:
      getLocalizedMessage in interface LocalizableMessage
      Returns:
      The display name string.
    • getName

      public final String getName()
      Gets the name of this Role.

      Supported API: true
      Returns:
      roleName as a String
    • getOtherRole

      public RoleDescriptor getOtherRole() throws WTIntrospectionException
      Gets the other RoleDescriptor, for the association that owns them.

      Supported API: true
      Returns:
      role from the other side of the link
      Throws:
      WTIntrospectionException - if cannot obtain LinkInfo
    • getValidClassInfo

      public ClassInfo getValidClassInfo() throws WTIntrospectionException
      Gets the valid ClassInfo for this role.

      Supported API: true
      Returns:
      ClassInfo for the valid class of the role
      Throws:
      WTIntrospectionException - if cannot load the ClassInfo
    • isAggregated

      public final boolean isAggregated()
      Determines if a class that plays this role in the association represents the "part" in an aggregation (whole-part) relationship.

      Supported API: true
      Returns:
      true if modeled as an aggregation
    • isAutoNavigate

      public final boolean isAutoNavigate()
      Determines if this role of the association will be automatically read from the database, along with the other side object.

      Supported API: true
      Returns:
      true if role is automatically navigated (read from the database with the other side object)
    • isComposed

      public final boolean isComposed()
      Determines if a class that plays this role in the association represents the "owned" object in a composite aggregation.
       UML Definition of Composition -
       A form of aggregation with strong ownership and coincident lifetime
       as part of the whole. Parts with non-fixed multiplicity may be created
       after the composite itself, but once created they live and die with it
       (i.e., they share lifetimes). Such parts can also be explicitly removed
       before the death of the composite. Composition may be recursive.
        


      Supported API: true
      Returns:
      true if modeled as a composition
    • isDependency

      public final boolean isDependency()
      Determines if this class is a dependency of the opposite-side class.

      Supported API: true
      Returns:
      true if modeled as a dependency of the opposite-side class
    • isMultiple

      public final boolean isMultiple()
      Determines if there can be multiple objects that play this role in a particular association.

      Supported API: true
      Returns:
      true if this role has multiple cardinality
    • isNavigable

      public final boolean isNavigable()
      Determines if this role of the association can be navigated to, from the object on the other side of the association.

      Supported API: true
      Returns:
      true if this role is navaigable
    • isOptional

      public final boolean isOptional()
      Determines if it is valid for no objects to play this role in a particular association.

      Supported API: true
      Returns:
      true if this role has optional cardinality
    • isUnbounded

      public final boolean isUnbounded()
      Determines if the number of objects that play this role in a particular association, is unlimited.

      Supported API: true
      Returns:
      true if this role has unbounded cardinality
    • toString

      public String toString()
      Returns a string representation of the object.

      Supported API: true
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.