Package wt.introspection
Class RoleDescriptor
java.lang.Object
wt.introspection.RoleDescriptor
- All Implemented Interfaces:
Externalizable,Serializable,LocalizableMessage,Message
RoleDescriptor supplies meta-data information for a role of a Link (AssociationEnd).
Supported API: true
Extendable: false
Supported API: true
Extendable: false
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanEquals 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 intGets the cardinality (multiplicity) of this role.Gets the display name for this role descriptor.getDisplayName(Locale locale) Gets the display name for this role, for the specified locale.Gets the LinkInfo that owns this role.getLocalizedMessage(Locale locale) Gets the localized message for this role, for the specified locale.final StringgetName()Gets the name of this Role.Gets the other RoleDescriptor, for the association that owns them.Gets the valid ClassInfo for this role.inthashCode()Return hashcode that is consistent with equals implementation.final booleanDetermines if a class that plays this role in the association represents the "part" in an aggregation (whole-part) relationship.final booleanDetermines if this role of the association will be automatically read from the database, along with the other side object.final booleanDetermines if a class that plays this role in the association represents the "owned" object in a composite aggregation.final booleanDetermines if this class is a dependency of the opposite-side class.final booleanDetermines if there can be multiple objects that play this role in a particular association.final booleanDetermines if this role of the association can be navigated to, from the object on the other side of the association.final booleanDetermines if it is valid for no objects to play this role in a particular association.final booleanDetermines if the number of objects that play this role in a particular association, is unlimited.toString()Returns a string representation of the object.
-
Method Details
-
equals
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 -
hashCode
public int hashCode()Return hashcode that is consistent with equals implementation.
Supported API: true -
getCardinality
public final int getCardinality()Gets the cardinality (multiplicity) of this role.
Supported API: true- Returns:
- cardinality of role
-
getDisplayName
Gets the display name for this role descriptor.
Supported API: true- Returns:
- The display name string.
- See Also:
-
getDisplayName
Gets the display name for this role, for the specified locale.
Supported API: true- Returns:
- The display name string.
-
getLinkInfo
Gets the LinkInfo that owns this role.
Supported API: true- Returns:
- The LinkInfo that owns this role.
- Throws:
WTIntrospectionException
-
getLocalizedMessage
Gets the localized message for this role, for the specified locale.
Supported API: true- Specified by:
getLocalizedMessagein interfaceLocalizableMessage- Returns:
- The display name string.
-
getName
Gets the name of this Role.
Supported API: true- Returns:
- roleName as a String
-
getOtherRole
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
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
-
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
-
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
Returns a string representation of the object.
Supported API: true
-