umbrello/umbrello
javawriter.cpp
Go to the documentation of this file.
122 UMLAssociationList associations = c->getSpecificAssocs(Uml::AssociationType::Association); // BAD! only way to get "general" associations.
128 bool hasAssociations = aggregations.count() > 0 || associations.count() > 0 || compositions.count() > 0 || uniAssociations.count() > 0;
411 void JavaWriter::writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &java)
471 void JavaWriter::writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java)
491 void JavaWriter::writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &java)
505 // First: we insert documentaion for association IF it has either role AND some documentation (!)
513 writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::RoleType::B), a->getMultiplicity(Uml::RoleType::B), a->getRoleDoc(Uml::RoleType::B), a->visibility(Uml::RoleType::B), java);
520 writeAssociationRoleDecl(fieldClassName, a->getRoleName(Uml::RoleType::A), a->getMultiplicity(Uml::RoleType::A), a->getRoleDoc(Uml::RoleType::A), a->visibility(Uml::RoleType::A), java);
567 void JavaWriter::writeAssociationMethods (UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &java)
611 void JavaWriter::writeAssociationRoleMethod (QString fieldClassName, QString roleName, QString multi,
632 void JavaWriter::writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
644 writeDocumentation("Add a "+fieldName+" object to the "+fieldVarName+" List", description,"", m_indentation, java);
653 writeDocumentation("Remove a "+fieldName+" object from "+fieldVarName+" List", description,"", m_indentation, java);
661 writeDocumentation("Get the List of "+fieldName+" objects held by "+fieldVarName, description,"@return List of "+fieldName+" objects held by "+fieldVarName, m_indentation, java);
671 void JavaWriter::writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
682 writeDocumentation("Set the value of "+fieldVarName, description,"@param newVar the new value of "+fieldVarName, m_indentation, java);
689 writeDocumentation("Get the value of "+fieldVarName, description,"@return the value of "+fieldVarName, m_indentation, java);
800 void JavaWriter::getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath)
806 getSuperImplementedOperations(concept, yetImplementedOpList, toBeImplementedOpList, (concept->isInterface() && noClassInPath));
828 void JavaWriter::getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opList)
835 if (! JavaWriter::javaMethodInList(op, yetImplementedOpList) && ! JavaWriter::javaMethodInList(op, opList))
UMLAssociationList getAggregations()
Shorthand for getSpecificAssocs(Uml::at_Aggregation)
Definition: umlcanvasobject.cpp:421
UMLObject * getObject(Uml::RoleType::Enum role) const
Returns the UMLObject assigned to the given role.
Definition: association.cpp:476
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
Definition: classifier.h:47
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Return the subset of m_List that matches the given type.
Definition: umlcanvasobject.cpp:61
QString getInitialValue() const
Returns The initial value of the UMLAttribute.
Definition: attribute.cpp:98
Definition: basictypes.h:209
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:435
bool openFile(QFile &file, const QString &name)
Opens a file named "name" for writing in the outputDirectory.
Definition: codegenerator.cpp:586
static QString formatDoc(const QString &text, const QString &linePrefix=" *", int lineWidth=80)
Format documentation for output in source files.
Definition: codegenerator.cpp:772
QString findFileName(UMLPackage *concept, const QString &ext)
Determine the file name.
Definition: simplecodegenerator.cpp:89
virtual QString getTypeName() const
Overrides method from UMLClassifierListItem.
Definition: template.cpp:72
Definition: basictypes.h:210
Definition: basictypes.h:176
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
This class holds information used by template classes, called paramaterised class in UML and a generi...
Definition: template.h:26
virtual QString getHeadingFile(const QString &file)
Gets the heading file (as a string) to be inserted at the beginning of the generated file...
Definition: codegenerator.cpp:482
virtual void writeClass(UMLClassifier *c)
Call this method to generate java code for a UMLClassifier.
Definition: javawriter.cpp:59
Definition: basictypes.h:58
This class contains the non-graphic representation of an association.
Definition: association.h:32
QString capitalizeFirstLetter(const QString &string)
Return the input string with the first letter capitalized.
Definition: codegen_utils.cpp:421
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:112
QListIterator< UMLAttribute * > UMLAttributeListIt
Definition: umlattributelist.h:20
void codeGenerated(UMLClassifier *concept, bool generated)
Uml::Changeability::Enum changeability(Uml::RoleType::Enum role) const
Returns the changeability.
Definition: association.cpp:518
UMLAssociationList getCompositions()
Shorthand for getSpecificAssocs(Uml::at_Composition)
Definition: umlcanvasobject.cpp:431
Definition: basictypes.h:248
virtual UMLAssociationList getUniAssociationToBeImplemented()
Return the list of unidirectional association that should show up in the code.
Definition: classifier.cpp:1369
QString toString(Enum item, bool mnemonic)
Convert Visibility item into QString representation.
Definition: basictypes.cpp:99
static QString formatSourceCode(const QString &code, const QString &indentation)
Format source code for output in source files by adding the correct indentation to every line of code...
Definition: codegenerator.cpp:803
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Finds all classes in the current document to which objects of class c are in some way related...
Definition: codegenerator.cpp:682
QStringList defaultDatatypes()
Overrides method from class CodeGenerator.
Definition: javawriter.cpp:735
Definition: basictypes.h:177
Definition: basictypes.h:57
UMLClassifierList findSuperClassConcepts(ClassifierType type=ALL)
Returns a list of concepts which this concept inherits from.
Definition: classifier.cpp:616
bool isStatic() const
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition: umlobject.cpp:335
UMLAttributeList getAttributeList() const
Returns the attributes for the specified scope.
Definition: classifier.cpp:441
Definition: classifier.h:47
QString package(const QString &separator=QString(), bool includeRoot=false)
Return the package(s) in which this UMLObject is contained as a text.
Definition: umlobject.cpp:603
QString getSourceCode() const
Returns the source code for this operation.
Definition: operation.cpp:440
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Return a list of operations for the Classifier.
Definition: classifier.cpp:960
Uml::Visibility::Enum visibility(Uml::RoleType::Enum role) const
Returns the Visibility of the given role.
Definition: association.cpp:527
QString getRoleDoc(Uml::RoleType::Enum role) const
Returns the documentation assigned to the given role.
Definition: association.cpp:554
QString getRoleName(Uml::RoleType::Enum role) const
Returns the name assigned to the role A.
Definition: association.cpp:545
static QString cleanName(const QString &name)
Replaces spaces with underscores and capitalises as defined in m_modname.
Definition: codegenerator.cpp:609
Uml::ID::Type getObjectId(Uml::RoleType::Enum role) const
Returns the ID of the UMLObject assigned to the given role.
Definition: association.cpp:488
virtual Uml::ProgrammingLanguage::Enum language() const
Returns "Java".
Definition: javawriter.cpp:50
QString getMultiplicity(Uml::RoleType::Enum role) const
Returns the multiplicity assigned to the given role.
Definition: association.cpp:536
virtual QString getTypeName() const
Returns the type name of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:110
Definition: basictypes.h:59
Definition: umlobject.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.