CodeGenObjectWithTextBlocks Class Reference
class CodeGenObjectWithTextBlocks This abstract class is for code generator objects which 'own' text blocks. More...
#include <codegenobjectwithtextblocks.h>
Inheritance diagram for CodeGenObjectWithTextBlocks:

Public Member Functions | |
| CodeGenObjectWithTextBlocks (CodeDocument *parent) | |
| Constructor. | |
| virtual | ~CodeGenObjectWithTextBlocks () |
| Empty Destructor. | |
| virtual bool | addTextBlock (TextBlock *add_object) |
| Add a TextBlock object to the m_textblockVector List. | |
| virtual bool | removeTextBlock (TextBlock *remove_object) |
| Remove a TextBlock object from m_textblockVector List. | |
| virtual bool | insertTextBlock (TextBlock *newBlock, TextBlock *existingBlock, bool after)=0 |
| Insert a new text block before/after the existing text block. | |
| TextBlockList * | getTextBlockList () |
| Get the list of TextBlock objects held by m_textblockVector. | |
| virtual HierarchicalCodeBlock * | getHierarchicalCodeBlock (const QString &tag, const QString &comment, int indentLevel) |
| Will get a hierarchicalcodeblock from the document with given tag. | |
| virtual CodeBlockWithComments * | getCodeBlockWithComments (const QString &tag, const QString &comment, int indentLevel) |
| Will get a codeblockwithcomments from the document with given tag. | |
| CodeComment * | addOrUpdateTaggedCodeComment (const QString &tag="", const QString &text="", int indentationLevel=0) |
| allows the user to add a code comment to the end of the list of text blocks in this document OR, if a text block already exists with that tag, it will update it with the passed text as appropriate. | |
| CodeBlockWithComments * | addOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &comment, int indentLevel, bool forceUserBlockUpdate) |
| allows the user to either add a code block with comments to the end of the list of text blocks in this document OR, if a text block already exists with that tag, it will update it with the passed text as appropriate. | |
| virtual TextBlock * | findTextBlockByTag (const QString &tag) |
| virtual QString | getUniqueTag (QString prefix="")=0 |
| virtual CodeBlock * | newCodeBlock ()=0 |
| Virtual methods that return a new code document objects. | |
| virtual CodeBlockWithComments * | newCodeBlockWithComments ()=0 |
| virtual HierarchicalCodeBlock * | newHierarchicalCodeBlock ()=0 |
| CodeGenObjectWithTextBlocks * | findParentObjectForTaggedTextBlock (const QString &tag) |
| Find the direct parent for a given textblock. | |
Protected Member Functions | |
| virtual void | setAttributesOnNode (QDomDocument &doc, QDomElement &elem) |
| set attributes of the node that represents this class in the XMI document. | |
| virtual void | setAttributesFromNode (QDomElement &element) |
| set the class attributes of this object from the passed element node. | |
| virtual void | setAttributesFromObject (CodeGenObjectWithTextBlocks *obj) |
| virtual void | loadChildTextBlocksFromNode (QDomElement &root) |
| in this vanilla version, we only load comments and codeblocks as they are the only instanciatable (vanilla) things this method should be overridden if this class is inherited by some other class that is concrete and takes children derived from codeblock/codecomment/hierarchicalcb/ownedhiercodeblock | |
| virtual void | resetTextBlocks () |
| virtual TextBlock * | findCodeClassFieldTextBlockByTag (const QString &tag)=0 |
Protected Attributes | |
| QMap< QString, TextBlock * > | m_textBlockTagMap |
| TextBlockList | m_textblockVector |
Detailed Description
class CodeGenObjectWithTextBlocks This abstract class is for code generator objects which 'own' text blocks.
Definition at line 41 of file codegenobjectwithtextblocks.h.
Constructor & Destructor Documentation
|
|
Constructor.
Definition at line 35 of file codegenobjectwithtextblocks.cpp. |
|
|
Empty Destructor.
Definition at line 41 of file codegenobjectwithtextblocks.cpp. |
Member Function Documentation
|
|
Add a TextBlock object to the m_textblockVector List.
Definition at line 75 of file codegenobjectwithtextblocks.cpp. References findParentObjectForTaggedTextBlock(), TextBlock::getParentDocument(), TextBlock::getTag(), getUniqueTag(), removeTextBlock(), and TextBlock::setTag(). Referenced by CPPHeaderCodeDocument::addCodeOperation(), addOrUpdateTaggedCodeBlockWithComments(), addOrUpdateTaggedCodeComment(), getCodeBlockWithComments(), getHierarchicalCodeBlock(), RubyClassifierCodeDocument::loadChildTextBlocksFromNode(), JavaClassifierCodeDocument::loadChildTextBlocksFromNode(), JavaANTCodeDocument::loadChildTextBlocksFromNode(), CPPHeaderCodeDocument::loadChildTextBlocksFromNode(), and loadChildTextBlocksFromNode(). |
|
|
Remove a TextBlock object from m_textblockVector List.
Definition at line 113 of file codegenobjectwithtextblocks.cpp. Referenced by addTextBlock(), CodeClassField::removeMethod(), ClassifierCodeDocument::removeOperation(), and CodeClassField::~CodeClassField(). |
|
||||||||||||||||
|
Insert a new text block before/after the existing text block. Returns false if it cannot insert the textblock. Implemented in CodeDocument. |
|
|
Get the list of TextBlock objects held by m_textblockVector.
Definition at line 65 of file codegenobjectwithtextblocks.cpp. Referenced by ClassifierCodeDocument::getCodeOperations(), setAttributesOnNode(), and CodeDocument::toString(). |
|
||||||||||||||||
|
Will get a hierarchicalcodeblock from the document with given tag. IF the codeblock doesn't exist, then it will create it at the end of the document textBlock list and pass back a reference.
Definition at line 184 of file codegenobjectwithtextblocks.cpp. References addTextBlock(), and findTextBlockByTag(). Referenced by CPPHeaderCodeDocument::loadChildTextBlocksFromNode(), and CPPHeaderCodeDocument::updateContent(). |
|
||||||||||||||||
|
Will get a codeblockwithcomments from the document with given tag. IF the codeblock doesn't exist, then it will create it at the end of the document textBlock list and pass back a reference.
Definition at line 216 of file codegenobjectwithtextblocks.cpp. References addTextBlock(), findTextBlockByTag(), CodeBlockWithComments::getComment(), CodeBlockWithComments::setComment(), CodeBlockWithComments::setOverallIndentationLevel(), TextBlock::setTag(), TextBlock::setText(), and TextBlock::setWriteOutText(). |
|
||||||||||||||||
|
allows the user to add a code comment to the end of the list of text blocks in this document OR, if a text block already exists with that tag, it will update it with the passed text as appropriate.
Definition at line 244 of file codegenobjectwithtextblocks.cpp. References addTextBlock(), findTextBlockByTag(), CodeGenFactory::newCodeComment(), TextBlock::setIndentationLevel(), TextBlock::setTag(), TextBlock::setText(), and TextBlock::setWriteOutText(). |
|
||||||||||||||||||||||||
|
allows the user to either add a code block with comments to the end of the list of text blocks in this document OR, if a text block already exists with that tag, it will update it with the passed text as appropriate.
Definition at line 283 of file codegenobjectwithtextblocks.cpp. References addTextBlock(), findTextBlockByTag(), CodeBlockWithComments::getComment(), CodeBlock::getContentType(), CodeBlockWithComments::setOverallIndentationLevel(), TextBlock::setTag(), TextBlock::setText(), and TextBlock::setWriteOutText(). Referenced by CPPHeaderCodeDocument::updateContent(). |
|
|
Definition at line 136 of file codegenobjectwithtextblocks.cpp. Referenced by addOrUpdateTaggedCodeBlockWithComments(), addOrUpdateTaggedCodeComment(), findParentObjectForTaggedTextBlock(), getCodeBlockWithComments(), and getHierarchicalCodeBlock(). |
|
|
Implemented in CodeDocument. Referenced by addTextBlock(). |
|
|
Virtual methods that return a new code document objects.
Implemented in CodeDocument. Referenced by loadChildTextBlocksFromNode(). |
|
|
Find the direct parent for a given textblock. This may be any object which holds text blocks, e.g. a CodeGenObjectWithTextBlocks.
Definition at line 149 of file codegenobjectwithtextblocks.cpp. References findTextBlockByTag(). Referenced by addTextBlock(). |
|
||||||||||||
|
set attributes of the node that represents this class in the XMI document.
Reimplemented in ClassifierCodeDocument, CodeDocument, JavaANTCodeDocument, and OwnedHierarchicalCodeBlock. Definition at line 349 of file codegenobjectwithtextblocks.cpp. References getTextBlockList(), and TextBlock::saveToXMI(). Referenced by CodeDocument::setAttributesOnNode(). |
|
|
set the class attributes of this object from the passed element node.
Reimplemented in ClassifierCodeDocument, CodeDocument, JavaANTCodeDocument, and OwnedHierarchicalCodeBlock. Definition at line 366 of file codegenobjectwithtextblocks.cpp. References loadChildTextBlocksFromNode(). Referenced by CodeDocument::setAttributesFromNode(). |
|
|
in this vanilla version, we only load comments and codeblocks as they are the only instanciatable (vanilla) things this method should be overridden if this class is inherited by some other class that is concrete and takes children derived from codeblock/codecomment/hierarchicalcb/ownedhiercodeblock
Reimplemented in CPPHeaderCodeDocument, JavaANTCodeDocument, JavaClassifierCodeDocument, and RubyClassifierCodeDocument. Definition at line 383 of file codegenobjectwithtextblocks.cpp. References addTextBlock(), UMLDoc::findObjectById(), UMLApp::getDocument(), CodeDocument::getFileName(), UMLObject::loadFromXMI(), CodeBlockWithComments::loadFromXMI(), CodeBlock::loadFromXMI(), CodeComment::loadFromXMI(), newCodeBlock(), CodeGenFactory::newCodeComment(), and CodeGenFactory::newCodeOperation(). Referenced by setAttributesFromNode(). |
The documentation for this class was generated from the following files:
