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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

javawriter.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3
4 SPDX-FileCopyrightText: 2003 Brian Thomas
5 <brian.thomas@gsfc.nasa.gov>
6 SPDX-FileCopyrightText: 2004-2022 Umbrello UML Modeller Authors
7 <umbrello-devel@kde.org>
8*/
9
10#ifndef JAVAWRITER_H
11#define JAVAWRITER_H
12
13#include "simplecodegenerator.h"
14#include "umloperationlist.h"
15#include "umlattributelist.h"
16#include "umlassociationlist.h"
17
18 class UMLOperation;
19
29 class JavaWriter : public SimpleCodeGenerator
30{
31 public:
32 JavaWriter();
33 virtual ~JavaWriter();
34
35 virtual void writeClass(UMLClassifier *c);
36
37 virtual Uml::ProgrammingLanguage::Enum language() const;
38
39 QStringList defaultDatatypes() const;
40
41 private:
42 void writeClassDecl(UMLClassifier *c, QTextStream &java);
43
44 void writeConstructor(UMLClassifier *c, QTextStream &java);
45
46 static bool compareJavaMethod(UMLOperation *op1, UMLOperation *op2);
47
48 static bool javaMethodInList(UMLOperation *umlOp, UMLOperationList &opl);
49
50 void getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath = true);
51
52 void getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opl);
53
54 void writeOperations(UMLClassifier *c, QTextStream &j);
55
56 void writeOperations(UMLOperationList &oplist, QTextStream &j);
57
58 void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot,
59 UMLAttributeList &atpriv, QTextStream &java);
60
61 void writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &java);
62
63 void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi,
64 QString doc, Uml::Visibility::Enum visib, QTextStream &java);
65
66 void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &java);
67
68 void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass,
69 QTextStream &java);
70
71 void writeAssociationRoleMethod(QString fieldClassName, QString roleName, QString multi,
72 QString description, Uml::Visibility::Enum visib, Uml::Changeability::Enum change,
73 QTextStream &java);
74
75 void writeSingleAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
76 QString fieldName, QString description,
77 Uml::Visibility::Enum visibility, Uml::Changeability::Enum change,
78 bool isFinal, QTextStream &java);
79
80 void writeVectorAttributeAccessorMethods(QString fieldClassName, QString fieldVarName,
81 QString fieldName, QString description,
82 Uml::Visibility::Enum visibility, Uml::Changeability::Enum change,
83 QTextStream &java);
84
85 void writeComment(const QString &text, const QString &indent, QTextStream &java, bool javaDocStyle=false);
86
87 void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java);
88
89 QString getUMLObjectName(UMLObject *obj);
90
91 QString fixTypeName(const QString& string);
92
93 QString fixInitialStringDeclValue(const QString& val, const QString& type);
94
95 void writeBlankLine(QTextStream& java);
96
97 QString m_startline;
98 bool m_isInterface;
99
100};
101
102#endif // JAVAWRITER_H
JavaWriter
Definition: javawriter.h:30
JavaWriter::fixTypeName
QString fixTypeName(const QString &string)
Definition: javawriter.cpp:720
JavaWriter::writeClassDecl
void writeClassDecl(UMLClassifier *c, QTextStream &java)
Definition: javawriter.cpp:268
JavaWriter::~JavaWriter
virtual ~JavaWriter()
Definition: javawriter.cpp:40
JavaWriter::writeAttributeMethods
void writeAttributeMethods(UMLAttributeList &atpub, Uml::Visibility::Enum visibility, QTextStream &java)
Definition: javawriter.cpp:409
JavaWriter::writeConstructor
void writeConstructor(UMLClassifier *c, QTextStream &java)
Definition: javawriter.cpp:699
JavaWriter::writeBlankLine
void writeBlankLine(QTextStream &java)
Definition: javawriter.cpp:1002
JavaWriter::writeOperations
void writeOperations(UMLClassifier *c, QTextStream &j)
Definition: javawriter.cpp:855
JavaWriter::getInterfacesOperationsToBeImplemented
void getInterfacesOperationsToBeImplemented(UMLClassifier *c, UMLOperationList &opl)
Definition: javawriter.cpp:838
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:630
JavaWriter::m_isInterface
bool m_isInterface
whether or not this concept is an interface
Definition: javawriter.h:98
JavaWriter::getUMLObjectName
QString getUMLObjectName(UMLObject *obj)
Definition: javawriter.cpp:993
JavaWriter::fixInitialStringDeclValue
QString fixInitialStringDeclValue(const QString &val, const QString &type)
Definition: javawriter.cpp:977
JavaWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: javawriter.cpp:48
JavaWriter::writeDocumentation
void writeDocumentation(QString header, QString body, QString end, QString indent, QTextStream &java)
Definition: javawriter.cpp:469
JavaWriter::writeComment
void writeComment(const QString &text, const QString &indent, QTextStream &java, bool javaDocStyle=false)
Definition: javawriter.cpp:429
JavaWriter::getSuperImplementedOperations
void getSuperImplementedOperations(UMLClassifier *c, UMLOperationList &yetImplementedOpList, UMLOperationList &toBeImplementedOpList, bool noClassInPath=true)
Definition: javawriter.cpp:810
JavaWriter::m_startline
QString m_startline
a , used at the end of each line
Definition: javawriter.h:97
JavaWriter::defaultDatatypes
QStringList defaultDatatypes() const
Definition: javawriter.cpp:735
JavaWriter::compareJavaMethod
static bool compareJavaMethod(UMLOperation *op1, UMLOperation *op2)
Definition: javawriter.cpp:765
JavaWriter::writeAttributeDecls
void writeAttributeDecls(UMLAttributeList &atpub, UMLAttributeList &atprot, UMLAttributeList &atpriv, QTextStream &java)
Definition: javawriter.cpp:368
JavaWriter::JavaWriter
JavaWriter()
Definition: javawriter.cpp:31
JavaWriter::javaMethodInList
static bool javaMethodInList(UMLOperation *umlOp, UMLOperationList &opl)
Definition: javawriter.cpp:792
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:609
JavaWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: javawriter.cpp:57
JavaWriter::writeAssociationRoleDecl
void writeAssociationRoleDecl(QString fieldClassName, QString roleName, QString multi, QString doc, Uml::Visibility::Enum visib, QTextStream &java)
Definition: javawriter.cpp:527
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:671
JavaWriter::writeAssociationMethods
void writeAssociationMethods(UMLAssociationList associations, UMLClassifier *thisClass, QTextStream &java)
Definition: javawriter.cpp:565
JavaWriter::writeAssociationDecls
void writeAssociationDecls(UMLAssociationList associations, Uml::ID::Type id, QTextStream &java)
Definition: javawriter.cpp:489
SimpleCodeGenerator
Definition: simplecodegenerator.h:30
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:69
UMLAttributeList
Definition: umlattributelist.h:21
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: umlclassifier.h:35
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLOperation
Definition: umloperation.h:20
description
static const char description[]
Definition: main.cpp:32
Uml::Changeability::Enum
Enum
Definition: basictypes.h:202
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:291
Uml::Visibility::Enum
Enum
Definition: basictypes.h:45
visibility
Definition: visibility.py:1
simplecodegenerator.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:14
umlattributelist.h
umloperationlist.h
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:14