umbrello API Documentation

CodeClassField Class Reference

class CodeClassField a special type of parameter.. More...

#include <codeclassfield.h>

Inheritance diagram for CodeClassField:

CodeParameter List of all members.

Public Types

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

Signals

void modified ()

Public Member Functions

 CodeClassField (ClassifierCodeDocument *parentDoc, UMLAttribute *attrib)
 Constructors.
 CodeClassField (ClassifierCodeDocument *parentDoc, UMLRole *role)
void finishInitialization ()
 Finish off initializations of the object.
virtual ~CodeClassField ()
 Empty Destructor.
QString getTypeName ()
 Get the value of m_dialog.
CodeClassFieldDeclarationBlockgetDeclarationCodeBlock ()
 return the declaration statement for this class field object.
CodeAccessorMethodList getMethodList ()
 Get the list of Method objects held by m_methodVector.
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 identifier.
bool fieldIsSingleValue ()
 Determine whether the parent object in this classfield indicates that it is a single variable or a List (Vector).
ClassFieldType getClassFieldType ()
 Get the type of classfield this is.
bool parentIsAttribute ()
 Get the value of m_isAbstract.
QString getListObjectType ()
bool getWriteOutMethods ()
 determine if we will *allow* methods to be viewable.
void setWriteOutMethods (bool val)
 determine if we will *allow* methods to be viewable.
int 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.
int 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.
virtual void saveToXMI (QDomDocument &doc, QDomElement &root)
 Save the XMI representation of this object.
virtual void loadFromXMI (QDomElement &root)
 load params from the appropriate XMI element node.
virtual void synchronize ()
 Force the syncronization of the content (methods and declarations) of this class field.

Protected Member Functions

void setParentUMLObject (UMLObject *obj)
 Set the parent UMLobject appropriately.
QString cleanName (const QString &name)
 a little utility method to make life easier for code document programmers
QString fixInitialStringDeclValue (QString value, const QString &type)
 another utility method to make life easier for code document programmers this one fixes the initial declared value of string attributes so that if its empty or lacking quotations, it comes out as ""
void setListClassName (const QString &className)
bool addMethod (CodeAccessorMethod *add)
 Add a Method object to the m_methodVector List.
QString getUMLObjectName (UMLObject *obj)
 Get the value of m_dialog.
bool removeMethod (CodeAccessorMethod *remove)
 Remove a Method object from m_methodVector List.
void updateContent ()

Detailed Description

class CodeClassField a special type of parameter..

occurs on class declarations.

Definition at line 40 of file codeclassfield.h.


Constructor & Destructor Documentation

CodeClassField::CodeClassField ClassifierCodeDocument parentDoc,
UMLAttribute attrib
 

Constructors.

Definition at line 44 of file codeclassfield.cpp.

References setParentUMLObject().

CodeClassField::~CodeClassField  )  [virtual]
 

Empty Destructor.

Definition at line 53 of file codeclassfield.cpp.

References CodeClassFieldDeclarationBlock::forceRelease(), CodeParameter::getParentDocument(), and CodeGenObjectWithTextBlocks::removeTextBlock().


Member Function Documentation

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.)

Definition at line 607 of file codeclassfield.cpp.

References CodeParameter::getParentDocument(), CodeParameter::getParentObject(), and CodeGenFactory::newDeclarationCodeBlock().

Referenced by CodeGenFactory::newCodeClassField().

QString CodeClassField::getTypeName  )  [virtual]
 

Get the value of m_dialog.

Returns:
the value of m_dialog

Reimplemented from CodeParameter.

Definition at line 104 of file codeclassfield.cpp.

References fieldIsSingleValue(), UMLObject::getName(), UMLRole::getObject(), CodeParameter::getParentObject(), UMLClassifierListItem::getTypeName(), getUMLObjectName(), and parentIsAttribute().

CodeClassFieldDeclarationBlock * CodeClassField::getDeclarationCodeBlock  ) 
 

return the declaration statement for this class field object.

Returns:
CodeClassFieldDeclarationBlock representing the declaration statement of this class field

Definition at line 223 of file codeclassfield.cpp.

CodeAccessorMethodList CodeClassField::getMethodList  ) 
 

Get the list of Method objects held by m_methodVector.

Returns:
CodeAccessorMethodList list of Method objects held by m_methodVector

Definition at line 200 of file codeclassfield.cpp.

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.

Definition at line 389 of file codeclassfield.cpp.

References UMLRole::getRole().

Referenced by addMethod().

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.

Definition at line 574 of file codeclassfield.cpp.

References UMLRole::getMultiplicity(), CodeParameter::getParentObject(), and parentIsAttribute().

Referenced by getTypeName().

CodeClassField::ClassFieldType CodeClassField::getClassFieldType  ) 
 

Get the type of classfield this is.

Definition at line 144 of file codeclassfield.cpp.

Referenced by ClassifierCodeDocument::getSpecificClassFields(), and ClassifierCodeDocument::hasObjectVectorClassFields().

bool CodeClassField::parentIsAttribute  ) 
 

Get the value of m_isAbstract.

Returns:
the value of m_isAbstract

Definition at line 136 of file codeclassfield.cpp.

Referenced by fieldIsSingleValue(), getTypeName(), maximumListOccurances(), and minimumListOccurances().

bool CodeClassField::getWriteOutMethods  ) 
 

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.

Definition at line 208 of file codeclassfield.cpp.

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.

Definition at line 213 of file codeclassfield.cpp.

Referenced by CPPHeaderCodeDocument::updateContent().

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 multiplicty 0 is returned.

Definition at line 325 of file codeclassfield.cpp.

References UMLRole::getMultiplicity(), CodeParameter::getParentObject(), and parentIsAttribute().

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 multiplicty or has a "*" specified then '-1' (unbounded) is returned.

Definition at line 342 of file codeclassfield.cpp.

References UMLRole::getMultiplicity(), CodeParameter::getParentObject(), and parentIsAttribute().

void CodeClassField::saveToXMI QDomDocument &  doc,
QDomElement &  root
[virtual]
 

Save the XMI representation of this object.

Definition at line 317 of file codeclassfield.cpp.

References CodeParameter::setAttributesOnNode().

Referenced by ClassifierCodeDocument::setAttributesOnNode().

void CodeClassField::loadFromXMI QDomElement &  root  )  [virtual]
 

load params from the appropriate XMI element node.

Definition at line 234 of file codeclassfield.cpp.

References CodeParameter::setAttributesFromNode().

Referenced by ClassifierCodeDocument::loadClassFieldsFromXMI().

void CodeClassField::synchronize  )  [virtual]
 

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

Definition at line 378 of file codeclassfield.cpp.

References CodeClassFieldDeclarationBlock::syncToParent(), and ClassifierCodeDocument::syncToParent().

void CodeClassField::setParentUMLObject UMLObject obj  )  [protected]
 

Set the parent UMLobject appropriately.

Definition at line 82 of file codeclassfield.cpp.

References UMLAssociation::getAssocType(), and UMLRole::getParentAssociation().

Referenced by CodeClassField().

QString CodeClassField::cleanName const QString &  name  )  [protected]
 

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

Definition at line 362 of file codeclassfield.cpp.

References CodeDocument::cleanName(), and CodeParameter::getParentDocument().

QString CodeClassField::fixInitialStringDeclValue QString  value,
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 its empty or lacking quotations, it comes out as ""

Definition at line 366 of file codeclassfield.cpp.

bool CodeClassField::addMethod CodeAccessorMethod *  add_object  )  [protected]
 

Add a Method object to the m_methodVector List.

Definition at line 167 of file codeclassfield.cpp.

References findMethodByType().

QString CodeClassField::getUMLObjectName UMLObject obj  )  [protected]
 

Get the value of m_dialog.

Returns:
the value of m_dialog

Definition at line 159 of file codeclassfield.cpp.

References UMLObject::getName().

Referenced by getTypeName().

bool CodeClassField::removeMethod CodeAccessorMethod *  remove_object  )  [protected]
 

Remove a Method object from m_methodVector List.

Definition at line 188 of file codeclassfield.cpp.

References CodeParameter::getParentDocument(), and CodeGenObjectWithTextBlocks::removeTextBlock().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:04 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003