umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Public Types | Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CodeClassField Class Reference

#include <codeclassfield.h>

Inheritance diagram for CodeClassField:
Collaboration diagram for CodeClassField:

Public Types

enum  ClassFieldType {
  Attribute , PlainAssociation , Self , Aggregation ,
  Composition , Unknown_Assoc
}
 

Signals

void modified ()
 

Public Member Functions

 CodeClassField (ClassifierCodeDocument *parentDoc, UMLAttribute *attrib)
 
 CodeClassField (ClassifierCodeDocument *parentDoc, UMLRole *role)
 
void finishInitialization ()
 
virtual ~CodeClassField ()
 
QString getTypeName ()
 
CodeClassFieldDeclarationBlockgetDeclarationCodeBlock ()
 
CodeAccessorMethodList getMethodList () const
 
CodeAccessorMethodfindMethodByType (CodeAccessorMethod::AccessorType type, int role_id=-1)
 
bool fieldIsSingleValue ()
 
ClassFieldType getClassFieldType () const
 
bool parentIsAttribute () const
 
QString getListObjectType ()
 
bool getWriteOutMethods () const
 
void setWriteOutMethods (bool val)
 
int minimumListOccurances ()
 
int maximumListOccurances ()
 
virtual void saveToXMI (QXmlStreamWriter &writer)
 
virtual void loadFromXMI (QDomElement &root)
 
virtual void synchronize ()
 
void updateContent ()
 
- Public Member Functions inherited from CodeParameter
 CodeParameter (ClassifierCodeDocument *doc, UMLObject *parentObj)
 
virtual ~CodeParameter ()
 
ClassifierCodeDocumentgetParentDocument ()
 
UMLObjectgetParentObject ()
 
bool getAbstract ()
 
bool getStatic ()
 
QString getName () const
 
Uml::Visibility::Enum getVisibility () const
 
virtual void setInitialValue (const QString &new_var)
 
virtual QString getInitialValue ()
 
void setComment (CodeComment *comment)
 
CodeCommentgetComment ()
 
QString ID () const
 

Protected Member Functions

void setParentUMLObject (UMLObject *obj)
 
QString cleanName (const QString &name)
 
QString fixInitialStringDeclValue (const QString &val, const QString &type)
 
void setListClassName (const QString &className)
 
bool addMethod (CodeAccessorMethod *add)
 
QString getUMLObjectName (UMLObject *obj)
 
bool removeMethod (CodeAccessorMethod *remove)
 

Private Member Functions

virtual void setAttributesOnNode (QXmlStreamWriter &writer)
 
virtual void setAttributesFromNode (QDomElement &element)
 
void initFields (bool inConstructor=false)
 
void initAccessorMethods ()
 

Private Attributes

QString m_listClassName
 
ClassFieldType m_classFieldType
 
CodeClassFieldDeclarationBlockm_declCodeBlock
 
CodeAccessorMethodList m_methodVector
 
bool m_parentIsAttribute
 
bool m_writeOutMethods
 

Additional Inherited Members

- Public Slots inherited from CodeParameter
void syncToParent ()
 

Detailed Description

class CodeClassField a special type of parameter.. occurs on class declarations.

Member Enumeration Documentation

◆ ClassFieldType

Enumerator
Attribute 
PlainAssociation 
Self 
Aggregation 
Composition 
Unknown_Assoc 

Constructor & Destructor Documentation

◆ CodeClassField() [1/2]

CodeClassField::CodeClassField ( ClassifierCodeDocument doc,
UMLAttribute attrib 
)

Constructor.

Here is the call graph for this function:

◆ CodeClassField() [2/2]

CodeClassField::CodeClassField ( ClassifierCodeDocument doc,
UMLRole role 
)

Constructor.

Here is the call graph for this function:

◆ ~CodeClassField()

CodeClassField::~CodeClassField ( )
virtual

Empty Destructor.

Here is the call graph for this function:

Member Function Documentation

◆ addMethod()

bool CodeClassField::addMethod ( CodeAccessorMethod add_object)
protected

Add a Method object to the m_methodVector List.

Here is the call graph for this function:

◆ cleanName()

QString CodeClassField::cleanName ( const QString &  name)
protected

A little utility method to make life easier for code document programmers

Here is the call graph for this function:

◆ fieldIsSingleValue()

bool CodeClassField::fieldIsSingleValue ( )

Determine whether the parent object in this classfield indicates that it is a single variable or a List (Vector). One day this will be done correctly with special multiplicity object.

Here is the call graph for this function:

◆ findMethodByType()

CodeAccessorMethod * CodeClassField::findMethodByType ( CodeAccessorMethod::AccessorType  type,
int  role_id = -1 
)

Utility method to allow finding particular accessor method of this code class field by its type identifier.

Here is the call graph for this function:

◆ finishInitialization()

void CodeClassField::finishInitialization ( )

Finish off initializations of the object. This is necessary as a separate method because we cannot call virtual methods that are reimplemented in a language specific class during our own construction (the own object is not finished being constructed and therefore the C++ dispatch mechanism does not yet work as expected.)

Here is the call graph for this function:

◆ fixInitialStringDeclValue()

QString CodeClassField::fixInitialStringDeclValue ( const QString &  val,
const QString &  type 
)
protected

