The base class for UML objects.
More...
#include <umlobject.h>
|
enum | ObjectType {
ot_Unknown = -1
, ot_UMLObject = 100
, ot_Actor
, ot_UseCase
,
ot_Package
, ot_Interface
, ot_Datatype
, ot_Enum
,
ot_Class
, ot_Instance
, ot_Association
, ot_Attribute
,
ot_Operation
, ot_EnumLiteral
, ot_Template
, ot_Component
,
ot_Artifact
, ot_Node
, ot_Stereotype
, ot_Role
,
ot_Entity
, ot_EntityAttribute
, ot_Folder
, ot_EntityConstraint
,
ot_UniqueConstraint
, ot_ForeignKeyConstraint
, ot_CheckConstraint
, ot_Category
,
ot_Port
, ot_InstanceAttribute
, ot_SubSystem
} |
|
The base class for UML objects.
This class is the non-graphical version of UMLWidget. These are created and maintained in the class UMLDoc. This class holds all the generic information needed for all UML objects.
clone needs to be implemented by each child class.
saveToXMI saves the XMI attributes of each specific model class. It needs to be implemented by each child class. For creating the XMI element and saving the common XMI parts, it can use the save1() method.
- Author
- Paul Hensgen phens.nosp@m.gen@.nosp@m.techi.nosp@m.e.co.nosp@m.m Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org
◆ ObjectType
Enumerator |
---|
ot_Unknown | |
ot_UMLObject | |
ot_Actor | |
ot_UseCase | |
ot_Package | |
ot_Interface | |
ot_Datatype | |
ot_Enum | |
ot_Class | |
ot_Instance | |
ot_Association | |
ot_Attribute | |
ot_Operation | |
ot_EnumLiteral | |
ot_Template | |
ot_Component | |
ot_Artifact | |
ot_Node | |
ot_Stereotype | |
ot_Role | |
ot_Entity | |
ot_EntityAttribute | |
ot_Folder | |
ot_EntityConstraint | |
ot_UniqueConstraint | |
ot_ForeignKeyConstraint | |
ot_CheckConstraint | |
ot_Category | |
ot_Port | |
ot_InstanceAttribute | |
ot_SubSystem | no real object type
|
◆ UMLObject() [1/4]
UMLObject::UMLObject |
( |
const UMLObject & |
other | ) |
|
|
explicit |
Creates a UMLObject.
- Parameters
-
other | object to created from |
◆ UMLObject() [2/4]
Creates a UMLObject.
- Parameters
-
parent | The parent of the object. |
name | The name of the object. |
id | The ID of the object (optional.) If omitted then a new ID will be assigned internally. |
◆ UMLObject() [3/4]
Creates a UMLObject.
- Parameters
-
parent | The parent of the object. |
◆ UMLObject() [4/4]
Creates a UMLObject.
- Parameters
-
name | The name of the object. |
id | The ID of the object (optional.) If omitted then a new ID will be assigned internally. |
◆ ~UMLObject()
UMLObject::~UMLObject |
( |
| ) |
|
|
virtual |
◆ acceptAssociationType()
This should be reimplemented by subclasses if they wish to accept certain types of associations. Note that this only tells if this UMLObject can accept the association type. When creating an association another check is made to see if the association is valid. For example a UMLClass (UMLClassifier) can accept generalizations and should return true. If while creating a generalization the superclass is already subclassed from this, the association is not valid and will not be created. The default accepts nothing (returns false)
Reimplemented in UMLClassifier.
◆ asUMLActor() [1/2]
◆ asUMLActor() [2/2]
const UMLActor * UMLObject::asUMLActor |
( |
| ) |
const |
◆ asUMLArtifact() [1/2]
◆ asUMLArtifact() [2/2]
◆ asUMLAssociation() [1/2]
◆ asUMLAssociation() [2/2]
◆ asUMLAttribute() [1/2]
◆ asUMLAttribute() [2/2]
◆ asUMLCanvasObject() [1/2]
◆ asUMLCanvasObject() [2/2]
◆ asUMLCategory() [1/2]
◆ asUMLCategory() [2/2]
◆ asUMLCheckConstraint() [1/2]
◆ asUMLCheckConstraint() [2/2]
◆ asUMLClassifier() [1/2]
◆ asUMLClassifier() [2/2]
◆ asUMLClassifierListItem() [1/2]
◆ asUMLClassifierListItem() [2/2]
◆ asUMLClassifierSet() [1/2]
◆ asUMLClassifierSet() [2/2]
◆ asUMLComponent() [1/2]
◆ asUMLComponent() [2/2]
◆ asUMLDatatype() [1/2]
◆ asUMLDatatype() [2/2]
◆ asUMLEntity() [1/2]
◆ asUMLEntity() [2/2]
const UMLEntity * UMLObject::asUMLEntity |
( |
| ) |
const |
◆ asUMLEntityAttribute() [1/2]
◆ asUMLEntityAttribute() [2/2]
◆ asUMLEntityConstraint() [1/2]
◆ asUMLEntityConstraint() [2/2]
◆ asUMLEnum() [1/2]
◆ asUMLEnum() [2/2]
const UMLEnum * UMLObject::asUMLEnum |
( |
| ) |
const |
◆ asUMLEnumLiteral() [1/2]
◆ asUMLEnumLiteral() [2/2]
◆ asUMLFolder() [1/2]
◆ asUMLFolder() [2/2]
const UMLFolder * UMLObject::asUMLFolder |
( |
| ) |
const |
◆ asUMLForeignKeyConstraint() [1/2]
◆ asUMLForeignKeyConstraint() [2/2]
◆ asUMLInstance() [1/2]
◆ asUMLInstance() [2/2]
◆ asUMLInstanceAttribute() [1/2]
◆ asUMLInstanceAttribute() [2/2]
◆ asUMLNode() [1/2]
◆ asUMLNode() [2/2]
const UMLNode * UMLObject::asUMLNode |
( |
| ) |
const |
◆ asUMLObject() [1/2]
◆ asUMLObject() [2/2]
const UMLObject * UMLObject::asUMLObject |
( |
| ) |
const |
◆ asUMLOperation() [1/2]
◆ asUMLOperation() [2/2]
◆ asUMLPackage() [1/2]
◆ asUMLPackage() [2/2]
const UMLPackage * UMLObject::asUMLPackage |
( |
| ) |
const |
◆ asUMLPort() [1/2]
◆ asUMLPort() [2/2]
const UMLPort * UMLObject::asUMLPort |
( |
| ) |
const |
◆ asUMLRole() [1/2]
◆ asUMLRole() [2/2]
const UMLRole * UMLObject::asUMLRole |
( |
| ) |
const |
◆ asUMLStereotype() [1/2]
◆ asUMLStereotype() [2/2]
◆ asUMLTemplate() [1/2]
◆ asUMLTemplate() [2/2]
◆ asUMLUniqueConstraint() [1/2]
◆ asUMLUniqueConstraint() [2/2]
◆ asUMLUseCase() [1/2]
◆ asUMLUseCase() [2/2]
const UMLUseCase * UMLObject::asUMLUseCase |
( |
| ) |
const |
◆ baseType()
Returns the type of the object.
- Returns
- Returns the type of the object.
◆ baseTypeStr()
QLatin1String UMLObject::baseTypeStr |
( |
| ) |
const |
- Returns
- The type used for rtti as string.
◆ clone()
Reimplemented in UMLEntityConstraint, UMLClassifierListItem, UMLUseCase, UMLUniqueConstraint, UMLRole, UMLTemplate, UMLStereotype, UMLPort, UMLPackage, UMLOperation, UMLNode, UMLForeignKeyConstraint, UMLFolder, UMLEnumLiteral, UMLEnum, UMLEntityAttribute, UMLEntity, UMLComponent, UMLClassifier, UMLCheckConstraint, UMLCategory, UMLAttribute, UMLAssociation, UMLArtifact, and UMLActor.
◆ copyInto()
void UMLObject::copyInto |
( |
UMLObject * |
lhs | ) |
const |
|
virtual |
Copy the internal presentation of this object into the new object.
Reimplemented in UMLUniqueConstraint, UMLCanvasObject, UMLTemplate, UMLStereotype, UMLPackage, UMLOperation, UMLForeignKeyConstraint, UMLEnumLiteral, UMLEnum, UMLEntityConstraint, UMLEntityAttribute, UMLEntity, UMLClassifierListItem, UMLClassifier, UMLCheckConstraint, UMLCategory, and UMLAttribute.
◆ doc()
QString UMLObject::doc |
( |
| ) |
const |
Returns the documentation for the object.
- Returns
- Returns the documentation for the object.
◆ emitModified
void UMLObject::emitModified |
( |
| ) |
|
|
slot |
Forces the emission of the modified signal. Useful when updating several attributes at a time: you can block the signals, update all atts, and then force the signal.
◆ fullyQualifiedName()
QString UMLObject::fullyQualifiedName |
( |
const QString & |
separator = QString() , |
|
|
bool |
includeRoot = false |
|
) |
| const |
|
virtual |
Returns the fully qualified name, i.e. all package prefixes and then m_name.
- Parameters
-
separator | The separator string to use (optional.) If not given then the separator is chosen according to the currently selected active programming language of import and code generation. |
includeRoot | Whether to prefix the root folder name to the FQN. See UMLDoc::getRootFolder(). Default: false. |
- Returns
- The fully qualified name of this UMLObject.
◆ hasDoc()
bool UMLObject::hasDoc |
( |
| ) |
const |
Returns state of documentation for the object.
- Returns
- false if documentation is empty
◆ id()
Returns the ID of the object.
- Returns
- Returns the ID of the object.
◆ init()
Initializes key variables of the class.
◆ isAbstract()
bool UMLObject::isAbstract |
( |
| ) |
const |
Returns the abstract state of the object.
◆ isStatic()
bool UMLObject::isStatic |
( |
| ) |
const |
Returns true if this UMLObject has classifier scope, otherwise false (the default).
◆ isUMLActor()
bool UMLObject::isUMLActor |
( |
| ) |
const |
|
inline |
◆ isUMLArtifact()
bool UMLObject::isUMLArtifact |
( |
| ) |
const |
|
inline |
◆ isUMLAssociation()
bool UMLObject::isUMLAssociation |
( |
| ) |
const |
|
inline |
◆ isUMLAttribute()
bool UMLObject::isUMLAttribute |
( |
| ) |
const |
|
inline |
◆ isUMLCategory()
bool UMLObject::isUMLCategory |
( |
| ) |
const |
|
inline |
◆ isUMLCheckConstraint()
bool UMLObject::isUMLCheckConstraint |
( |
| ) |
const |
|
inline |
◆ isUMLClassifier()
bool UMLObject::isUMLClassifier |
( |
| ) |
const |
|
inline |
◆ isUMLComponent()
bool UMLObject::isUMLComponent |
( |
| ) |
const |
|
inline |
◆ isUMLDatatype()
bool UMLObject::isUMLDatatype |
( |
| ) |
const |
|
inline |
◆ isUMLEntity()
bool UMLObject::isUMLEntity |
( |
| ) |
const |
|
inline |
◆ isUMLEntityAttribute()
bool UMLObject::isUMLEntityAttribute |
( |
| ) |
const |
|
inline |
◆ isUMLEntityConstraint()
bool UMLObject::isUMLEntityConstraint |
( |
| ) |
const |
|
inline |
◆ isUMLEnum()
bool UMLObject::isUMLEnum |
( |
| ) |
const |
|
inline |
◆ isUMLEnumLiteral()
bool UMLObject::isUMLEnumLiteral |
( |
| ) |
const |
|
inline |
◆ isUMLFolder()
bool UMLObject::isUMLFolder |
( |
| ) |
const |
|
inline |
◆ isUMLForeignKeyConstraint()
bool UMLObject::isUMLForeignKeyConstraint |
( |
| ) |
const |
|
inline |
◆ isUMLInstance()
bool UMLObject::isUMLInstance |
( |
| ) |
const |
|
inline |
◆ isUMLInstanceAttribute()
bool UMLObject::isUMLInstanceAttribute |
( |
| ) |
const |
|
inline |
◆ isUMLNode()
bool UMLObject::isUMLNode |
( |
| ) |
const |
|
inline |
◆ isUMLObject()
bool UMLObject::isUMLObject |
( |
| ) |
const |
|
inline |
◆ isUMLOperation()
bool UMLObject::isUMLOperation |
( |
| ) |
const |
|
inline |
◆ isUMLPackage()
bool UMLObject::isUMLPackage |
( |
| ) |
const |
|
inline |
◆ isUMLPort()
bool UMLObject::isUMLPort |
( |
| ) |
const |
|
inline |
◆ isUMLRole()
bool UMLObject::isUMLRole |
( |
| ) |
const |
|
inline |
◆ isUMLStereotype()
bool UMLObject::isUMLStereotype |
( |
| ) |
const |
|
inline |
◆ isUMLTemplate()
bool UMLObject::isUMLTemplate |
( |
| ) |
const |
|
inline |
◆ isUMLUniqueConstraint()
bool UMLObject::isUMLUniqueConstraint |
( |
| ) |
const |
|
inline |
◆ isUMLUseCase()
bool UMLObject::isUMLUseCase |
( |
| ) |
const |
|
inline |
◆ load1()
bool UMLObject::load1 |
( |
QDomElement & |
element | ) |
|
|
protectedvirtual |
Auxiliary to loadFromXMI. This method is usually overridden by child classes. It is responsible for loading the specific XMI structure of the child class.
Reimplemented in UMLUseCase, UMLUniqueConstraint, UMLRole, UMLTemplate, UMLStereotype, UMLPort, UMLPackage, UMLOperation, UMLNode, UMLInstanceAttribute, UMLInstance, UMLForeignKeyConstraint, UMLFolder, UMLEnumLiteral, UMLEnum, UMLEntityAttribute, UMLEntity, UMLDatatype, UMLComponent, UMLClassifier, UMLCheckConstraint, UMLCategory, UMLAttribute, UMLAssociation, UMLArtifact, and UMLActor.
◆ loadFromXMI()
bool UMLObject::loadFromXMI |
( |
QDomElement & |
element | ) |
|
|
virtual |
This method loads the generic parts of the XMI common to most model classes. It is not usually reimplemented by child classes. Instead, it invokes the load() method which implements the loading of the specifics of each child class.
- Parameters
-
element | The QDomElement from which to load. |
◆ loadStereotype()
bool UMLObject::loadStereotype |
( |
QDomElement & |
element | ) |
|
Analyzes the given QDomElement for a reference to a stereotype.
- Parameters
-
element | QDomElement to analyze. |
- Returns
- True if a stereotype reference was found, else false.
◆ maybeSignalObjectCreated()
void UMLObject::maybeSignalObjectCreated |
( |
| ) |
|
|
protected |
◆ modified
void UMLObject::modified |
( |
| ) |
|
|
signal |
◆ name()
QString UMLObject::name |
( |
| ) |
const |
◆ operator==()
◆ package()
QString UMLObject::package |
( |
const QString & |
separator = QString() , |
|
|
bool |
includeRoot = false |
|
) |
| const |
Return the package(s) in which this UMLObject is contained as a text.
- Parameters
-
separator | Separator string for joining together the individual package prefixes (optional.) If no separator is given then the separator of the currently selected language is used. |
includeRoot | Whether to prefix the root folder name. Default: false. |
- Returns
- The UMLObject's enclosing package(s) as a text.
◆ packages()
Return a list of the packages in which this class is embedded. The outermost package is first in the list.
- Parameters
-
includeRoot | Whether to prefix the root folder name. Default: false. |
- Returns
- UMLPackageList of the containing packages.
◆ resolveRef()
bool UMLObject::resolveRef |
( |
| ) |
|
|
virtual |
Resolve referenced objects (if any.) Needs to be called after all UML objects are loaded from file. This needs to be done after all model objects are loaded because some of the xmi.id's might be forward references, i.e. they may identify model objects which were not yet loaded at the point of reference. The default implementation attempts resolution of the m_SecondaryId.
- Returns
- True for success.
Reimplemented in UMLCanvasObject, UMLPackage, UMLOperation, UMLInstance, UMLForeignKeyConstraint, UMLEntity, UMLClassifier, and UMLAssociation.
◆ save1()
void UMLObject::save1 |
( |
QXmlStreamWriter & |
writer, |
|
|
const QString & |
type, |
|
|
const QString & |
tag = QString() |
|
) |
| |
Auxiliary to saveToXMI. Create an XML element with the given tag, and save the XMI attributes that are common to all child classes to the newly created element. This method does not need to be overridden by child classes. It is public because UMLOperation::saveToXMI invokes it for its <Parameter>s (cannot be done with protected access).
- Parameters
-
writer | The QXmlStreamWriter into which to write. |
type | In UML1 mode, it is used as the XML tag. In UML2 mode, it is used as the xmi:type attribute. |
tag | In UML2 mode, it is used as the XML tag. When given the special value "<use_type_as_tag>", the type is used as the XML tag just as in UML1 mode. In this case, no xmi:type attribute is generated. |
◆ save1end()
void UMLObject::save1end |
( |
QXmlStreamWriter & |
writer | ) |
|
|
protected |
Auxiliary to saveToXMI. Save possible stereotype tagged values stored in m_TaggedValues and write the XML end element created in save1().
◆ saveToXMI()
void UMLObject::saveToXMI |
( |
QXmlStreamWriter & |
writer | ) |
|
|
virtual |
Reimplemented in UMLUseCase, UMLUniqueConstraint, UMLRole, UMLTemplate, UMLStereotype, UMLPort, UMLPackage, UMLOperation, UMLNode, UMLInstanceAttribute, UMLInstance, UMLForeignKeyConstraint, UMLFolder, UMLEnumLiteral, UMLEnum, UMLEntityAttribute, UMLEntity, UMLDatatype, UMLComponent, UMLClassifier, UMLCheckConstraint, UMLCategory, UMLAttribute, UMLAssociation, UMLArtifact, and UMLActor.
◆ secondaryFallback()
QString UMLObject::secondaryFallback |
( |
| ) |
const |
Return secondary ID fallback. Required by resolveRef() for imported model files.
◆ secondaryId()
QString UMLObject::secondaryId |
( |
| ) |
const |
◆ setAbstract()
void UMLObject::setAbstract |
( |
bool |
bAbstract | ) |
|
Sets the paste state of the object.
◆ setBaseType()
Set the type of the object.
- Parameters
-
Reimplemented in UMLClassifier.
◆ setDoc()
void UMLObject::setDoc |
( |
const QString & |
d | ) |
|
Sets the documentation for the object.
- Parameters
-
d | The documentation for the object. |
◆ setID()
Assigns a new Id to the object
◆ setName()
void UMLObject::setName |
( |
const QString & |
strName | ) |
|
|
virtual |
◆ setNameCmd()
void UMLObject::setNameCmd |
( |
const QString & |
strName | ) |
|
|
virtual |
Method used by setName: it is called by cmdSetName, Don't use it!
Reimplemented in UMLClassifier.
◆ setSecondaryFallback()
void UMLObject::setSecondaryFallback |
( |
const QString & |
id | ) |
|
◆ setSecondaryId()
void UMLObject::setSecondaryId |
( |
const QString & |
id | ) |
|
Set the secondary ID. Currently only required by petalTree2Uml(); all other setting of the m_SecondaryID is internal to the UMLObject class hierarchy.
◆ setStatic()
void UMLObject::setStatic |
( |
bool |
bStatic | ) |
|
Sets the value for m_bStatic.
◆ setStereotype()
void UMLObject::setStereotype |
( |
const QString & |
name | ) |
|
Sets the classes stereotype name. Internally uses setUMLStereotype().
- Parameters
-
name | Sets the classes stereotype name. |
◆ setStereotypeCmd()
void UMLObject::setStereotypeCmd |
( |
const QString & |
_name | ) |
|
◆ setUMLPackage()
Sets the UMLPackage in which this class is located.
- Parameters
-
◆ setUMLParent()
void UMLObject::setUMLParent |
( |
UMLObject * |
parent | ) |
|
Set UML model parent.
- Parameters
-
parent | object to set as parent |
TODO prevent setting parent to myself
◆ setUMLStereotype()
Sets the class' UMLStereotype. Adjusts the reference counts at the previously set stereotype and at the new stereotype. If the previously set UMLStereotype's reference count drops to zero then the UMLStereotype is removed at the UMLDoc and it is then physically deleted.
- Parameters
-
◆ setVisibility()
Sets the visibility of the object.
- Parameters
-
visibility | The visibility of the object. |
◆ setVisibilityCmd()
Method used by setVisibility: it is called by cmdSetVisibility, Don't use it!
◆ showPropertiesDialog()
bool UMLObject::showPropertiesDialog |
( |
QWidget * |
parent = 0 | ) |
|
|
virtual |
Display the properties configuration dialog for the object.
- Parameters
-
- Returns
- True for success of this operation.
Reimplemented in UMLUniqueConstraint, UMLRole, UMLOperation, UMLInstanceAttribute, UMLForeignKeyConstraint, UMLEnumLiteral, UMLEntityAttribute, UMLCheckConstraint, UMLAttribute, UMLAssociation, UMLTemplate, UMLStereotype, UMLInstance, and UMLFolder.
◆ stereotype()
QString UMLObject::stereotype |
( |
bool |
includeAdornments = false | ) |
const |
◆ tags()
QStringList & UMLObject::tags |
( |
| ) |
|
Returns the concrete values of stereotype attributes.
◆ toI18nString()
Returns the given object type value as localized string.
- Parameters
-
t | ObjectType of which a string representation is wanted |
- Returns
- the ObjectType as localized string
◆ toIcon()
Returns the given object type value as icon type.
- Parameters
-
t | ObjectType of which an icon type is wanted |
- Returns
- the ObjectType as icon type
◆ toString()
Helper function for debug output. Returns the given enum value as string.
- Parameters
-
ot | ObjectType of which a string representation is wanted |
- Returns
- the ObjectType as string
◆ umlPackage()
◆ umlParent()
Return UML model parent.
Model classes of type UMLClassifierListItem and below uses QObject::parent to hold the model parent
- Returns
- parent of uml object
◆ umlStereotype()
◆ visibility()
Returns the visibility of the object.
- Returns
- Returns the visibility of the object.
◆ ObjectsModel
◆ operator<<
QDebug operator<< |
( |
QDebug |
out, |
|
|
const UMLObject & |
obj |
|
) |
| |
|
friend |
Print UML Object to debug output stream, so it can be used like uDebug() << "This object shouldn't be here: " << illegalObject;
◆ m_bAbstract
bool UMLObject::m_bAbstract |
|
protected |
state of whether the object is abstract or not
◆ m_BaseType
◆ m_bCreationWasSignalled
bool UMLObject::m_bCreationWasSignalled |
|
protected |
◆ m_bStatic
bool UMLObject::m_bStatic |
|
protected |
◆ m_d
◆ m_Doc
◆ m_name
QString UMLObject::m_name |
|
protected |
◆ m_nId
◆ m_pSecondary
pointer to an associated object Only a few of the classes inheriting from UMLObject use this. However, it needs to be here because of inheritance graph disjunctness.
◆ m_pStereotype
stereotype of the object if applicable
◆ m_SecondaryFallback
QString UMLObject::m_SecondaryFallback |
|
protected |
Last-chance backup for when m_SecondaryId is not found. Used by Rose import: MDL files specify both a "quidu" (which corresponds to m_SecondaryId) and the human readable fully qualified target name of a reference. In case the quidu is not found, the human readable name is used which we store in m_SecondaryFallback.
◆ m_SecondaryId
QString UMLObject::m_SecondaryId |
|
protected |
xmi.id of the secondary object for intermediate use during loading. The secondary ID is resolved to the m_pSecondary in the course of resolveRef() at the end of loading.
◆ m_TaggedValues
QStringList UMLObject::m_TaggedValues |
|
protected |
◆ m_visibility
The documentation for this class was generated from the following files: