umbrello/umbrello
dcodeaccessormethod.cpp
Go to the documentation of this file.
31 DCodeAccessorMethod::DCodeAccessorMethod (CodeClassField * field, CodeAccessorMethod::AccessorType type)
37 DClassifierCodeDocument* jccd = dynamic_cast<DClassifierCodeDocument*>(field->getParentDocument());
76 text += QLatin1String("if (") + fieldName + QLatin1String(".size() < ")+ QString::number(maxOccurs) + QLatin1String(") {") + endLine + indent;
81 text += indent + QLatin1String("System.err.println(\"ERROR: Cant add") + fieldType + QLatin1String(" to ") + fieldName + QLatin1String(", minimum number of items reached.\");") + endLine + QLatin1Char('}') + endLine;
99 text += QLatin1String("if (") + fieldName + QLatin1String(".size() >= ")+ QString::number(minOccurs) + QLatin1String(") {") + endLine + indent;
104 text += indent + QLatin1String("System.err.println(\"ERROR: Cant remove") + fieldType + QLatin1String(" from ") + fieldName + QLatin1String(", minimum number of items reached.\");") + endLine + QLatin1Char('}') + endLine;
161 headerText = QLatin1String("Add an object of type ") + objectType + QLatin1String(" to the List ") + fieldName + endLine + getParentObject()->doc() + endLine + QLatin1String("@return void");
166 headerText = QLatin1String("Get the value of ") + fieldName + endLine + getParentObject()->doc() + endLine + QLatin1String("@return the value of ") + fieldName;
169 methodName = QLatin1String("get") + Codegen_Utils::capitalizeFirstLetter(fieldType) + QLatin1String("List");
171 headerText = QLatin1String("Get the list of ") + fieldName + endLine + getParentObject()->doc() + endLine + QLatin1String("@return List of ") + fieldName;
177 headerText = QLatin1String("Remove an object of type ") + objectType + QLatin1String(" from the List ") + fieldName + endLine + getParentObject()->doc();
183 headerText = QLatin1String("Set the value of ") + fieldName + endLine + getParentObject()->doc() + endLine;
196 setStartMethodText(strVis + QLatin1Char(' ') + methodReturnType + QLatin1Char(' ') + methodName + QLatin1String(" (") + methodParams + QLatin1String(") {"));
void setType(AccessorType type)
Set the type of accessor method this is.
Definition: codeaccessormethod.cpp:72
void setEndMethodText(const QString &value)
Set the ending text that finishes this method after the body is printed.
Definition: codemethodblock.cpp:66
void setStartMethodText(const QString &value)
Set the starting text that begins this method before the body is printed.
Definition: codemethodblock.cpp:58
virtual void updateMethodDeclaration()
This is the method called from within syncToparent().
Definition: dcodeaccessormethod.cpp:119
void setText(const QString &text)
Set the value of m_text The actual text of this code block.
Definition: textblock.cpp:80
QString getNewLineEndingChars() const
Utility function to get the actual characters.
Definition: codegenerationpolicy.cpp:248
AccessorType getType()
Utility method to get the value of the parent object of the parent classifield.
Definition: codeaccessormethod.cpp:64
CodeClassField * getParentClassField()
Get the value of m_parentclassfield.
Definition: codeaccessormethod.cpp:40
class CodeGenerationPolicy This class describes the code generation policy for this project...
Definition: codegenerationpolicy.h:29
ClassifierCodeDocument * getParentDocument()
Get the parent Code Document.
Definition: codeparameter.cpp:133
int minimumListOccurances()
Find the minimum number of things that can occur in an association If mistakenly called on attribute ...
Definition: codeclassfield.cpp:328
Definition: basictypes.h:58
QString number(int n, int base)
QString capitalizeFirstLetter(const QString &string)
Return the input string with the first letter capitalized.
Definition: codegen_utils.cpp:421
Definition: codeaccessormethod.h:32
A class representing a D documentation comment.
Definition: dcodedocumentation.h:27
bool isEmpty() const
Definition: codeaccessormethod.h:32
virtual void updateContent()
This is the method called from within syncToparent() to update the body of the method.
Definition: dcodeaccessormethod.cpp:61
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Set attributes of the node that represents this class in the XMI document.
Definition: codeaccessormethod.cpp:123
virtual void setAttributesFromNode(QDomElement &element)
Set the class attributes of this object from the passed element node.
Definition: dcodeaccessormethod.cpp:53
int maximumListOccurances()
Find the maximum number of things that can occur in an association If mistakenly called on attribute ...
Definition: codeclassfield.cpp:352
QString toString(Enum item, bool mnemonic)
Convert Visibility item into QString representation.
Definition: basictypes.cpp:99
Definition: codeaccessormethod.h:20
Definition: codeaccessormethod.h:32
CodeGenerationPolicy * commonPolicy() const
Returns the default code generation policy.
Definition: uml.cpp:2219
Definition: basictypes.h:57
virtual void setAttributesFromNode(QDomElement &element)
Set the class attributes of this object from the passed element node.
Definition: codeaccessormethod.cpp:137
virtual void setAttributesOnNode(QDomDocument &doc, QDomElement &blockElement)
Set attributes of the node that represents this class in the XMI document.
Definition: dcodeaccessormethod.cpp:45
Uml::Visibility::Enum getAttributeAccessorScope()
Get the value of m_attributeAccessorScope.
Definition: codegenerationpolicy.cpp:384
Uml::Visibility::Enum getVisibility() const
Utility method to get the value of parent object scope.
Definition: codeparameter.cpp:89
Definition: codeaccessormethod.h:32
DCodeAccessorMethod(CodeClassField *field, CodeAccessorMethod::AccessorType type)
Constructor.
Definition: dcodeaccessormethod.cpp:31
Definition: dcodeclassfield.h:21
Definition: basictypes.h:61
void setComment(CodeComment *object)
Set the Comment object.
Definition: codeblockwithcomments.cpp:38
QString getText() const
Get the value of m_text The actual text of this code block.
Definition: textblock.cpp:99
Definition: basictypes.h:59
static QString getIndentation()
Get how much a single "level" of indentation will actually indent.
Definition: textblock.cpp:182
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.