Another utility method to make life easier for code document programmers this one fixes the initial declared value of string attributes so that if it is empty or lacking quotations, it comes out as ""

◆ getClassFieldType()

CodeClassField::ClassFieldType CodeClassField::getClassFieldType ( ) const

Get the type of classfield this is.

◆ getDeclarationCodeBlock()

CodeClassFieldDeclarationBlock * CodeClassField::getDeclarationCodeBlock ( )

Return the declaration statement for this class field object. will be empty until this (abstract) class is inherited in elsewhere.

◆ getListObjectType()

QString CodeClassField::getListObjectType ( )
Here is the call graph for this function:

◆ getMethodList()

CodeAccessorMethodList CodeClassField::getMethodList ( ) const

Get the list of Method objects held by m_methodVector.

Returns
QPtrList<CodeMethodBlock *> list of Method objects held by m_methodVector

◆ getTypeName()

QString CodeClassField::getTypeName ( )
virtual

Utility method to get the value of parent object type. the typeName of this parameters (e.g. boolean, int, etc or perhaps Class name of an object)

Returns
the value of type

Reimplemented from CodeParameter.

Reimplemented in DCodeClassField, JavaCodeClassField, and RubyCodeClassField.

Here is the call graph for this function:

◆ getUMLObjectName()

QString CodeClassField::getUMLObjectName ( UMLObject obj)
protected
Here is the call graph for this function:

◆ getWriteOutMethods()

bool CodeClassField::getWriteOutMethods ( ) const

Determine if we will *allow* methods to be viewable. this flag is often used to toggle autogeneration of accessor methods in the code class field.

◆ initAccessorMethods()

void CodeClassField::initAccessorMethods ( )
private
Here is the call graph for this function:

◆ initFields()

void CodeClassField::initFields ( bool  inConstructor = false)
private

Init class fields.

Here is the call graph for this function:

◆ loadFromXMI()

void CodeClassField::loadFromXMI ( QDomElement &  root)
virtual

Load params from the appropriate XMI element node.

Here is the call graph for this function:

◆ maximumListOccurances()

int CodeClassField::maximumListOccurances ( )

Find the maximum number of things that can occur in an association If mistakenly called on attribute CF's the default value of is "1" is returned. If the association (role) CF doesn't have a multiplicity or has a "*" specified then '-1' (unbounded) is returned.

Here is the call graph for this function:

◆ minimumListOccurances()

int CodeClassField::minimumListOccurances ( )

Find the minimum number of things that can occur in an association If mistakenly called on attribute CF's the default value of is "0" is returned. Similarly, if the association (role) CF doesn't have a multiplicity 0 is returned.

Here is the call graph for this function:

◆ modified

void CodeClassField::modified ( )
signal

◆ parentIsAttribute()

bool CodeClassField::parentIsAttribute ( ) const

Get the value of m_isAbstract.

Returns
the value of m_isAbstract

◆ removeMethod()

bool CodeClassField::removeMethod ( CodeAccessorMethod remove_object)
protected

Remove a Method object from m_methodVector List.

Here is the call graph for this function:

◆ saveToXMI()

void CodeClassField::saveToXMI ( QXmlStreamWriter &  writer)
virtual

Save the XMI representation of this object.

Here is the call graph for this function:

◆ setAttributesFromNode()

void CodeClassField::setAttributesFromNode ( QDomElement &  root)
privatevirtual

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

Reimplemented from CodeParameter.

Here is the call graph for this function:

◆ setAttributesOnNode()

void CodeClassField::setAttributesOnNode ( QXmlStreamWriter &  writer)
privatevirtual

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

Reimplemented from CodeParameter.

Here is the call graph for this function:

◆ setListClassName()

void CodeClassField::setListClassName ( const QString &  className)
protected

◆ setParentUMLObject()

void CodeClassField::setParentUMLObject ( UMLObject obj)
protected

Set the parent UMLobject appropriately.

Here is the call graph for this function:

◆ setWriteOutMethods()

void CodeClassField::setWriteOutMethods ( bool  val)

Determine if we will *allow* methods to be viewable. this flag is often used to toggle autogeneration of accessor methods in the code class field.

Here is the call graph for this function:

◆ synchronize()

void CodeClassField::synchronize ( )
virtual

Force the synchronization of the content (methods and declarations) of this class field.

Here is the call graph for this function:

◆ updateContent()

void CodeClassField::updateContent ( )
virtual

Updates the status of the accessor methods as to whether or not they should be written out.

Implements CodeParameter.

Here is the call graph for this function:

Member Data Documentation

◆ m_classFieldType

ClassFieldType CodeClassField::m_classFieldType
private

◆ m_declCodeBlock

CodeClassFieldDeclarationBlock* CodeClassField::m_declCodeBlock
private

◆ m_listClassName

QString CodeClassField::m_listClassName
private

◆ m_methodVector

CodeAccessorMethodList CodeClassField::m_methodVector
private

◆ m_parentIsAttribute

bool CodeClassField::m_parentIsAttribute
private

◆ m_writeOutMethods

bool CodeClassField::m_writeOutMethods
private

This flag tells if we want the methods to have the possibility of being written out. IF the value is false, then all methods are never written out.


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