• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codegenerators
codeclassfield.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
8  * copyright (C) 2004-2013 *
9  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10  ***************************************************************************/
11 
12 // own header
13 #include "codeclassfield.h"
14 
15 // app includes
16 #include "attribute.h"
17 #include "association.h"
18 #include "classifiercodedocument.h"
19 #include "codegenerator.h"
20 #include "codegenerators/codegenfactory.h"
21 #include "debug_utils.h"
22 #include "umlobject.h"
23 #include "umlrole.h"
24 #include "uml.h"
25 
26 // qt includes
27 #include <QRegExp>
28 
32 CodeClassField::CodeClassField (ClassifierCodeDocument * doc, UMLRole * role)
33  : CodeParameter (doc, (UMLObject*) role)
34 {
35  setParentUMLObject(role);
36  initFields(true);
37 }
38 
42 CodeClassField::CodeClassField (ClassifierCodeDocument * doc, UMLAttribute * attrib)
43  : CodeParameter (doc, (UMLObject*) attrib)
44 {
45  setParentUMLObject(attrib);
46  initFields(true);
47 }
48 
52 CodeClassField::~CodeClassField ()
53 {
54  // remove methods from parent document
55  Q_FOREACH(CodeAccessorMethod *m, m_methodVector)
56  {
57  getParentDocument()->removeTextBlock(m);
58  m->forceRelease();
59  }
60 
61  // clear the decl block from parent text block list too
62  if(m_declCodeBlock)
63  {
64  getParentDocument()->removeTextBlock(m_declCodeBlock);
65  m_declCodeBlock->forceRelease();
66  delete m_declCodeBlock;
67  }
68 
69 }
70 
74 void CodeClassField::setParentUMLObject (UMLObject * obj)
75 {
76  UMLRole *role = dynamic_cast<UMLRole*>(obj);
77  if(role) {
78  UMLAssociation * parentAssoc = role->parentAssociation();
79  Uml::AssociationType::Enum atype = parentAssoc->getAssocType();
80  m_parentIsAttribute = false;
81 
82  if (atype == Uml::AssociationType::Association || atype == Uml::AssociationType::Association_Self)
83  m_classFieldType = PlainAssociation; // Plain == Self + untyped associations
84  else if (atype == Uml::AssociationType::Aggregation)
85  m_classFieldType = Aggregation;
86  else if (atype == Uml::AssociationType::Composition)
87  m_classFieldType = Composition;
88  } else {
89  m_classFieldType = Attribute;
90  m_parentIsAttribute = true;
91  }
92 }
93 
94 QString CodeClassField::getTypeName ()
95 {
96  if (parentIsAttribute())
97  {
98  UMLAttribute * at = (UMLAttribute*) getParentObject();
99  return at->getTypeName();
100  } else {
101  UMLRole * role = (UMLRole*) getParentObject();
102  if(fieldIsSingleValue()) {
103  return getUMLObjectName(role->object());
104  } else {
105  return role->name();
106  }
107  }
108 }
109 
110 // get the type of object that will be added/removed from lists
111 // of objects (as per specification of associations)
112 QString CodeClassField::getListObjectType()
113 {
114  if (!parentIsAttribute())
115  {
116  UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
117  return getUMLObjectName(role->object());
118  }
119  return QString();
120 }
121 
126 bool CodeClassField::parentIsAttribute () const
127 {
128  return m_parentIsAttribute;
129  // return (m_classFieldType == Attribute) ? true : false;
130 }
131 
135 CodeClassField::ClassFieldType CodeClassField::getClassFieldType() const
136 {
137  return m_classFieldType;
138 }
139 
140 /*
141 CodeClassFieldDialog * CodeClassField::getDialog ()
142 {
143  return m_dialog;
144 }
145 */
146 
147 // methods like this _shouldn't_ be needed IF we properly did things thruought the code.
148 QString CodeClassField::getUMLObjectName(UMLObject *obj)
149 {
150  return (obj!=0)?obj->name():QString("NULL");
151 }
152 
156 bool CodeClassField::addMethod (CodeAccessorMethod * add_object)
157 {
158  CodeAccessorMethod::AccessorType type = add_object->getType();
159 
160  if(findMethodByType(type))
161  return false;
162  /*
163  // this wont work as the key for QMap needs to inherit from QObject
164  if(m_methodMap->contains(type))
165  return false; // return false, we already have some object with this tag in the list
166  else
167  m_methodMap->insert(type, add_object);
168  */
169 
170  m_methodVector.append(add_object);
171  return true;
172 }
173 
177 bool CodeClassField::removeMethod (CodeAccessorMethod * remove_object)
178 {
179  // m_methodMap->erase(remove_object->getType());
180  m_methodVector.removeAll(remove_object);
181  getParentDocument()->removeTextBlock(remove_object);
182  return true;
183 }
184 
190 CodeAccessorMethodList CodeClassField::getMethodList() const
191 {
192  return m_methodVector;
193 }
194 
200 bool CodeClassField::getWriteOutMethods () const
201 {
202  return m_writeOutMethods;
203 }
204 
210 void CodeClassField::setWriteOutMethods (bool val)
211 {
212  m_writeOutMethods = val;
213  updateContent();
214 }
215 
220 CodeClassFieldDeclarationBlock * CodeClassField::getDeclarationCodeBlock()
221 {
222  return m_declCodeBlock;
223 }
224 
228 void CodeClassField::loadFromXMI (QDomElement & root)
229 {
230  setAttributesFromNode(root);
231 }
232 
237 void CodeClassField::setAttributesOnNode (QDomDocument & doc, QDomElement & cfElem)
238 {
239  // super class
240  CodeParameter::setAttributesOnNode(doc, cfElem);
241 
242  // now set local attributes/fields
243  cfElem.setAttribute("field_type", m_classFieldType);
244  cfElem.setAttribute("listClassName", m_listClassName);
245  cfElem.setAttribute("writeOutMethods", getWriteOutMethods()?"true":"false");
246 
247  // record tag on declaration codeblock
248  // which we will store in its own separate child node block
249  m_declCodeBlock->saveToXMI(doc, cfElem);
250 
251  // now record the tags on our accessormethods
252  Q_FOREACH(CodeAccessorMethod *method, m_methodVector)
253  {
254  method->saveToXMI(doc, cfElem);
255  }
256 }
257 
262 void CodeClassField::setAttributesFromNode (QDomElement & root)
263 {
264  // always disconnect
265  getParentObject()->disconnect(this);
266 
267  // superclass call.. may reset the parent object
268  CodeParameter::setAttributesFromNode(root);
269 
270  // make AFTER super-class call. This will reconnect to the parent
271  // and re-check we have all needed child accessor methods and decl blocks
272  initFields();
273 
274  setWriteOutMethods(root.attribute("writeOutMethods","true") == "true" ? true : false);
275  m_listClassName = root.attribute("listClassName","");
276  m_classFieldType = (ClassFieldType) root.attribute("field_type","0").toInt();
277 
278  // load accessor methods now
279  // by looking for our particular child element
280  QDomNode node = root.firstChild();
281  QDomElement element = node.toElement();
282  while(!element.isNull()) {
283  QString tag = element.tagName();
284  if(tag == "ccfdeclarationcodeblock") {
285  m_declCodeBlock->loadFromXMI(element);
286  } else
287  if(tag == "codeaccessormethod") {
288  int type = element.attribute("accessType","0").toInt();
289  int role_id = element.attribute("role_id","-1").toInt();
290  CodeAccessorMethod * method = findMethodByType((CodeAccessorMethod::AccessorType) type, role_id);
291  if(method)
292  method->loadFromXMI(element);
293  else
294  uError()<<"Can not load code accessor method for type:"<<type<<" which does not exist in this codeclassfield. Is XMI out-dated or corrupt?";
295 
296  } else
297  if(tag == "header") {
298  // this is treated in parent.. skip over here
299  } else
300  uWarning()<<"ERROR: bad savefile? code classfield loadFromXMI got child element with unknown tag:"<<tag<<" ignoring node.";
301 
302  node = element.nextSibling();
303  element = node.toElement();
304  }
305 }
306 
310 void CodeClassField::saveToXMI (QDomDocument & doc, QDomElement & root)
311 {
312  QDomElement docElement = doc.createElement("codeclassfield");
313 
314  setAttributesOnNode(doc, docElement);
315 
316  root.appendChild(docElement);
317 }
318 
325 int CodeClassField::minimumListOccurances()
326 {
327  if (!parentIsAttribute())
328  {
329  UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
330  QString multi = role->multiplicity();
331  // ush. IF we had a multiplicty object, this would be much easier.
332  if(!multi.isEmpty())
333  {
334  QString lowerBoundString = multi.remove(QRegExp("\\.\\.\\d+$"));
335  if(!lowerBoundString.isEmpty() &&lowerBoundString.contains(QRegExp("^\\d+$")))
336  return lowerBoundString.toInt();
337  }
338 
339  }
340  return 0;
341 }
342 
349 int CodeClassField::maximumListOccurances()
350 {
351  if (!parentIsAttribute())
352  {
353  UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
354  QString multi = role->multiplicity();
355  // ush. IF we had a multiplicty object, this would be much easier.
356  if(!multi.isEmpty())
357  {
358  QString upperBoundString = multi.section(QRegExp("(\\.\\.)"), 1);
359  if(!upperBoundString.isEmpty() && upperBoundString.contains(QRegExp("^\\d+$")))
360  return upperBoundString.toInt();
361  else
362  return -1; // unbounded
363  } else
364  return -1; // unbounded
365 
366  }
367  return 1;
368 }
369 
373 QString CodeClassField::cleanName (const QString &name)
374 {
375  return getParentDocument()->cleanName(name);
376 }
377 
383 QString CodeClassField::fixInitialStringDeclValue(const QString& val, const QString &type)
384 {
385  QString value = val;
386  // check for strings only<F2>String value = val;
387  if (!value.isEmpty() && type == "String") {
388  if (!value.startsWith('"'))
389  value.prepend('"');
390  if (!value.endsWith('"'))
391  value.append('"');
392  }
393  return value;
394 }
395 
400 void CodeClassField::synchronize ()
401 {
402  updateContent();
403  Q_FOREACH(CodeAccessorMethod *method, m_methodVector)
404  method->syncToParent();
405 
406  if(m_declCodeBlock)
407  m_declCodeBlock->syncToParent();
408 }
409 
414 CodeAccessorMethod * CodeClassField::findMethodByType (CodeAccessorMethod::AccessorType type, int role_id)
415 {
416  //if we already know to which file this class was written/should be written, just return it.
417  /*
418  // argh. this wont work because "accessorType' doesn't inherit from QObject.
419  if(m_methodMap->contains(type))
420  return ((*m_methodMap)[type]);
421  CodeAccessorMethod * obj = NULL;
422  */
423  if(role_id > 1 || role_id < 0)
424  {
425  Q_FOREACH(CodeAccessorMethod *m, m_methodVector)
426  if(m->getType() == type)
427  return m;
428  } else {
429  // ugh. forced into this underperforming algorithm because of bad association
430  // design.
431  Q_FOREACH(CodeAccessorMethod *m, m_methodVector)
432  {
433  UMLRole * role = dynamic_cast<UMLRole*>(m->getParentObject());
434  if(!role)
435  uError()<<" FindMethodByType() cant create role for method type:"<<m->getType()<<endl;
436  if(role && m->getType() == type && role->role() == role_id)
437  return m;
438  }
439 
440  }
441 
442  return (CodeAccessorMethod *) NULL;
443 }
444 
445 void CodeClassField::initAccessorMethods()
446 {
447  // everything gets potential get/set method
448  //if(!m_methodMap->contains(CodeAccessorMethod::GET))
449  if(!findMethodByType(CodeAccessorMethod::GET))
450  {
451  CodeAccessorMethod * method = CodeGenFactory::newCodeAccessorMethod (getParentDocument(), this, CodeAccessorMethod::GET);
452  if(method)
453  {
454  method->setType(CodeAccessorMethod::GET);
455  addMethod(method);
456  }
457  }
458 
459  if(!findMethodByType(CodeAccessorMethod::SET))
460  {
461  CodeAccessorMethod * method = CodeGenFactory::newCodeAccessorMethod (getParentDocument(), this, CodeAccessorMethod::SET);
462  if(method) {
463  method->setType(CodeAccessorMethod::SET);
464  addMethod(method);
465  }
466  }
467 
468  // add in the add, remove and list methods for things which are role based.
469  // (and only used if the role specifies a 'list' type object
470  if (!parentIsAttribute()) {
471 
472  if(!findMethodByType(CodeAccessorMethod::ADD))
473  {
474  CodeAccessorMethod * method = CodeGenFactory::newCodeAccessorMethod (getParentDocument(), this, CodeAccessorMethod::ADD);
475  if(method) {
476  method->setType(CodeAccessorMethod::ADD);
477  addMethod(method);
478  }
479  }
480 
481  if(!findMethodByType(CodeAccessorMethod::REMOVE))
482  {
483  CodeAccessorMethod * method = CodeGenFactory::newCodeAccessorMethod (getParentDocument(), this, CodeAccessorMethod::REMOVE);
484  if(method) {
485  method->setType(CodeAccessorMethod::REMOVE);
486  addMethod(method);
487  }
488  }
489 
490  if(!findMethodByType(CodeAccessorMethod::LIST))
491  {
492  CodeAccessorMethod * method = CodeGenFactory::newCodeAccessorMethod (getParentDocument(), this, CodeAccessorMethod::LIST);
493  if(method) {
494  method->setType(CodeAccessorMethod::LIST);
495  addMethod(method);
496  }
497  }
498 
499  }
500 }
501 
506 void CodeClassField::updateContent()
507 {
508  // Set properties for writing out the various methods derived from UMLRoles.
509  // I suppose this could be supported under individual accessor method synctoparent
510  // calls, but it is going to happen again and again for many languages. Why not a catch
511  // all here? -b.t.
512  if (parentIsAttribute())
513  {
514  Q_FOREACH(CodeAccessorMethod *method, m_methodVector)
515  method->setWriteOutText(m_writeOutMethods);
516  return;
517  }
518  UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
519  Uml::Changeability::Enum changeType = role->changeability();
520  bool isSingleValue = fieldIsSingleValue();
521  bool isEmptyRole = role->name().isEmpty() ? true : false;
522 
523  Q_FOREACH(CodeAccessorMethod *method, m_methodVector)
524  {
525 
526  CodeAccessorMethod::AccessorType type = method->getType();
527 
528  // for role-based accessors, we DON'T write ourselves out when
529  // the name of the role is not defined OR when the global flag
530  // to not show ANY methods is set.
531  if(!m_writeOutMethods || isEmptyRole)
532  {
533  method->setWriteOutText(false);
534  continue;
535  }
536 
537  // not to change if no tag (don't know what it is, OR it is not an AutoGenerated method
538  if(method->contentType() != CodeBlock::AutoGenerated)
539  continue;
540 
541  // first off, some accessor methods wont appear if it is a singleValue
542  // role and vice-versa
543  if(isSingleValue)
544  {
545  switch(type) {
546  case CodeAccessorMethod::SET:
547  // SET method true ONLY IF changeability is NOT Frozen
548  if (changeType != Uml::Changeability::Frozen)
549  method->setWriteOutText(true);
550  else
551  method->setWriteOutText(false);
552  break;
553  case CodeAccessorMethod::GET:
554  method->setWriteOutText(true);
555  break;
556  case CodeAccessorMethod::ADD:
557  case CodeAccessorMethod::REMOVE:
558  case CodeAccessorMethod::LIST:
559  default: // list/add/remove always false
560  method->setWriteOutText(false);
561  break;
562  }
563  }
564  else
565  {
566  switch(type) {
567  // get/set always false
568  case CodeAccessorMethod::GET:
569  case CodeAccessorMethod::SET:
570  method->setWriteOutText(false);
571  break;
572  case CodeAccessorMethod::ADD:
573  // ADD method true ONLY IF changeability is NOT Frozen
574  if (changeType != Uml::Changeability::Frozen)
575  method->setWriteOutText(true);
576  else
577  method->setWriteOutText(false);
578  break;
579  case CodeAccessorMethod::REMOVE:
580  // Remove methods ONLY IF changeability is Changeable
581  if (changeType == Uml::Changeability::Changeable)
582  method->setWriteOutText(true);
583  else
584  method->setWriteOutText(false);
585  break;
586  case CodeAccessorMethod::LIST:
587  default:
588  method->setWriteOutText(true);
589  break;
590  }
591  }
592  }
593 }
594 
595 // determine whether the parent object in this classfield indicates that it is
596 // a single variable or a List (Vector). One day this will be done correctly with special
597 // multiplicity object that we don't have to figure out what it means via regex.
598 
604 bool CodeClassField::fieldIsSingleValue ()
605 {
606  // For the time being, all attributes ARE single values (yes,
607  // I know this isnt always true, but we have to start somewhere.)
608  if(parentIsAttribute())
609  return true;
610 
611  UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
612  if(!role)
613  return true; // it is really an attribute
614 
615  QString multi = role->multiplicity();
616 
617  if(multi.isEmpty() || multi.contains(QRegExp("^(0|1)$"))
618  || multi.contains(QRegExp("^0\\.\\.1$")))
619  return true;
620 
621  return false;
622 }
623 
627 void CodeClassField::initFields(bool inConstructor)
628 {
629  m_writeOutMethods = false;
630  m_listClassName.clear();
631  m_declCodeBlock = NULL;
632 
633  // m_methodMap = new QMap<CodeAccessorMethod::AccessorType, CodeAccessorMethod *>;
634 
635  if (!inConstructor)
636  finishInitialization();
637 }
638 
647 void CodeClassField::finishInitialization()
648 {
649  m_declCodeBlock = CodeGenFactory::newDeclarationCodeBlock(getParentDocument(), this);
650  initAccessorMethods();
651  updateContent();
652 
653  connect(getParentObject(), SIGNAL(modified()), this, SIGNAL(modified())); // child objects will trigger off this signal
654 }
655 
656 #include "codeclassfield.moc"
Uml::AssociationType::Aggregation
Definition: basictypes.h:101
CodeAccessorMethod::setType
void setType(AccessorType type)
Set the type of accessor method this is.
Definition: codeaccessormethod.cpp:72
umlobject.h
CodeClassFieldDeclarationBlock::forceRelease
void forceRelease()
So parent can actually release this block.
Definition: codeclassfielddeclarationblock.cpp:65
OwnedCodeBlock::getParentObject
UMLObject * getParentObject()
Get the value of m_parentObject.
Definition: ownedcodeblock.cpp:64
CodeGenFactory::newDeclarationCodeBlock
CodeClassFieldDeclarationBlock * newDeclarationCodeBlock(ClassifierCodeDocument *cd, CodeClassField *cf)
Definition: codegenfactory.cpp:363
UMLRole::multiplicity
QString multiplicity() const
Returns the multiplicity assigned to the role.
Definition: umlrole.cpp:96
association.h
CodeClassField::Attribute
Definition: codeclassfield.h:34
ClassifierCodeDocument
class ClassifierCodeDocument A CodeDocument which represents a UMLClassifier (e.g.
Definition: classifiercodedocument.h:33
CodeAccessorMethod::REMOVE
Definition: codeaccessormethod.h:32
UMLRole::parentAssociation
UMLAssociation * parentAssociation() const
Definition: umlrole.cpp:67
CodeAccessorMethod::saveToXMI
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codeaccessormethod.cpp:110
CodeBlock::AutoGenerated
the content was generated by code generation itself
Definition: codeblock.h:28
umlrole.h
CodeAccessorMethod::getType
AccessorType getType()
Utility method to get the value of the parent object of the parent classifield.
Definition: codeaccessormethod.cpp:64
CodeClassField::modified
void modified()
CodeAccessorMethod::AccessorType
AccessorType
Definition: codeaccessormethod.h:32
CodeClassField::CodeClassField
CodeClassField(ClassifierCodeDocument *parentDoc, UMLAttribute *attrib)
Constructor.
Definition: codeclassfield.cpp:42
CodeClassField::addMethod
bool addMethod(CodeAccessorMethod *add)
Add a Method object to the m_methodVector List.
Definition: codeclassfield.cpp:156
Uml::Changeability::Changeable
Definition: basictypes.h:176
UMLAttribute
This class is used to set up information for an attribute.
Definition: attribute.h:27
CodeClassField::Composition
Definition: codeclassfield.h:34
CodeClassField::updateContent
void updateContent()
Updates the status of the accessor methods as to whether or not they should be written out...
Definition: codeclassfield.cpp:506
CodeBlock::contentType
ContentType contentType() const
Get the value of m_contentType specifies whether the content (text) of this object was generated by t...
Definition: codeblock.cpp:54
uWarning
#define uWarning()
Definition: debug_utils.h:97
CodeClassFieldDeclarationBlock
Used to declare classifier fields (e.g.
Definition: codeclassfielddeclarationblock.h:29
CodeClassField::getClassFieldType
ClassFieldType getClassFieldType() const
Get the type of classfield this is.
Definition: codeclassfield.cpp:135
debug_utils.h
CodeClassField::saveToXMI
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codeclassfield.cpp:310
CodeParameter::getParentDocument
ClassifierCodeDocument * getParentDocument()
Get the parent Code Document.
Definition: codeparameter.cpp:133
CodeClassField::minimumListOccurances
int minimumListOccurances()
Find the minimum number of things that can occur in an association If mistakenly called on attribute ...
Definition: codeclassfield.cpp:325
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
UMLAssociation
This class contains the non-graphic representation of an association.
Definition: association.h:32
CodeClassField::findMethodByType
CodeAccessorMethod * findMethodByType(CodeAccessorMethod::AccessorType type, int role_id=-1)
Utility method to allow finding particular accessor method of this code class field by its type ident...
Definition: codeclassfield.cpp:414
codegenerator.h
CodeClassField::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codeclassfield.cpp:228
CodeAccessorMethod::SET
Definition: codeaccessormethod.h:32
attribute.h
codegenfactory.h
CodeClassField::PlainAssociation
Definition: codeclassfield.h:34
CodeClassField::ClassFieldType
ClassFieldType
Definition: codeclassfield.h:34
CodeGenFactory::newCodeAccessorMethod
CodeAccessorMethod * newCodeAccessorMethod(ClassifierCodeDocument *ccd, CodeClassField *cf, CodeAccessorMethod::AccessorType type)
Definition: codegenfactory.cpp:313
CodeClassField::~CodeClassField
virtual ~CodeClassField()
Empty Destructor.
Definition: codeclassfield.cpp:52
CodeClassField::parentIsAttribute
bool parentIsAttribute() const
Get the value of m_isAbstract.
Definition: codeclassfield.cpp:126
CodeAccessorMethod::LIST
Definition: codeaccessormethod.h:32
UMLAssociation::getAssocType
Uml::AssociationType::Enum getAssocType() const
Returns the AssociationType::Enum of the UMLAssociation.
Definition: association.cpp:103
CodeParameter
class CodeParameter A parameter on some type of code.
Definition: codeparameter.h:25
TextBlock::setWriteOutText
void setWriteOutText(bool write)
Set the value of m_writeOutText Whether or not to include the text of this TextBlock into a file...
Definition: textblock.cpp:131
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:99
CodeClassField::Aggregation
Definition: codeclassfield.h:34
Uml::AssociationType::Association
Definition: basictypes.h:103
CodeClassField::maximumListOccurances
int maximumListOccurances()
Find the maximum number of things that can occur in an association If mistakenly called on attribute ...
Definition: codeclassfield.cpp:349
CodeClassField::setWriteOutMethods
void setWriteOutMethods(bool val)
Determine if we will allow methods to be viewable.
Definition: codeclassfield.cpp:210
CodeAccessorMethod
Definition: codeaccessormethod.h:20
UMLRole::object
UMLObject * object() const
Returns the UMLObject assigned to the role.
Definition: umlrole.cpp:76
CodeAccessorMethod::ADD
Definition: codeaccessormethod.h:32
CodeClassField::synchronize
virtual void synchronize()
Force the synchronization of the content (methods and declarations) of this class field...
Definition: codeclassfield.cpp:400
codeclassfield.h
CodeClassFieldDeclarationBlock::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codeclassfielddeclarationblock.cpp:90
Uml::Changeability::Frozen
Definition: basictypes.h:177
CodeDocument::cleanName
QString cleanName(const QString &name)
A little utility method which calls CodeGenerator::cleanName.
Definition: codedocument.cpp:269
Uml::AssociationType::Composition
Definition: basictypes.h:110
CodeClassField::removeMethod
bool removeMethod(CodeAccessorMethod *remove)
Remove a Method object from m_methodVector List.
Definition: codeclassfield.cpp:177
CodeClassFieldDeclarationBlock::saveToXMI
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codeclassfielddeclarationblock.cpp:80
CodeClassField::cleanName
QString cleanName(const QString &name)
A little utility method to make life easier for code document programmers.
Definition: codeclassfield.cpp:373
CodeClassField::fixInitialStringDeclValue
QString fixInitialStringDeclValue(const QString &val, const QString &type)
Another utility method to make life easier for code document programmers this one fixes the initial d...
Definition: codeclassfield.cpp:383
Uml::Changeability::Enum
Enum
Definition: basictypes.h:175
CodeParameter::setAttributesFromNode
virtual void setAttributesFromNode(QDomElement &element)
Set the class attributes of this object from the passed element node.
Definition: codeparameter.cpp:192
CodeParameter::setAttributesOnNode
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Set attributes of the node that represents this class in the XMI document.
Definition: codeparameter.cpp:166
CodeAccessorMethod::forceRelease
void forceRelease()
A method so the parent code classfield can force code block to release.
Definition: codeaccessormethod.cpp:91
UMLRole
This class contains the non-graphic representation of an association role.
Definition: umlrole.h:24
CodeClassField::getDeclarationCodeBlock
CodeClassFieldDeclarationBlock * getDeclarationCodeBlock()
Return the declaration statement for this class field object.
Definition: codeclassfield.cpp:220
UMLRole::role
Uml::RoleType::Enum role() const
Get the 'id' of the role (NOT the parent object).
Definition: umlrole.cpp:152
CodeClassField::getWriteOutMethods
bool getWriteOutMethods() const
Determine if we will allow methods to be viewable.
Definition: codeclassfield.cpp:200
CodeAccessorMethodList
QList< CodeAccessorMethod * > CodeAccessorMethodList
Definition: codeaccessormethodlist.h:17
CodeGenObjectWithTextBlocks::removeTextBlock
virtual bool removeTextBlock(TextBlock *remove_object)
Remove a TextBlock object from m_textblockVector list.
Definition: codegenobjectwithtextblocks.cpp:95
CodeAccessorMethod::GET
Definition: codeaccessormethod.h:32
CodeClassField::getUMLObjectName
QString getUMLObjectName(UMLObject *obj)
Definition: codeclassfield.cpp:148
uError
#define uError()
Definition: debug_utils.h:96
UMLRole::changeability
Uml::Changeability::Enum changeability() const
Returns the Changeablity of the role.
Definition: umlrole.cpp:86
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
CodeClassField::setParentUMLObject
void setParentUMLObject(UMLObject *obj)
Set the parent UMLobject appropriately.
Definition: codeclassfield.cpp:74
CodeClassField::fieldIsSingleValue
bool fieldIsSingleValue()
Determine whether the parent object in this classfield indicates that it is a single variable or a Li...
Definition: codeclassfield.cpp:604
CodeClassField::getMethodList
CodeAccessorMethodList getMethodList() const
Get the list of Method objects held by m_methodVector.
Definition: codeclassfield.cpp:190
classifiercodedocument.h
Uml::AssociationType::Association_Self
Definition: basictypes.h:104
CodeMethodBlock::syncToParent
virtual void syncToParent()
Definition: codemethodblock.cpp:169
CodeClassField::getListObjectType
QString getListObjectType()
Definition: codeclassfield.cpp:112
CodeClassField::getTypeName
QString getTypeName()
Get the value of m_dialog.
Definition: codeclassfield.cpp:94
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
CodeClassFieldDeclarationBlock::syncToParent
virtual void syncToParent()
Definition: codeclassfielddeclarationblock.cpp:136
CodeParameter::getParentObject
UMLObject * getParentObject()
Get the ParentObject object.
Definition: codeparameter.cpp:141
CodeClassField::finishInitialization
void finishInitialization()
Finish off initializations of the object.
Definition: codeclassfield.cpp:647
uml.h
CodeAccessorMethod::loadFromXMI
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codeaccessormethod.cpp:102
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal