umbrello: umbrello/codegenerators/java/javawriter.h Source File

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

javawriter.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2003 Brian Thomas *
8 * <brian.thomas@gsfc.nasa.gov> *
9 * copyright (C) 2004-2014 Umbrello UML Modeller Authors *
10 * <umbrello-devel@kde.org> *
11 ***************************************************************************/
12
13 #ifndef JAVAWRITER_H
14 #define JAVAWRITER_H
15
16 #include "simplecodegenerator.h"
17 #include "umloperationlist.h"
18 #include "umlattributelist.h"
19 #include "umlassociationlist.h"
20
21 class UMLOperation;
22
32 class JavaWriter : public SimpleCodeGenerator
33 {
34 public:
35 JavaWriter();
36 virtual ~JavaWriter();
37
38 virtual void writeClass(UMLClassifier *c);
39
40 virtual Uml::ProgrammingLanguage::Enum language() const;
41
42 QStringList defaultDatatypes();
43
44 private:
45 void writeClassDecl(UMLClassifier *c, QTextStream &java);
46
47 void writeConstructor(UMLClassifier *c, QTextStream &java);
48
49 static bool compareJavaMethod(UMLOperation *op1, UMLOperation *op2);
50
51 static bool javaMethodInList(UMLOperation *umlOp, UMLOperationList &opl);
52
53 void getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath = true);
54
55 void getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opl);
56
57 void writeOperations(UMLClassifier *c, QTextStream &j);
58
59 void writeOperations(UMLOperationList &list, QTextStream &j);
60
61 void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot,
62 UMLAttributeList &atpriv, QTextStream &java);
63
64 void writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &java);
65
66 void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi,
67 QString doc, Uml::Visibility::Enum visib, QTextStream &java);
68
69 void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &java);
70
71 void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass,
72 QTextStream &java);
73
74 void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi,
75 QString description, Uml::Visibility::Enum visib, Uml::Changeability::Enum change,
76 QTextStream &java);
77
78 void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
79 QString fieldName, QString description,
80 Uml::Visibility::Enum visibility, Uml::Changeability::Enum change,
81 bool isFinal, QTextStream &java);
82
83 void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
84 QString fieldName, QString description,
85 Uml::Visibility::Enum visibility, Uml::Changeability::Enum change,
86 QTextStream &java);
87
88 void writeComment(const QString &text, const QString &indent, QTextStream &java, bool javaDocStyle=false);
89
90 void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java);
91
92 QString getUMLObjectName(UMLObject *obj);
93
94 QString fixTypeName(const QString& string);
95
96 QString fixInitialStringDeclValue(const QString& val, const QString& type);
97
98 void writeBlankLine(QTextStream& java);
99
100 QString m_startline;
101 bool m_isInterface;
102
103 };
104
105 #endif // JAVAWRITER_H
JavaWriter
Definition: javawriter.h:33
JavaWriter::fixTypeName
QString fixTypeName(const QString &string)
Definition: javawriter.cpp:723
JavaWriter::writeClassDecl
void writeClassDecl(UMLClassifier *c, QTextStream &java)
Definition: javawriter.cpp:271
JavaWriter::~JavaWriter
virtual ~JavaWriter()
Definition: javawriter.cpp:43
JavaWriter::writeAttributeMethods
void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &java)
Definition: javawriter.cpp:412
JavaWriter::writeConstructor
void writeConstructor(UMLClassifier *c, QTextStream &java)
Definition: javawriter.cpp:702
JavaWriter::writeBlankLine
void writeBlankLine(QTextStream &java)
Definition: javawriter.cpp:1005
JavaWriter::writeOperations
void writeOperations(UMLClassifier *c, QTextStream &j)
Definition: javawriter.cpp:858
JavaWriter::getInterfacesOperationsToBeImplemented
void getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opl)
Definition: javawriter.cpp:841
JavaWriter::writeVectorAttributeAccessorMethods
void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, QString fieldName, QString description, Uml::Visibility::Enum visibility, Uml::Changeability::Enum change, QTextStream &java)
Definition: javawriter.cpp:633
JavaWriter::m_isInterface
bool m_isInterface
whether or not this concept is an interface
Definition: javawriter.h:101
JavaWriter::getUMLObjectName
QString getUMLObjectName(UMLObject *obj)
Definition: javawriter.cpp:996
JavaWriter::fixInitialStringDeclValue
QString fixInitialStringDeclValue(const QString &val, const QString &type)
Definition: javawriter.cpp:980
JavaWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: javawriter.cpp:51
JavaWriter::writeDocumentation
void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java)
Definition: javawriter.cpp:472
JavaWriter::writeComment
void writeComment(const QString &text, const QString &indent, QTextStream &java, bool javaDocStyle=false)
Definition: javawriter.cpp:432
JavaWriter::getSuperImplementedOperations
void getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath=true)
Definition: javawriter.cpp:813
JavaWriter::m_startline
QString m_startline
a , used at the end of each line
Definition: javawriter.h:100
JavaWriter::compareJavaMethod
static bool compareJavaMethod(UMLOperation *op1, UMLOperation *op2)
Definition: javawriter.cpp:768
JavaWriter::writeAttributeDecls
void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, UMLAttributeList &atpriv, QTextStream &java)
Definition: javawriter.cpp:371
JavaWriter::JavaWriter
JavaWriter()
Definition: javawriter.cpp:34
JavaWriter::defaultDatatypes
QStringList defaultDatatypes()
Definition: javawriter.cpp:738
JavaWriter::javaMethodInList
static bool javaMethodInList(UMLOperation *umlOp, UMLOperationList &opl)
Definition: javawriter.cpp:795
JavaWriter::writeAssociationRoleMethod
void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi, QString description, Uml::Visibility::Enum visib, Uml::Changeability::Enum change, QTextStream &java)
Definition: javawriter.cpp:612
JavaWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: javawriter.cpp:60
JavaWriter::writeAssociationRoleDecl
void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, QString doc, Uml::Visibility::Enum visib, QTextStream &java)
Definition: javawriter.cpp:530
JavaWriter::writeSingleAttributeAccessorMethods
void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName, QString fieldName, QString description, Uml::Visibility::Enum visibility, Uml::Changeability::Enum change, bool isFinal, QTextStream &java)
Definition: javawriter.cpp:674
JavaWriter::writeAssociationMethods
void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &java)
Definition: javawriter.cpp:568
JavaWriter::writeAssociationDecls
void writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &java)
Definition: javawriter.cpp:492
SimpleCodeGenerator
Definition: simplecodegenerator.h:34
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:76
UMLAttributeList
Definition: umlattributelist.h:27
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
UMLObject
The base class for UML objects.
Definition: umlobject.h:75
UMLOperation
Definition: operation.h:25
description
static const char description[]
Definition: main.cpp:37
Uml::Changeability::Enum
Enum
Definition: basictypes.h:216
Uml::ID::Type
std::string Type
Definition: basictypes.h:385
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:305
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
visibility
Definition: visibility.py:1
simplecodegenerator.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
umlattributelist.h
umloperationlist.h
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18