public class UmlAssociation extends AbstractUmlObject
All the information related to the types/UML classes (getSource()
and
getTarget()
) gets derived from the contained association ends (getSourceEnd()
and getTargetEnd()
). Whether association is informative, in contrast, is based on the
stereotype (this allows us to identify and report when the due stereotype is missing).
Ownership of association is defined in OwningWg
, according to TC57 rules.
Associations with their two ends are a bit tricky. To define owner (owning top-level package and
its WG), we use the classes at both ends, i.e., methods getSource()
and
getTarget()
.
Consider example association from combined CIM model, between Location and PowerSystemResource. Location (from IEC61968) is the source and PowerSystemResource (from IEC61970) is the target. Qualified association ends, to display association, are shown so:
[0..*] Location.PowerSystemResources - [0..1] PowerSystemResource.Location
Modifier and Type | Class and Description |
---|---|
static class |
UmlAssociation.Data
Data from the UML model repository specific to
UmlAssociation . |
static class |
UmlAssociation.Direction
Direction (navigability) of association.
|
CLASS_SEPARATOR, NULL_OBJ_NAME, PACKAGE_SEPARATOR
Modifier and Type | Method and Description |
---|---|
boolean |
areEndVisibilitiesSame()
Returns whether both ends have the same visibility.
|
UmlAssociation.Direction |
getDirection()
Deprecated.
use
getNavigability() instead. |
UmlAssociationEndPair |
getEndsAsSource(boolean asSource)
Returns the pair of association ends from the perspective of source if
asSource
true (this is what we need when printing model documentation for associations of a
type , or when reading RDF/OWL properties), from the perspective of target
otherwise. |
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 associations.
|
Namespace |
getNamespace()
Returns the namespace of this UML object, based on tagged values in the UML model and when
missing, calculated by the application.
|
Nature |
getNature()
Returns the nature of this UML object, which determines the validation rules to apply, and
sometimes document generation formats.
|
UmlAssociation.Direction |
getNavigability()
Returns the nature of navigability (whether navigable); for direction, use
UmlAssociationEnd.getNavigable() for association ends. |
OwningWg |
getOwner()
Returns the IEC working group owning this UML object, as calculated by the application based
on the UML model structure.
|
java.util.Set<java.lang.String> |
getPredefinedTagNames()
Returns allowed tag names, as expected to be found in the UML model.
|
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 |
getSource()
Returns
UmlClass used as type for the source end. |
UmlAssociationEnd |
getSourceEnd()
Returns source end.
|
UmlClass |
getTarget()
Returns
UmlClass used as type for the target end. |
UmlAssociationEnd |
getTargetEnd()
Returns target end.
|
boolean |
hasANavigableEnd()
Returns whether this association has at least one navigable end.
|
boolean |
involvesWg(OwningWg wg)
Returns whether any of two classes of this association involve owner
wg . |
boolean |
isAtLeastOneEndPublic()
Returns whether at least one end is public.
|
boolean |
isDirectionMismatchForEnds()
Returns whether an association with unspecified navigability has a navigable end.
|
boolean |
isMapping()
Returns whether this association is accross model domains.
|
boolean |
isNonPrivate()
Returns whether any end is not private.
|
boolean |
isNonPublic()
Returns whether neither end is public.
|
boolean |
isWithinSameWg()
Returns whether this association is between the classes with the same owner.
|
java.lang.String |
toString() |
addDeprecAndInf, addTaggedValue, appendRemainingCustomStereotypes, classifyPerScope, classifyPerScopePerTag, classifyPerTag, collectDuplicateDescriptions, collectDuplicateNames, collectForScope, collectNames, collectQNames, findAllForName, findWithSameUuidAndLog, getAlias, getDescription, getHtmlDescription, getId, getName, getSince, getStereotype, getTaggedValues, getUnallowedTagNames, getUuid, getVisibility, initFromTags, isDeprecated, isInformative, saveTags, toShortString, toShortString, validateTag
public static java.util.List<UmlKind> getKinds(Nature nature)
nature
- ignored in this methodpublic UmlAssociationEnd getSourceEnd()
public UmlAssociationEnd getTargetEnd()
public UmlAssociationEndPair getEndsAsSource(boolean asSource)
asSource
true (this is what we need when printing model documentation for associations of a
type
, or when reading RDF/OWL properties), from the perspective of target
otherwise.public boolean isNonPrivate()
public boolean isNonPublic()
public boolean isAtLeastOneEndPublic()
public boolean areEndVisibilitiesSame()
@Deprecated public UmlAssociation.Direction getDirection()
getNavigability()
instead.public UmlAssociation.Direction getNavigability()
UmlAssociationEnd.getNavigable()
for association ends.public boolean hasANavigableEnd()
public boolean isDirectionMismatchForEnds()
public boolean isMapping()
public boolean isWithinSameWg()
public boolean involvesWg(OwningWg wg)
wg
.public OwningWg getOwner()
UmlObject
getOwner
in interface UmlObject
getOwner
in class AbstractUmlObject
public Namespace getNamespace()
Returns own namespace initialised from tagged values if not empty. Otherwise, returns the namespace of the source end.
public Nature getNature()
UmlObject
getNature
in interface UmlObject
getNature
in class AbstractUmlObject
public UmlKind getKind()
UmlObject
getKind
in interface UmlObject
getKind
in class AbstractUmlObject
public java.lang.String getQualifiedName()
UmlObject
getQualifiedName
in interface UmlObject
getQualifiedName
in class AbstractUmlObject
public java.util.Set<java.lang.String> getPredefinedTagNames()
UmlObject
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2016 Tatjana (Tanja) Kostic