public class UmlClass extends UmlStructure
UmlStructure
(so we
avoid code duplication).
Implementation note: We distinguish among kinds of classes by their UmlClass.CimKind
or
UmlClass.Iec61850Kind
, where both these types implement the common UmlKind
interface.
Knowing the kinds of classes allows us to do model validation and also to correctly print
documentation (and on the fly, calculate detailed statistics).
A cleaner design would be to effectively create subclasses instead of using the above kinds, but it would be overkill for minor differences in functionality per kind.
Modifier and Type | Class and Description |
---|---|
static class |
UmlClass.CimKind
Kind of the UML class for CIM domain.
|
static class |
UmlClass.Data
Data from the UML model repository specific to
UmlClass . |
static class |
UmlClass.Iec61850Kind
Kind of the UML class for IEC 61850 domain.
|
static class |
UmlClass.InheritedKind
Used in queries for attributes, association ends and operations.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SUPER_COMP_CDC |
static java.lang.String |
SUPER_LN |
static java.lang.String |
SUPER_PRIM_CDC |
static java.lang.String |
TAG_FUNCTIONS |
static java.lang.String |
TAG_PRESENCE_CONDITIONS |
CLASS_SEPARATOR, NULL_OBJ_NAME, PACKAGE_SEPARATOR
Constructor and Description |
---|
UmlClass(UmlPackage containingPackage,
java.util.Collection<UmlClass> superclasses,
UmlObjectData objData,
UmlClass.Data data)
Creates the instance and adds itself to the
containingPackage , and as child to
every object from superclasses . |
UmlClass(UmlPackage containingPackage,
UmlObjectData objData,
UmlClass.Data data)
Creates a class without superclasses; convenient for stereotyped and root classes.
|
Modifier and Type | Method and Description |
---|---|
UmlAssociation |
addAssociation(UmlAssociationEnd sourceEnd,
UmlAssociationEnd targetEnd,
UmlObjectData objData,
UmlAssociation.Data data)
Creates from arguments an association with this as type of
sourceEnd , adds it to
both types of association ends and to the model, and returns the newly created object. |
UmlAttribute |
addAttribute(UmlClass type,
UmlObjectData objData,
UmlAttribute.Data data)
Creates from arguments an attribute or enumeration literal, adds it to itself and to the
model, populates afferent/efferent collections for this and for
type , and
returns the newly created object. |
UmlConstraint |
addConstraint(UmlObjectData objData,
UmlConstraint.Data data)
Creates from arguments a constraint, adds it to itself, and returns the newly created object.
|
UmlOperation |
addOperation(UmlClass returnType,
UmlObjectData objData,
UmlOperation.Data data)
Creates from arguments an operation, adds it to itself and to the model, populates
afferent/efferent collections for this and for non-null
returnType , and returns
the newly created object. |
java.util.Collection<UmlClass> |
collectDependencyEfferentClasses()
Returns all classes that I depend on through an explicit UML dependency in the model.
|
java.util.Set<UmlAttribute> |
findAttributes(java.lang.String attrName)
Returns (native) attributes with
attrName . |
java.util.Set<UmlAttribute> |
findAttributes(java.lang.String attrName,
UmlClass.InheritedKind inh)
Returns attributes with
attrName selectively, according to inheritance criterion
inh . |
java.util.Set<UmlAttribute> |
findAttributes(UmlClass attrType)
Returns (native) attributes whose type is
attrType . |
java.util.Set<UmlAttribute> |
findAttributes(UmlClass attrType,
UmlClass.InheritedKind inh)
Returns attributes of type
attrType selectively, according to inheritance
criterion inh . |
java.util.Map<java.lang.String,java.util.List<UmlAttribute>> |
findAttributesPerInitialValue()
Returns (native) attributes indexed per their initial value.
|
java.util.Set<java.lang.String> |
findInitialValuesOrdered()
Returns (alphabetically) ordered initial values for (native) attributes; empty list in case
there are no initial values.
|
java.util.List<UmlAssociationEnd.AssociationEndPair> |
getAssociationEndPairs()
Returns pairs of association ends, from the perspective of this class (this end vs.
|
java.util.Collection<UmlAssociation> |
getAssociations() |
java.util.Collection<UmlClass> |
getAttributeAfferentClasses()
Returns classes that have attributes that use me as their type.
|
java.util.Collection<UmlClass> |
getAttributeEfferentClasses()
Returns classes that my attributes use as their type.
|
java.util.Collection<UmlAttribute> |
getAttributes()
Returns native attributes.
|
java.lang.String |
getCdcId()
Initialised from tagged value, applicable to 61850 CDC classes; null if no tag defined.
|
static java.util.Map<java.lang.String,UmlKind> |
getCimDataTypeMinSpec()
Minimum requirement for a valid
UmlStereotype.CIMDATATYPE : key is attribute name (
AbstractUmlObject.getName() ) and value is the kind of its type ((
UmlAttribute.getKind() )). |
java.util.Map<java.lang.String,UmlConstraint> |
getConstraints() |
UmlStructure |
getContainer()
Returns containing structure, null in case this is the model package.
|
UmlPackage |
getContainingPackage() |
java.lang.String |
getIecRef()
Initialised from tagged value, applicable to IEC61850-5 classes only; null if no tag defined.
|
java.lang.String |
getIeeeRef()
Initialised from tagged value, applicable to IEC61850-5 classes only; null if no tag defined.
|
java.util.List<UmlAssociationEnd.AssociationEndPair> |
getInheritedAssociationEndPairs()
Returns inherited pairs of association ends, from the perspective of this class (this end vs.
|
java.util.Collection<UmlAssociation> |
getInheritedAssociations() |
java.util.Set<UmlAttribute> |
getInheritedAttributes()
Returns inherited attributes.
|
java.util.Set<UmlOperation> |
getInheritedOperations()
Returns inherited operations.
|
java.util.List<UmlAssociationEnd> |
getInheritedOtherSideAssociationEnds()
Returns inherited association ends with other classes.
|
UmlKind |
getKind()
Returns kind of this UML object, as assigned by the application.
|
static java.util.List<UmlKind> |
getKinds(Nature nature)
Returns available classifications (kinds) for classes with
nature . |
UmlModel |
getModel()
Returns the model this structure belongs to.
|
Nature |
getNature()
Returns the nature of this UML object, which determines the validation rules to apply, and
sometimes document generation formats.
|
java.lang.String |
getOldName()
Initialised from tagged value, applicable to 61850 7-2 classes; null if no tag defined.
|
java.util.Collection<UmlClass> |
getOperationAfferentClasses()
Returns classes that have operation parameters that use me as their type.
|
java.util.Collection<UmlClass> |
getOperationEfferentClasses()
Returns classes that my operation parameters and exceptions use as their type.
|
java.util.Collection<UmlOperation> |
getOperations()
Returns native operations.
|
java.util.List<UmlAssociationEnd> |
getOtherSideAssociationEnds()
Returns association ends with other classes.
|
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).
|
java.lang.String |
getRsName()
Initialised from tagged value, applicable to IEC61850-5 classes only; null if no tag defined.
|
java.util.Collection<UmlClass> |
getSubclasses()
Returns direct subclasses of this class.
|
java.util.List<UmlClass> |
getSuperclassChain()
Starting from direct superclasses, returns all the superclasses up to the root.
|
java.util.Collection<UmlClass> |
getSuperclasses()
Returns direct superclasses of this class.
|
boolean |
hasSuperclass(java.lang.String supName)
Returns whether
supName is one of superclasses in the inheritance chain. |
boolean |
inheritsFromStatisticsLN()
(61850) Returns whether this class inherits from
"StatisticsLN"
|
boolean |
is74LN()
IEC61850 - e.g., StatisticsLN or LPHD
|
boolean |
isAbbreviationEnumeration()
IEC 61850
|
boolean |
isAbstract() |
boolean |
isAdmin()
(61850) Returns whether this class has stereotype
"admin"
|
boolean |
isAnyCDC()
IEC 61850 (like CDC or SPS)
|
boolean |
isAnyDA()
IEC 61850 (like DA or Vector)
|
boolean |
isAnyFCDA()
IEC 61850 (like FCDA_ST_dchg or INT32_ST_dchg)
|
boolean |
isAnyLN()
IEC 61850
|
boolean |
isAssociationClass() |
boolean |
isBasic()
IEC 61850 (P_*)
|
boolean |
isClass()
CIM non-root class without stereotype.
|
boolean |
isCodedEnum()
IEC 61850
|
boolean |
isCodedEnumDA()
IEC 61850
|
boolean |
isCodedEnumFCDA()
IEC 61850 (like PackedEnumFCDA_ST_dchg or DpStatus_ST_dchg)
|
boolean |
isComposedCDC()
IEC 61850 (like ComposedCDC or WYE)
|
boolean |
isComposedDA()
IEC 61850
|
boolean |
isComposedFCDA()
IEC 61850 (like Analog_MX_dchg)
|
boolean |
isCompound()
CIM
|
boolean |
isConditionEnumeration()
IEC 61850
|
boolean |
isDatatype()
CIM
|
boolean |
isEaEnumeration() |
boolean |
isEaInterface() |
boolean |
isEaLeafPropSet() |
boolean |
isEaPersistentPropSet() |
boolean |
isEaRootPropSet() |
boolean |
isEnumCDC()
IEC 61850 (like ENS and its subtypes, derived from SPS)
|
boolean |
isEnumDA()
IEC 61850
|
boolean |
isEnumeratedType()
Returns whether this is an enumerated type.
|
boolean |
isEnumeration()
CIM and IEC61850 - simple enumeration with no other stereotypes
|
boolean |
isEnumFCDA()
IEC 61850 (like EnumDA_ST_dchg or CurveChar_SP_dchg)
|
boolean |
isFCDA()
IEC 61850 (FCDA from the meta-model)
|
boolean |
isFrom72()
IEC 61850 - returns whether the class is from the model supporting IEC 61850-7-2.
|
boolean |
isFromMetaModel()
IEC 61850 - returns whether the class is from the meta-model (package and subpackages).
|
boolean |
isFunction()
IEC 61850
|
boolean |
isInformative()
Returns whether this UML object is informative (and thus should be ignored when generating
official IEC documents).
|
boolean |
isInterface()
IEC 61850
|
boolean |
isNamespaceClass() |
boolean |
isNullClass() |
boolean |
isOrHasSuperclass(java.lang.String name)
Returns whether
name is this class or one of its superclasses in the inheritance
chain. |
boolean |
isOrInheritsFromStatisticsLN()
(61850) Returns whether this class is itself or inherits from
"StatisticsLN"
|
boolean |
isOther()
IEC 61850
|
boolean |
isPackedList()
IEC 61850
|
boolean |
isPackedListDA()
IEC 61850
|
boolean |
isPackedListFCDA()
IEC 61850 (like Quality_ST_dchg)
|
boolean |
isPrimitive()
CIM
|
boolean |
isPrimitiveCDC()
IEC 61850 (like PrimitiveCDC or SPS)
|
boolean |
isPrimitiveDA()
IEC 61850
|
boolean |
isSelfInherited() |
boolean |
isStructured()
IEC 61850 (S_*); at present, S_Originator only
|
boolean |
isTrackingDerivedCDC()
IEC 61850 (like CTSINT32, derived from CTS)
|
boolean |
isTransientCDC()
IEC 61850 (like SPCTransient, derived from SPC)
|
boolean |
isUnknown()
IEC 61850 - with an unknown stereotype
|
boolean |
isUsableForStatistics()
(61850) Returns whether this class or any of its superclasses has stereotype
"statistics"
|
boolean |
isUsedAsTypeForAttributes() |
boolean |
isVersionClass() |
boolean |
isWithOldDatatypeStereotype() |
boolean |
needsAlias()
(61850) Returns whether this class needs alias, for doc generation purposes.
|
boolean |
needsTags()
(61850) Returns whether this class needs tagged values, for doc generation purposes.
|
java.lang.String |
toString() |
addDependency, addDiagram, addSkippedUmlItem, collectDependencyAfferentStructures, collectDependencyEfferentStructures, collectMyAndParentsDependencyEfferentStructures, getDependenciesAsSource, getDependenciesAsTarget, getDiagrams, getSkippedUmlItems, isSelfDependent
addTaggedValue, classifyPerScope, classifyPerScopePerTag, classifyPerTag, collectDuplicateDescriptions, collectDuplicateNames, collectForScope, collectNames, collectQNames, findAllForName, findWithSameUuidAndLog, getAlias, getDescription, getHtmlDescription, getId, getName, getSince, getStereotype, getTaggedValues, getUnallowedTagNames, getUuid, getVisibility, isDeprecated, saveTags, toShortString, toShortString, validateTag
public static final java.lang.String SUPER_PRIM_CDC
public static final java.lang.String SUPER_COMP_CDC
public static final java.lang.String SUPER_LN
public static final java.lang.String TAG_FUNCTIONS
public static final java.lang.String TAG_PRESENCE_CONDITIONS
public UmlClass(UmlPackage containingPackage, UmlObjectData objData, UmlClass.Data data)
UmlClass(UmlPackage, Collection, UmlObjectData, Data)
.public UmlClass(UmlPackage containingPackage, java.util.Collection<UmlClass> superclasses, UmlObjectData objData, UmlClass.Data data)
containingPackage
, and as child to
every object from superclasses
. After creating this object, you may want to add
tagged values, constraints, attributes, associations and operations (as well as other objects
- see UmlStructure.UmlStructure(UmlObjectData, UmlStructure.Data)
).public static java.util.Map<java.lang.String,UmlKind> getCimDataTypeMinSpec()
UmlStereotype.CIMDATATYPE
: key is attribute name (
AbstractUmlObject.getName()
) and value is the kind of its type ((
UmlAttribute.getKind()
)).public static java.util.List<UmlKind> getKinds(Nature nature)
nature
.public java.util.List<UmlClass> getSuperclassChain()
public UmlPackage getContainingPackage()
public boolean isNullClass()
public boolean isVersionClass()
public boolean isNamespaceClass()
public boolean isAbstract()
public boolean isWithOldDatatypeStereotype()
public boolean isEaPersistentPropSet()
public boolean isEaLeafPropSet()
public boolean isEaRootPropSet()
public boolean isEaInterface()
public boolean isEaEnumeration()
public boolean isAssociationClass()
public boolean isSelfInherited()
public java.lang.String getRsName()
public java.lang.String getIeeeRef()
public java.lang.String getIecRef()
public java.lang.String getCdcId()
public java.lang.String getOldName()
public boolean needsAlias()
public boolean needsTags()
public boolean isAdmin()
public boolean isUsableForStatistics()
public boolean inheritsFromStatisticsLN()
public boolean isOrInheritsFromStatisticsLN()
public boolean isPrimitive()
public boolean isEnumeration()
public boolean isDatatype()
public boolean isCompound()
public boolean isClass()
public boolean isInterface()
public boolean isCodedEnum()
public boolean isAbbreviationEnumeration()
public boolean isConditionEnumeration()
public boolean isPackedList()
public boolean isBasic()
public boolean isStructured()
public boolean isCodedEnumDA()
public boolean isEnumDA()
public boolean isPackedListDA()
public boolean isPrimitiveDA()
public boolean isComposedDA()
public boolean isCodedEnumFCDA()
public boolean isEnumFCDA()
public boolean isPackedListFCDA()
public boolean isComposedFCDA()
public boolean isPrimitiveCDC()
public boolean isEnumCDC()
public boolean isComposedCDC()
public boolean isTransientCDC()
public boolean isTrackingDerivedCDC()
public boolean isAnyDA()
public boolean isAnyFCDA()
public boolean isFCDA()
public boolean isAnyCDC()
public boolean isAnyLN()
public boolean is74LN()
public boolean isFunction()
public boolean isOther()
public boolean isUnknown()
public boolean isUsedAsTypeForAttributes()
public boolean isEnumeratedType()
isEnumeration()
, while for IEC 61850, this method returns true also for those
enumerations that have additional stereotype.public boolean isFrom72()
public boolean isFromMetaModel()
public java.util.Collection<UmlClass> collectDependencyEfferentClasses()
public java.util.Collection<UmlClass> getSuperclasses()
public java.util.Collection<UmlClass> getSubclasses()
public boolean hasSuperclass(java.lang.String supName)
supName
is one of superclasses in the inheritance chain.public boolean isOrHasSuperclass(java.lang.String name)
name
is this class or one of its superclasses in the inheritance
chain.public UmlOperation addOperation(UmlClass returnType, UmlObjectData objData, UmlOperation.Data data)
returnType
, and returns
the newly created object. After that, you may want to add tagged values, exceptions, and
parameters to the new operation.
For returnType
you should provide null in case the operation returns void. If
the return type could not be determined from the model repository, provide the "null" class
obtained with UmlModel.getNullClasses()
as argument for returnType
.
In case the operation with the same UUID has already been added, returns the existing operation immediately.
returnType
- return type, null if the operation returns voidobjData
- data
- java.lang.IllegalArgumentException
- if returnType
is null but data.kind says it does not return void, or
if this and non-null returnType
are from different models.public java.util.Collection<UmlOperation> getOperations()
public java.util.Set<UmlOperation> getInheritedOperations()
public java.util.Collection<UmlClass> getOperationAfferentClasses()
public java.util.Collection<UmlClass> getOperationEfferentClasses()
public UmlConstraint addConstraint(UmlObjectData objData, UmlConstraint.Data data)
objData
- data
- public java.util.Map<java.lang.String,UmlConstraint> getConstraints()
public UmlAttribute addAttribute(UmlClass type, UmlObjectData objData, UmlAttribute.Data data)
type
, and
returns the newly created object. After that, you may want to add tagged values and
constraints to the new attribute.
For type
that cannot be determined from the model repository, provide the "null"
class obtained with UmlModel.getNullClasses()
as argument.
In case the attribute with the same UUID has already been added, returns the existing attribute immediately.
type
- type of the attribute if it is not a literal, null otherwise.objData
- data
- java.lang.IllegalArgumentException
- if this and non-null type
are from different models,or if
type
is null and this not an enumerated type.public java.util.Collection<UmlAttribute> getAttributes()
public java.util.Set<UmlAttribute> getInheritedAttributes()
public java.util.Collection<UmlClass> getAttributeAfferentClasses()
public java.util.Collection<UmlClass> getAttributeEfferentClasses()
public java.util.Set<UmlAttribute> findAttributes(java.lang.String attrName)
attrName
.public java.util.Set<UmlAttribute> findAttributes(UmlClass attrType)
attrType
.public java.util.Set<UmlAttribute> findAttributes(java.lang.String attrName, UmlClass.InheritedKind inh)
attrName
selectively, according to inheritance criterion
inh
.public java.util.Set<UmlAttribute> findAttributes(UmlClass attrType, UmlClass.InheritedKind inh)
attrType
selectively, according to inheritance
criterion inh
.public java.util.Map<java.lang.String,java.util.List<UmlAttribute>> findAttributesPerInitialValue()
public java.util.Set<java.lang.String> findInitialValuesOrdered()
public UmlAssociation addAssociation(UmlAssociationEnd sourceEnd, UmlAssociationEnd targetEnd, UmlObjectData objData, UmlAssociation.Data data)
sourceEnd
, adds it to
both types of association ends and to the model, and returns the newly created object. After
that, you may want to add tagged values to the new association.
In case the association with the same UUID has already been added to either type of association end, returns the existing association immediately.
It is the responsibility of the caller to call this method on the source end's type.
sourceEnd
- targetEnd
- objData
- data
- java.lang.IllegalArgumentException
- if the types of sourceEnd
and targetEnd
are from
different models, or if this is not the type of sourceEnd
.public java.util.Collection<UmlAssociation> getAssociations()
public java.util.Collection<UmlAssociation> getInheritedAssociations()
public java.util.List<UmlAssociationEnd.AssociationEndPair> getAssociationEndPairs()
UmlAssociationEnd.AssociationEndPair
public java.util.List<UmlAssociationEnd.AssociationEndPair> getInheritedAssociationEndPairs()
UmlAssociationEnd.AssociationEndPair
public java.util.List<UmlAssociationEnd> getOtherSideAssociationEnds()
public java.util.List<UmlAssociationEnd> getInheritedOtherSideAssociationEnds()
public UmlModel getModel()
UmlStructure
getModel
in class UmlStructure
public UmlStructure getContainer()
UmlStructure
getContainer
in class UmlStructure
public OwningWg getOwner()
UmlObject
getOwner
in interface UmlObject
getOwner
in class UmlStructure
public Nature getNature()
UmlObject
getNature
in interface UmlObject
getNature
in class UmlStructure
public boolean isInformative()
UmlObject
isInformative
in interface UmlObject
isInformative
in class UmlStructure
public UmlKind getKind()
This implementation returns either the CIM of the IEC61850 kind, depending on the nature of the class.
getKind
in interface UmlObject
getKind
in class UmlStructure
public java.lang.String getQualifiedName()
UmlObject
getQualifiedName
in interface UmlObject
getQualifiedName
in class UmlStructure
public java.util.Set<java.lang.String> getPredefinedTagNames()
AbstractUmlObject
This default implementation returns empty set, and should be overriden by subclasses that have something to return.
getPredefinedTagNames
in interface UmlObject
getPredefinedTagNames
in class AbstractUmlObject
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2016 Tatjana (Tanja) Kostic