umbrello: CodeAccessorMethod Class Reference

umbrello 2.32.1 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CodeAccessorMethod Class Referenceabstract

`#include <codeaccessormethod.h>`

Inheritance diagram for CodeAccessorMethod:

## Public Types
enum | AccessorType { GET =0 , SET , ADD , REMOVE , LIST }
Public Types inherited from CodeBlock
enum | ContentType { AutoGenerated =0 , UserGenerated }

## Public Member Functions
| CodeAccessorMethod (CodeClassField *field)
virtual | ~CodeAccessorMethod ()
CodeClassField * | getParentClassField ()
AccessorType | getType ()
void | setType (AccessorType type)
bool | parentIsAttribute ()
virtual void | updateContent ()=0
virtual void | saveToXMI1 (QXmlStreamWriter &writer)
virtual void | loadFromXMI1 (QDomElement &root)
virtual void | setAttributesFromObject (TextBlock *obj)
Public Member Functions inherited from CodeMethodBlock
| CodeMethodBlock (ClassifierCodeDocument *doc, UMLObject *parentObj, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeMethodBlock ()
virtual QString | toString () const
QString | getStartMethodText () const
QString | getEndMethodText () const
CodeDocument * | getParentDocument ()
Public Member Functions inherited from OwnedCodeBlock
| OwnedCodeBlock (UMLObject *parent)
virtual | ~OwnedCodeBlock ()
UMLObject * | getParentObject ()
Public Member Functions inherited from CodeBlockWithComments
| CodeBlockWithComments (CodeDocument *parent, const QString &body=QString(), const QString &comment=QString())
virtual | ~CodeBlockWithComments ()
void | setComment (CodeComment *object)
CodeComment * | getComment () const
void | setOverallIndentationLevel (int level)
Public Member Functions inherited from CodeBlock
| CodeBlock (CodeDocument *parent, const QString &body=QString())
virtual | ~CodeBlock ()
void | setContentType (ContentType new_var)
ContentType | contentType () const
Public Member Functions inherited from TextBlock
| TextBlock (CodeDocument *parent, const QString &text=QString())
virtual | ~TextBlock ()
void | setText (const QString &text)
QString | getText () const
void | appendText (const QString &text)
void | setTag (const QString &value)
QString | getTag () const
CodeDocument * | getParentDocument () const
void | setWriteOutText (bool write)
bool | getWriteOutText () const
void | setIndentationLevel (int level)
int | getIndentationLevel () const
QString | getIndentationString (int level=0) const
virtual QString | unformatText (const QString &text, const QString &indent=QString())
bool | canDelete () const
virtual QString | getNewEditorLine (int amount=0)
virtual int | firstEditableLine ()
virtual int | lastEditableLine ()

## Protected Member Functions
virtual void | release ()
virtual void | setAttributesOnNode (QXmlStreamWriter &writer)
virtual void | setAttributesFromNode (QDomElement &element)
virtual void | updateMethodDeclaration ()=0
void | forceRelease ()
Protected Member Functions inherited from CodeMethodBlock
void | setStartMethodText (const QString &value)
void | setEndMethodText (const QString &value)
Protected Member Functions inherited from TextBlock
void | setCanDelete (bool canDelete)

## Private Member Functions
void | initFields (CodeClassField *parentCF)

## Private Attributes
CodeClassField * | m_parentclassfield
AccessorType | m_accessorType

## Friends
class | CodeClassField

## Additional Inherited Members
Public Slots inherited from CodeMethodBlock
virtual void | syncToParent ()
Public Slots inherited from OwnedCodeBlock
virtual void | syncToParent ()
Static Public Member Functions inherited from CodeBlock
static QString | enumToString (const ContentType &val)
Static Public Member Functions inherited from TextBlock
static QString | getIndentation ()
static QString | getNewLineEndingChars ()
static QString | formatMultiLineText (const QString &work, const QString &linePrefix, const QString &breakStr, bool addBreak=true, bool lastLineHasBreak=true)
static QString | encodeText (const QString &text, const QString &endLine)
static QString | decodeText (const QString &text, const QString &endLine)

## Member Enumeration Documentation

## ◆ AccessorType

enum CodeAccessorMethod::AccessorType

Enumerator
GET |
SET |
ADD |
REMOVE |
LIST |

## Constructor & Destructor Documentation

## ◆ CodeAccessorMethod()

CodeAccessorMethod::CodeAccessorMethod | ( | CodeClassField * | parentCF | ) |
| explicit

Constructors

## ◆ ~CodeAccessorMethod()

CodeAccessorMethod::~CodeAccessorMethod | ( |  | ) |
| virtual

Empty Destructor

## Member Function Documentation

## ◆ forceRelease()

void CodeAccessorMethod::forceRelease | ( |  | ) |
| protected

A method so the parent code classfield can force code block to release.

## ◆ getParentClassField()

CodeClassField * CodeAccessorMethod::getParentClassField | ( |  | ) |

Get the value of m_parentclassfield

Returns
  the value of m_parentclassfield

## ◆ getType()

CodeAccessorMethod::AccessorType CodeAccessorMethod::getType | ( |  | ) |

Utility method to get the value of the parent object of the parent classifield.

Returns
  the value of the parent of the parent classfield

Return the type of accessor method this is.

## ◆ initFields()

void CodeAccessorMethod::initFields | ( | CodeClassField * | parentCF | ) |
| private

## ◆ loadFromXMI1()

void CodeAccessorMethod::loadFromXMI1 | ( | QDomElement & | root | ) |
| virtual

Load params from the appropriate XMI element node.

Reimplemented from CodeBlockWithComments.

## ◆ parentIsAttribute()

bool CodeAccessorMethod::parentIsAttribute | ( |  | ) |

## ◆ release()

void CodeAccessorMethod::release | ( |  | ) |
| protectedvirtual

This type of textblock is special we DON'T release it when resetTextBlocks is called because we re-use it over and over until the codeclassfield is released.

Reimplemented from CodeMethodBlock.

## ◆ saveToXMI1()

void CodeAccessorMethod::saveToXMI1 | ( | QXmlStreamWriter & | writer | ) |
| virtual

Save the XMI representation of this object.

Reimplemented from CodeBlockWithComments.

## ◆ setAttributesFromNode()

void CodeAccessorMethod::setAttributesFromNode | ( | QDomElement & | root | ) |
| protectedvirtual

Set the class attributes of this object from the passed element node.

Reimplemented from CodeMethodBlock.

Reimplemented in RubyCodeAccessorMethod, JavaCodeAccessorMethod, and DCodeAccessorMethod.

## ◆ setAttributesFromObject()

void CodeAccessorMethod::setAttributesFromObject | ( | TextBlock * | obj | ) |
| virtual

Set the class attributes from a passed object.

Reimplemented from CodeMethodBlock.

## ◆ setAttributesOnNode()

void CodeAccessorMethod::setAttributesOnNode | ( | QXmlStreamWriter & | writer | ) |
| protectedvirtual

Set attributes of the node that represents this class in the XMI document.

Reimplemented from CodeMethodBlock.

Reimplemented in RubyCodeAccessorMethod, JavaCodeAccessorMethod, and DCodeAccessorMethod.

## ◆ setType()

void CodeAccessorMethod::setType | ( | CodeAccessorMethod::AccessorType | atype | ) |

Set the type of accessor method this is.

## ◆ updateContent()

virtual void CodeAccessorMethod::updateContent | ( |  | ) |
| pure virtual

This is the method called from within syncToparent() to update the *body* of the method. It is only called if the method is Auto-generated.

Implements CodeMethodBlock.

Implemented in RubyCodeAccessorMethod, JavaCodeAccessorMethod, DCodeAccessorMethod, CPPSourceCodeAccessorMethod, and CPPHeaderCodeAccessorMethod.

## ◆ updateMethodDeclaration()

virtual void CodeAccessorMethod::updateMethodDeclaration | ( |  | ) |
| protectedpure virtual

This is the method called from within syncToparent(). To update the start and end Method text. It is called whether or not the method is Auto or User generated.

Implements CodeMethodBlock.

Implemented in RubyCodeAccessorMethod, JavaCodeAccessorMethod, DCodeAccessorMethod, CPPSourceCodeAccessorMethod, and CPPHeaderCodeAccessorMethod.

## Friends And Related Function Documentation

## ◆ CodeClassField

friend class CodeClassField
| friend

## Member Data Documentation

## ◆ m_accessorType

AccessorType CodeAccessorMethod::m_accessorType
| private

## ◆ m_parentclassfield

CodeClassField* CodeAccessorMethod::m_parentclassfield
| private

The documentation for this class was generated from the following files:

- umbrello/codegenerators/codeaccessormethod.h
- umbrello/codegenerators/codeaccessormethod.cpp