public class UmlAssociationEnd extends AbstractUmlObject
This class is more of a helper for UmlAssociation
. We make it however implement
UmlObject
to be able to use utility methods of AbstractUmlObject
, but do not
store any instance in UmlModel
- association ends are stored in associations only. Note
that after creation, several methods will return null before the containinig association gets
created with this instance as one of its ends (
UmlAssociation.UmlAssociation(UmlAssociationEnd, UmlAssociationEnd, UmlObjectData, UmlAssociation.Data)
).
The owner of this end is determined as the owner of the type of the other end, and the nature is the nature of the type of this end. Example: For association A (bRole) --- (aRole) B, if this is aRole, its owner is the owner of A (because it is needed by A), and its nature is the nature of B (because its type is B).
Modifier and Type | Class and Description |
---|---|
static class |
UmlAssociationEnd.AssociationEndPair
Helper class, used to hold the two association ends of an association, from the perspective
of a UmlClass used as type for those ends.
|
static class |
UmlAssociationEnd.Data
Data from the UML model repository specific to
UmlAssociationEnd . |
static class |
UmlAssociationEnd.Kind
Kind of aggregation for association end.
|
static class |
UmlAssociationEnd.Navigable
Navigability of an association end.
|
Modifier and Type | Field and Description |
---|---|
private UmlAssociation |
_containingAssociation |
private UmlAssociationEnd.Data |
_data |
private static org.apache.log4j.Logger |
_logger |
private UmlClass |
_type |
static java.util.List<java.lang.String> |
STEREOTYPES
Allowed stereotypes for UML association ends.
|
CLASS_SEPARATOR, NULL_OBJ_NAME, PACKAGE_SEPARATOR
Constructor and Description |
---|
UmlAssociationEnd(UmlClass type,
UmlObjectData objData,
UmlAssociationEnd.Data data)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) static UmlAssociationEnd |
basic(UmlClass type,
java.lang.String name)
For testing only: Constructs minimal association end.
|
(package private) static UmlAssociationEnd |
basic(UmlClass type,
java.lang.String name,
UmlStereotype stereotype)
For testing only: Constructs minimal association end with stereotype.
|
UmlAssociation |
getContainingAssociation()
Returns the association to which this end belongs.
|
UmlKind |
getKind()
Returns kind of this UML object, as assigned by the application.
|
static java.util.List<UmlKind> |
getKinds(Nature nature)
Returns all available classifications (kinds) for association ends.
|
UmlMultiplicity |
getMultiplicity() |
Nature |
getNature()
Returns the nature of this UML object, which determines the validation rules to apply, and
sometimes document generation formats.
|
UmlAssociationEnd.Navigable |
getNavigable() |
private UmlAssociationEnd |
getOtherEnd()
Returns null if containing association not initialised.
|
OwningWg |
getOwner()
Returns the IEC working group owning this UML object, as calculated by the application based
on the UML model structure.
|
java.lang.String |
getQualifiedName()
Returns the name of this UML object combined with some container-related information (e.g.,
packageName.className, or containingPackageName.packageName).
|
UmlClass |
getType()
Returns
UmlClass used as type for this association end. |
boolean |
isAggregation() |
boolean |
isAssociation() |
boolean |
isComposition() |
boolean |
isDeprecated()
Returns whether this UML object is deprecated; this may be defined directly on this object
with the stereotype
UmlStereotype.DEPRECATED , or derived (for instance, for
association ends of an association). |
boolean |
isInformative()
Returns whether this UML object is informative (and thus should be ignored when generating
official IEC documents).
|
boolean |
isNamedWithoutMultiplicity() |
boolean |
isOther() |
boolean |
isSource()
Returns whether this end is the source end of the containing association.
|
boolean |
isTarget()
Returns whether this end is the target end of the containing association.
|
private boolean |
otherEndInitialised() |
(package private) void |
setContainingAssociation(UmlAssociation containingAssociation)
Reserved for use by
UmlAssociation : Sets containing association for this end. |
java.lang.String |
toString() |
addTaggedValue, classifyPerScope, classifyPerScopePerTag, classifyPerTag, collectDuplicateDescriptions, collectDuplicateNames, collectForScope, collectNames, collectQNames, findWithSameUuidAndLog, getAlias, getDescription, getHtmlDescription, getId, getName, getPredefinedTagNames, getSince, getStereotype, getTaggedValues, getUnallowedTagNames, getUuid, getVisibility, saveTags, toShortString, toShortString, validateTag
private static final org.apache.log4j.Logger _logger
public static final java.util.List<java.lang.String> STEREOTYPES
private final UmlClass _type
private final UmlAssociationEnd.Data _data
private UmlAssociation _containingAssociation
public UmlAssociationEnd(UmlClass type, UmlObjectData objData, UmlAssociationEnd.Data data)
setContainingAssociation(UmlAssociation)
to correctly set reference to itself.type
- class used as type for this association end.objData
- common data for any UmlObject
.data
- data proper to UmlAssociationEnd
.public static java.util.List<UmlKind> getKinds(Nature nature)
nature
- ignored in this methodstatic UmlAssociationEnd basic(UmlClass type, java.lang.String name)
static UmlAssociationEnd basic(UmlClass type, java.lang.String name, UmlStereotype stereotype)
public UmlAssociation getContainingAssociation()
void setContainingAssociation(UmlAssociation containingAssociation)
UmlAssociation
: Sets containing association for this end.containingAssociation
- non-null containing association.public boolean isAssociation()
public boolean isAggregation()
public boolean isComposition()
public boolean isOther()
public UmlMultiplicity getMultiplicity()
public UmlAssociationEnd.Navigable getNavigable()
public boolean isNamedWithoutMultiplicity()
private boolean otherEndInitialised()
private UmlAssociationEnd getOtherEnd()
public boolean isSource()
public boolean isTarget()
public OwningWg getOwner()
Before two instances of this are used to create an association, returns null.
getOwner
in interface UmlObject
getOwner
in class AbstractUmlObject
public Nature getNature()
UmlObject
getNature
in interface UmlObject
getNature
in class AbstractUmlObject
public boolean isInformative()
Before two instances of this are used to create an association, returns false.
Association end is informative if its type, or its other end type is informative, or if the containing association is tagged as informative.
isInformative
in interface UmlObject
isInformative
in class AbstractUmlObject
public UmlKind getKind()
UmlObject
getKind
in interface UmlObject
getKind
in class AbstractUmlObject
public java.lang.String getQualifiedName()
Returns qualified name of this association end (i.e., the type of the other association end prepended to the name).
getQualifiedName
in interface UmlObject
getQualifiedName
in class AbstractUmlObject
public boolean isDeprecated()
UmlStereotype.DEPRECATED
, or derived (for instance, for
association ends of an association).
This default implementation returns whether the stereotype string of this object contains the
string UmlStereotype.DEPRECATED
.
The implementation of UML association end deduces the value to return as follows:
AbstractUmlObject.isDeprecated()
.
isDeprecated
in interface UmlObject
isDeprecated
in class AbstractUmlObject
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2015 Tatjana (Tanja) Kostic