UMLClassifier Class Reference
This class defines the non-graphical information required for a UML Classifier (ie a class or interface). Information for a non-graphical Concept/Class. More...
#include <classifier.h>
Inheritance diagram for UMLClassifier:

Public Types | |
| enum | ClassifierType { ALL = 0, CLASS, INTERFACE, DATATYPE } |
| Enumeration identifying the type of classifier. More... | |
Signals | |
| void | operationAdded (UMLClassifierListItem *) |
| Signals that a new UMLOperation has been added to the classifer. | |
| void | operationRemoved (UMLClassifierListItem *) |
| Signals that a UMLOperation has been removed from the classifer. | |
| void | templateAdded (UMLClassifierListItem *) |
| void | templateRemoved (UMLClassifierListItem *) |
| void | attributeAdded (UMLClassifierListItem *) |
| void | attributeRemoved (UMLClassifierListItem *) |
Public Member Functions | |
| UMLClassifier (const QString &name="", Uml::IDType id=Uml::id_None) | |
| Sets up a Concept. | |
| virtual | ~UMLClassifier () |
| Standard deconstructor. | |
| bool | operator== (UMLClassifier &rhs) |
| Overloaded '==' operator. | |
| virtual void | copyInto (UMLClassifier *rhs) const |
| Copy the internal presentation of this object into the new object. | |
| UMLObject * | clone () const |
| Make a clone of this object. | |
| virtual UMLAttribute * | createAttribute (const QString &name=QString::null, UMLObject *type=0, Uml::Visibility vis=Uml::Visibility::Private, const QString &init=QString::null) |
| Creates an attribute for the class. | |
| UMLAttribute * | addAttribute (const QString &name, Uml::IDType id=Uml::id_None) |
| Adds an attribute to the class. | |
| UMLAttribute * | addAttribute (const QString &name, UMLObject *type, Uml::Visibility scope) |
| bool | addAttribute (UMLAttribute *Att, IDChangeLog *Log=0, int position=-1) |
| Adds an already created attribute. | |
| int | removeAttribute (UMLAttribute *a) |
| Removes an attribute from the class. | |
| int | attributes () |
| Returns the number of attributes for the class. | |
| UMLAttributeList | getAttributeList () |
| Returns the attributes. | |
| UMLOperation * | createOperation (const QString &name=QString::null, bool *isExistingOp=NULL, Model_Utils::NameAndType_List *params=NULL) |
| Creates an operation in the current document. | |
| bool | addOperation (UMLOperation *Op, int position=-1) |
| Adds an operation to the classifier, at the given position. | |
| bool | addOperation (UMLOperation *Op, IDChangeLog *Log) |
| Appends an operation to the classifier. | |
| UMLOperation * | checkOperationSignature (const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=NULL) |
| Checks whether an operation is valid based on its signature - An operation is "valid" if the operation's name and parameter list are unique in the classifier. | |
| int | removeOperation (UMLOperation *op) |
| Remove an operation from the Classifier. | |
| int | operations () |
| counts the number of operations in the Classifier. | |
| UMLOperationList | getOpList (bool includeInherited=false) |
| Return a list of operations for the Classifier. | |
| UMLObject * | createTemplate (const QString &name=QString::null) |
| Creates a template for the concept. | |
| UMLTemplate * | addTemplate (const QString &name, Uml::IDType id=Uml::id_None) |
| Adds a template to the class if it is not there yet. | |
| bool | addTemplate (UMLTemplate *newTemplate, IDChangeLog *log=0) |
| Adds an already created template. | |
| bool | addTemplate (UMLTemplate *Template, int position) |
| Adds an template to the class. | |
| int | removeTemplate (UMLTemplate *umltemplate) |
| Removes a template from the class. | |
| UMLTemplate * | findTemplate (const QString &name) |
| Seeks the template parameter of the given name. | |
| int | templates () |
| Returns the number of templates for the class. | |
| UMLTemplateList | getTemplateList () |
| Returns the templates. | |
| int | takeItem (UMLClassifierListItem *item) |
| Take and return a subordinate item from this classifier. | |
| UMLClassifierListItemList | getFilteredList (Uml::Object_Type ot) |
| Returns the entries in m_List that are of the requested type. | |
| virtual bool | resolveRef () |
| Needs to be called after all UML objects are loaded from file. | |
| UMLOperationList | findOperations (const QString &n) |
| Find a list of operations with the given name. | |
| virtual UMLObject * | findChildObjectById (Uml::IDType id, bool considerAncestors=false) |
| Find an attribute, operation, association or template. | |
| UMLOperation * | findOperation (const QString &name, Model_Utils::NameAndType_List params) |
| Find an operation of the given name and parameter signature. | |
| UMLClassifierList | findSuperClassConcepts (ClassifierType type=ALL) |
| Returns a list of concepts which this concept inherits from. | |
| UMLClassifierList | findSubClassConcepts (ClassifierType type=ALL) |
| Returns a list of concepts which inherit from this concept. | |
| virtual bool | acceptAssociationType (Uml::Association_Type) |
| reimplemented from UMLObject | |
| void | setClassAssoc (UMLAssociation *assoc) |
| Sets the UMLAssociation for which this class shall act as an association class. | |
| UMLAssociation * | getClassAssoc () |
| Returns the UMLAssociation for which this class acts as an association class. | |
| void | setBaseType (Uml::Object_Type ot) |
| Reimplementation of method from class UMLObject for controlling the exact type of this classifier: class, interface, or datatype. | |
| bool | isInterface () const |
| Returns true if this classifier represents an interface. | |
| bool | isDatatype () const |
| Returns true if this classifier represents a datatype. | |
| void | setOriginType (UMLClassifier *origType) |
| Set the origin type (in case of e.g. | |
| UMLClassifier * | originType () |
| Get the origin type (in case of e.g. | |
| void | setIsReference (bool isRef=true) |
| Set the m_isRef flag (true when dealing with a pointer type). | |
| bool | isReference () |
| Get the m_isRef flag. | |
| bool | hasAbstractOps () |
| Return true if this classifier has abstract operations. | |
| UMLClassifierListItem * | makeChildObject (const QString &xmiTag) |
| Create a new ClassifierListObject (attribute, operation, template) according to the given XMI tag. | |
| virtual UMLAssociationList | getUniAssociationToBeImplemented () |
| Return the list of unidirectional association that should show up in the code. | |
Protected Member Functions | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| Auxiliary to saveToXMI of inheriting classes: Saves template parameters to the given QDomElement. | |
| virtual bool | load (QDomElement &element) |
| Auxiliary to loadFromXMI: The loading of operations is implemented here. | |
Detailed Description
This class defines the non-graphical information required for a UML Classifier (ie a class or interface). Information for a non-graphical Concept/Class.This class inherits from UMLPackage which allows classifiers to also act as namespaces, i.e. it allows classifiers to nest.
- Author:
- Paul Hensgen <phensgen@techie.com> Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 38 of file classifier.h.
Member Enumeration Documentation
|
|
Enumeration identifying the type of classifier.
Definition at line 45 of file classifier.h. |
Constructor & Destructor Documentation
|
||||||||||||
|
Sets up a Concept.
Definition at line 42 of file classifier.cpp. References UMLPackage::init(). Referenced by clone(). |
|
|
Standard deconstructor.
Definition at line 48 of file classifier.cpp. |
Member Function Documentation
|
|
Overloaded '==' operator.
Definition at line 420 of file classifier.cpp. References UMLCanvasObject::operator==(). Referenced by UMLEnum::operator==(), and UMLEntity::operator==(). |
|
|
Copy the internal presentation of this object into the new object.
Definition at line 433 of file classifier.cpp. References UMLObjectList::copyInto(), UMLCanvasObject::copyInto(), and UMLObject::setBaseType(). Referenced by clone(), UMLEnum::copyInto(), and UMLEntity::copyInto(). |
|
|
Make a clone of this object.
Reimplemented from UMLPackage. Reimplemented in UMLEntity, and UMLEnum. Definition at line 441 of file classifier.cpp. References clone(), copyInto(), and UMLClassifier(). Referenced by clone(). |
|
||||||||||||||||||||
|
Creates an attribute for the class.
Definition at line 498 of file classifier.cpp. References addAttribute(), UMLCanvasObject::findChildObject(), UMLApp::getDocument(), UMLObject::getName(), UMLDoc::signalUMLObjectCreated(), and UMLCanvasObject::uniqChildName(). Referenced by UMLListView::createChildUMLObject(), and UMLListView::moveObject(). |
|
||||||||||||
|
Adds an attribute to the class. If an attribute of the given name already exists, then returns the existing attribute instead of creating a new one.
Definition at line 542 of file classifier.cpp. References UMLObject::emitModified(), UMLObject::getBaseType(), UMLObject::getName(), and UMLObject::modified(). Referenced by createAttribute(), and load(). |
|
||||||||||||||||
|
Adds an already created attribute. The attribute object must not belong to any other concept.
Definition at line 571 of file classifier.cpp. References UMLObject::emitModified(), UMLCanvasObject::findChildObject(), and UMLObject::modified(). |
|
|
Removes an attribute from the class.
Definition at line 591 of file classifier.cpp. References UMLObject::emitModified(). Referenced by UMLDoc::removeUMLObject(). |
|
|
Returns the number of attributes for the class.
Definition at line 313 of file classifier.cpp. References getFilteredList(). Referenced by ListPopupMenu::ListPopupMenu(). |
|
|
Returns the attributes. Same as UMLClassifier::getFilteredList(ot_Attribute) but return type is a true UMLAttributeList.
Definition at line 318 of file classifier.cpp. References UMLObject::getBaseType(). Referenced by UMLView::createAutoAttributeAssociations(), getUniAssociationToBeImplemented(), ClassifierCodeDocument::initCodeClassFields(), and IDLWriter::writeClass(). |
|
||||||||||||||||
|
Creates an operation in the current document. The new operation is initialized with name, id, etc. If a method with the given profile already exists in the classifier, no new method is created and the existing operation is returned. If no name is provided, or if the params are NULL, an Operation Dialog is shown to ask the user for a name and parameters. The operation's signature is checked for validity within the parent classifier.
Definition at line 164 of file classifier.cpp. References addOperation(), UMLOperation::addParm(), checkOperationSignature(), findOperation(), UMLApp::getDocument(), UMLObject::getName(), UMLOperation::getParmList(), Model_Utils::NameAndType::m_direction, Model_Utils::NameAndType::m_initialValue, Model_Utils::NameAndType::m_name, Model_Utils::NameAndType::m_type, UMLObject::setName(), UMLAttribute::setParmKind(), UMLDoc::signalUMLObjectCreated(), and UMLCanvasObject::uniqChildName(). Referenced by UMLListView::createChildUMLObject(), UMLListView::moveObject(), and FloatingTextWidget::showOpDlg(). |
|
||||||||||||
|
Adds an operation to the classifier, at the given position. If position is negative or too large, the attribute is added to the end of the list. The Classifier first checks and only adds the Operation if the signature does not conflict with exising operations
Definition at line 219 of file classifier.cpp. References checkOperationSignature(), UMLObject::emitModified(), getFilteredList(), UMLObject::getName(), UMLObject::modified(), and operationAdded(). Referenced by addOperation(), createOperation(), and load(). |
|
||||||||||||
|
Appends an operation to the classifier.
Definition at line 251 of file classifier.cpp. References addOperation(), and UMLObject::getID(). |
|
||||||||||||||||
|
Checks whether an operation is valid based on its signature - An operation is "valid" if the operation's name and parameter list are unique in the classifier.
Definition at line 95 of file classifier.cpp. References findOperations(), and UMLOperation::getParmList(). Referenced by addOperation(), UMLOperationDialog::apply(), createOperation(), and Import_Utils::insertMethod(). |
|
|
Remove an operation from the Classifier. The operation is not deleted so the caller is responsible for what happens to it after this.
Definition at line 260 of file classifier.cpp. References UMLObject::emitModified(), UMLObject::modified(), and operationRemoved(). Referenced by UMLDoc::removeUMLObject(), and takeItem(). |
|
|
counts the number of operations in the Classifier.
Definition at line 622 of file classifier.cpp. References getOpList(). |
|
|
Return a list of operations for the Classifier.
Definition at line 626 of file classifier.cpp. References findSuperClassConcepts(), UMLObject::getBaseType(), UMLObject::getName(), and UMLOperation::toString(). Referenced by hasAbstractOps(), operations(), saveToXMI(), and CPPHeaderCodeDocument::updateContent(). |
|
|
Creates a template for the concept.
Definition at line 279 of file classifier.cpp. References addTemplate(), UMLCanvasObject::findChildObject(), UMLApp::getDocument(), UMLObject::getName(), UMLDoc::signalUMLObjectCreated(), and UMLCanvasObject::uniqChildName(). Referenced by UMLListView::createChildUMLObject(). |
|
||||||||||||
|
Adds a template to the class if it is not there yet.
Definition at line 672 of file classifier.cpp. References UMLObject::emitModified(), findTemplate(), and UMLObject::modified(). Referenced by createTemplate(), load(), and JavaImport::parseStmt(). |
|
||||||||||||
|
Adds an already created template. The template object must not belong to any other concept.
Definition at line 684 of file classifier.cpp. References UMLObject::emitModified(), UMLCanvasObject::findChildObject(), UMLObject::getName(), and UMLObject::modified(). |
|
||||||||||||
|
Adds an template to the class. The template object must not belong to any other class.
Definition at line 701 of file classifier.cpp. References UMLObject::emitModified(), UMLCanvasObject::findChildObject(), UMLObject::getName(), and UMLObject::modified(). |
|
|
Removes a template from the class.
Definition at line 720 of file classifier.cpp. References UMLObject::emitModified(), and UMLObject::modified(). Referenced by UMLDoc::removeUMLObject(). |
|
|
Seeks the template parameter of the given name.
Definition at line 732 of file classifier.cpp. References getTemplateList(). Referenced by Import_Utils::addMethodParameter(), addTemplate(), UMLOperationDialog::apply(), and UMLAttributeDialog::apply(). |
|
|
Returns the number of templates for the class.
Definition at line 741 of file classifier.cpp. References getFilteredList(). |
|
|
Returns the templates. Same as UMLClassifier::getFilteredList(ot_Template) but return type is a true UMLTemplateList.
Definition at line 746 of file classifier.cpp. References UMLObject::getBaseType(). Referenced by ClassifierWidget::calculateTemplatesBoxSize(), ClassifierWidget::draw(), findTemplate(), and ParmPropDlg::ParmPropDlg(). |
|
|
Take and return a subordinate item from this classifier. Ownership of the item is passed to the caller.
Definition at line 757 of file classifier.cpp. References UMLObject::getBaseType(), UMLObject::getName(), UMLObject::modified(), removeOperation(), UMLEntity::signalEntityAttributeRemoved(), and UMLEnum::signalEnumLiteralRemoved(). Referenced by UMLListView::moveObject(). |
|
|
Returns the entries in m_List that are of the requested type. If the requested type is Uml::ot_UMLObject then all entries are returned.
Definition at line 659 of file classifier.cpp. References UMLObject::getBaseType(). Referenced by addOperation(), UMLDoc::assignNewIDs(), attributes(), EnumWidget::calculateSize(), EntityWidget::calculateSize(), ClassifierWidget::calculateSize(), UMLListViewItem::compare(), ClassifierWidget::displayedMembers(), EnumWidget::draw(), EntityWidget::draw(), ClassifierWidget::drawMembers(), UMLEntity::entityAttributes(), UMLEnum::saveToXMI(), UMLEntity::saveToXMI(), saveToXMI(), UMLOperationDialog::setupDialog(), UMLListView::slotObjectCreated(), templates(), CPPHeaderCodeDocument::updateContent(), PascalWriter::writeClass(), and AdaWriter::writeClass(). |
|
|
Needs to be called after all UML objects are loaded from file. Calls the parent resolveRef(), and calls resolveRef() on all UMLClassifierListItems. Overrides the method from UMLObject.
Reimplemented from UMLPackage. Reimplemented in UMLEntity. Definition at line 447 of file classifier.cpp. References UMLObject::getBaseType(), operationAdded(), UMLObject::resolveRef(), and UMLPackage::resolveRef(). Referenced by UMLEntity::resolveRef(). |
|
|
Find a list of operations with the given name.
Definition at line 329 of file classifier.cpp. References UMLApp::activeLanguageIsCaseSensitive(), UMLObject::getBaseType(), and UMLObject::getName(). Referenced by checkOperationSignature(), and findOperation(). |
|
||||||||||||
|
Find an attribute, operation, association or template.
Reimplemented from UMLCanvasObject. Definition at line 347 of file classifier.cpp. References UMLCanvasObject::findChildObjectById(), and findSuperClassConcepts(). Referenced by MessageWidget::activate(), and UMLListView::createItem(). |
|
||||||||||||
|
Find an operation of the given name and parameter signature.
Definition at line 132 of file classifier.cpp. References findOperations(), UMLObject::getName(), and UMLOperation::getParmList(). Referenced by createOperation(). |
|
|
Returns a list of concepts which this concept inherits from.
Definition at line 391 of file classifier.cpp. References UMLObject::getID(), UMLCanvasObject::getRealizations(), UMLCanvasObject::getSuperClasses(), and isInterface(). Referenced by findChildObjectById(), getOpList(), FloatingTextWidget::showOpDlg(), and CPPHeaderCodeDocument::updateContent(). |
|
|
Returns a list of concepts which inherit from this concept.
Definition at line 362 of file classifier.cpp. References UMLObject::getID(), UMLCanvasObject::getRealizations(), UMLCanvasObject::getSubClasses(), and isInterface(). |
|
|
reimplemented from UMLObject
Reimplemented from UMLObject. Definition at line 477 of file classifier.cpp. |
|
|
Sets the UMLAssociation for which this class shall act as an association class.
Definition at line 606 of file classifier.cpp. Referenced by ClassifierWidget::setClassAssocWidget(). |
|
|
Returns the UMLAssociation for which this class acts as an association class. Returns NULL if this class does not act as an association class. Definition at line 610 of file classifier.cpp. |
|
|
Reimplementation of method from class UMLObject for controlling the exact type of this classifier: class, interface, or datatype.
Reimplemented from UMLObject. Definition at line 57 of file classifier.cpp. References UMLListView::changeIconOf(), UMLApp::getListView(), and UMLObject::setStereotype(). Referenced by ClassifierWidget::changeToClass(), ClassifierWidget::changeToInterface(), UMLListView::createUMLObject(), JavaImport::parseStmt(), and Import_Rose::umbrellify(). |
|
|
Returns true if this classifier represents an interface.
Definition at line 87 of file classifier.cpp. Referenced by findSubClassConcepts(), findSuperClassConcepts(), JavaImport::parseStmt(), and ClassifierWidget::saveToXMI(). |
|
|
Returns true if this classifier represents a datatype.
Definition at line 91 of file classifier.cpp. |
|
|
Set the origin type (in case of e.g. typedef) Definition at line 826 of file classifier.cpp. Referenced by Import_Utils::createUMLObject(). |
|
|
Get the origin type (in case of e.g. typedef) Definition at line 830 of file classifier.cpp. Referenced by UMLView::createAutoAttributeAssociations(). |
|
|
Set the m_isRef flag (true when dealing with a pointer type).
Definition at line 834 of file classifier.cpp. Referenced by Import_Utils::createUMLObject(). |
|
|
Get the m_isRef flag.
Definition at line 838 of file classifier.cpp. |
|
|
Return true if this classifier has abstract operations.
Definition at line 614 of file classifier.cpp. References UMLObject::getAbstract(), and getOpList(). |
|
|
Create a new ClassifierListObject (attribute, operation, template) according to the given XMI tag. Returns NULL if the string given does not contain one of the tags <UML:Attribute>, <UML:Operation>, or <UML:TemplateParameter>. Used by the clipboard for paste operation. Definition at line 942 of file classifier.cpp. References UMLObject::getBaseType(), and Uml::tagEq(). Referenced by load(). |
|
|
Return the list of unidirectional association that should show up in the code.
Definition at line 842 of file classifier.cpp. References getAttributeList(), UMLObject::getID(), UMLAssociation::getObjectId(), UMLAssociation::getRoleName(), and UMLCanvasObject::getSpecificAssocs(). |
|
|
Signals that a new UMLOperation has been added to the classifer.
Referenced by addOperation(), and resolveRef(). |
|
|
Signals that a UMLOperation has been removed from the classifer.
Referenced by removeOperation(). |
|
||||||||||||
|
Auxiliary to saveToXMI of inheriting classes: Saves template parameters to the given QDomElement.
Reimplemented from UMLPackage. Reimplemented in UMLEntity, and UMLEnum. Definition at line 869 of file classifier.cpp. References getFilteredList(), UMLObject::getID(), getOpList(), UMLCanvasObject::getSpecificAssocs(), UMLObject::save(), and UMLObject::saveToXMI(). |
|
|
Auxiliary to loadFromXMI: The loading of operations is implemented here. Calls loadSpecialized() for any other tag. Child classes can override the loadSpecialized method to load its additional tags. Reimplemented from UMLPackage. Reimplemented in UMLEntity, and UMLEnum. Definition at line 956 of file classifier.cpp. References addAttribute(), addOperation(), addTemplate(), UMLObject::getBaseType(), UMLApp::getDocument(), UMLObject::loadFromXMI(), makeChildObject(), UMLPackage::removeObject(), UMLObject::setUMLPackage(), and Uml::tagEq(). |
The documentation for this class was generated from the following files:
