wt.introspection
Class RoleDescriptor

java.lang.Object
  extended by 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:
WTIntrospector, ClassInfo, LinkInfo, Serialized Form

Method Summary
 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.
 int getCardinality()
          Gets the cardinality (multiplicity) of this role.
 String getDisplayName()
          Gets the display name for this role descriptor.
 String getDisplayName(Locale locale)
          Gets the display name for this role, for the specified locale.
 LinkInfo getLinkInfo()
          Gets the LinkInfo that owns this role.
 String getLocalizedMessage(Locale locale)
          Gets the localized message for this role, for the specified locale.
 String getName()
          Gets the name of this Role.
 RoleDescriptor getOtherRole()
          Gets the other RoleDescriptor, for the association that owns them.
 ClassInfo getValidClassInfo()
          Gets the valid ClassInfo for this role.
 boolean isAggregated()
          Determines if a class that plays this role in the association represents the "part" in an aggregation (whole-part) relationship.
 boolean isAutoNavigate()
          Determines if this role of the association will be automatically read from the database, along with the other side object.
 boolean isComposed()
          Determines if a class that plays this role in the association represents the "owned" object in a composite aggregation.
 boolean isDependency()
          Determines if this class is a dependency of the opposite-side class.
 boolean isMultiple()
          Determines if there can be multiple objects that play this role in a particular association.
 boolean isNavigable()
          Determines if this role of the association can be navigated to, from the object on the other side of the association.
 boolean isOptional()
          Determines if it is valid for no objects to play this role in a particular association.
 boolean isUnbounded()
          Determines if the number of objects that play this role in a particular association, is unlimited.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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

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(Locale)

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 wt.introspection.WTIntrospectionException
Gets the LinkInfo that owns this role.

Supported API: true

Returns:
The LinkInfo that owns this role.
Throws:
wt.introspection.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 wt.introspection.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 wt.introspection.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.