public class UmlConstraint extends AbstractUmlObject
Currently, the only supported constraints are those attached to LN and CDC classes. For
recognised formats, see UmlConstraint.Kind
.
Design note: We could have had two subclasses, but it would have been an overkill at this point in time.
Modifier and Type | Class and Description |
---|---|
static class |
UmlConstraint.Data
Data from the UML model repository specific to
UmlConstraint . |
static class |
UmlConstraint.Kind
Kind of constraint.
|
Modifier and Type | Field and Description |
---|---|
private UmlAttribute |
_containingAttribute |
private UmlClass |
_containingClass |
private UmlConstraint.Data |
_data |
private UmlKind |
_kind |
private static org.apache.log4j.Logger |
_logger |
private PresenceCondition |
_pc |
static java.lang.String |
SEPARATOR
Used to separate attribute names from the condition text for class constraints.
|
CLASS_SEPARATOR, NULL_OBJ_NAME, PACKAGE_SEPARATOR
Constructor and Description |
---|
UmlConstraint(UmlAttribute containingAttribute,
UmlObjectData objData,
UmlConstraint.Data data)
Intended to be called by
UmlAttribute and tests only. |
UmlConstraint(UmlClass containingClass,
UmlObjectData objData,
UmlConstraint.Data data)
Intended to be called by
UmlClass and tests only. |
Modifier and Type | Method and Description |
---|---|
(package private) static UmlConstraint |
basic(UmlAttribute containingAttribute,
java.lang.String name,
java.lang.String condition)
For tests only: Constructs attribute constraint.
|
(package private) static UmlConstraint |
basic(UmlClass containingClass,
java.lang.String name,
java.lang.String condition,
java.lang.String... attrNames)
For tests only: Constructs class constraint.
|
java.util.List<java.lang.String> |
getAttrNames()
Returns list of class attribute names if this is a class constraint, empty list otherwise.
|
java.lang.String |
getCondition()
Returns value for condition if this is an attribute constraint, or description of presence
condition if this is a class constraint.
|
private UmlObject |
getContainer()
Returns containing object (either class or attribute).
|
UmlAttribute |
getContainingAttribute()
Returns containing attribute if this is an attribute constraint, null otherwise.
|
UmlClass |
getContainingClass()
Returns containing class if this is a class constraint, null otherwise.
|
UmlKind |
getKind()
Returns kind of this UML object, as assigned by the application.
|
Nature |
getNature()
Returns the nature of this UML object, which determines the validation rules to apply, and
sometimes document generation formats.
|
OwningWg |
getOwner()
Returns the IEC working group owning this UML object, as calculated by the application based
on the UML model structure.
|
PresenceCondition |
getPresenceCondition()
Returns presence condition deduced from this class constraint; null for attribute constraint.
|
java.lang.String |
getQualifiedName()
Returns the name of this UML object combined with some container-related information (e.g.,
packageName.className, or containingPackageName.packageName).
|
boolean |
isInformative()
Returns whether this UML object is informative (and thus should be ignored when generating
official IEC documents).
|
boolean |
isSupportsTags()
Returns whether tagged values are supported.
|
java.lang.String |
toString() |
protected void |
validateTag(java.lang.String name,
java.lang.String value)
Subclasses should overwride this method in case some validation about the tagged value is
needed before adding it.
|
addTaggedValue, classifyPerScope, classifyPerScopePerTag, classifyPerTag, collectDuplicateDescriptions, collectDuplicateNames, collectForScope, collectNames, collectQNames, findWithSameUuidAndLog, getAlias, getDescription, getHtmlDescription, getId, getName, getPredefinedTagNames, getSince, getStereotype, getTaggedValues, getUnallowedTagNames, getUuid, getVisibility, isDeprecated, saveTags, toShortString, toShortString
private static final org.apache.log4j.Logger _logger
public static final java.lang.String SEPARATOR
private final UmlClass _containingClass
private final PresenceCondition _pc
private final UmlAttribute _containingAttribute
private final UmlConstraint.Data _data
private final UmlKind _kind
UmlConstraint(UmlClass containingClass, UmlObjectData objData, UmlConstraint.Data data)
UmlClass
and tests only.UmlConstraint(UmlAttribute containingAttribute, UmlObjectData objData, UmlConstraint.Data data)
UmlAttribute
and tests only.static UmlConstraint basic(UmlClass containingClass, java.lang.String name, java.lang.String condition, java.lang.String... attrNames)
static UmlConstraint basic(UmlAttribute containingAttribute, java.lang.String name, java.lang.String condition)
public UmlClass getContainingClass()
public java.util.List<java.lang.String> getAttrNames()
public PresenceCondition getPresenceCondition()
public java.lang.String getCondition()
public UmlAttribute getContainingAttribute()
private UmlObject getContainer()
public boolean isSupportsTags()
public OwningWg getOwner()
UmlObject
getOwner
in interface UmlObject
getOwner
in class AbstractUmlObject
public Nature getNature()
UmlObject
getNature
in interface UmlObject
getNature
in class AbstractUmlObject
public boolean isInformative()
UmlObject
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()
UmlObject
getQualifiedName
in interface UmlObject
getQualifiedName
in class AbstractUmlObject
protected void validateTag(java.lang.String name, java.lang.String value)
AbstractUmlObject
validateTag
in class AbstractUmlObject
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2015 Tatjana (Tanja) Kostic