umbrello: umbrello/codegenerators/xml/xmlschemawriter.h Source File

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

xmlschemawriter.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 <brian.thomas@gsfc.nasa.gov>
5 SPDX-FileCopyrightText: 2004-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef XMLSCHEMAWRITER_H
9#define XMLSCHEMAWRITER_H
10
11#include "attribute.h"
12#include "association.h"
13#include "codegenerator.h"
14#include "umlclassifierlist.h"
15#include "umlattributelist.h"
16#include "umlobjectlist.h"
17#include "umlassociationlist.h"
18#include "simplecodegenerator.h"
19
33 class XMLSchemaWriter : public SimpleCodeGenerator
34{
35 Q_OBJECT
36public:
37
38 XMLSchemaWriter();
39 virtual ~XMLSchemaWriter();
40
41 virtual void writeClass(UMLClassifier *c);
42
43 virtual Uml::ProgrammingLanguage::Enum language() const;
44
45 virtual QStringList reservedKeywords() const;
46
47private:
48
49 void writeClassifier(UMLClassifier *c, QTextStream &XMLSchema);
50 void writeAbstractClassifier(UMLClassifier *c, QTextStream &XMLSchema);
51 void writeConcreteClassifier(UMLClassifier *c, QTextStream &XMLSchema);
52
53 void writeComplexTypeClassifierDecl(UMLClassifier *c,
54 UMLAssociationList associations,
55 UMLAssociationList aggregations,
56 UMLAssociationList compositions,
57 UMLClassifierList superclassifiers,
58 QTextStream &XMLSchema);
59
60 void writeGroupClassifierDecl(UMLClassifier *c,
61 UMLClassifierList superclassifiers,
62 QTextStream &XMLSchema);
63
64 bool determineIfHasChildNodes(UMLClassifier *c);
65
71// void writeAttributes(UMLClassifier *c, QTextStream &j);
72
73 void writeElementDecl(const QString &elementName, const QString &elementTypeName, QTextStream &xs);
74
75 void writeAttributeDecls(UMLAttributeList &attribs, QTextStream &xs);
76
77 void writeAttributeDecl(UMLAttribute *attrib, QTextStream &xs);
78
79 UMLAttributeList findAttributes(UMLClassifier *c);
80
81 QStringList findAttributeGroups(UMLClassifier *c);
82
83 bool writeAssociationDecls(UMLAssociationList associations, bool noRoleOK, bool didOne,
84 Uml::ID::Type id, QTextStream &xs);
85
86 void writeAttributeGroupDecl(const QString &elementName, UMLAttributeList &attribs, QTextStream &xs);
87
88 void writeAssociationRoleDecl(UMLClassifier *c, const QString &multi, QTextStream &xs);
89
90 QString makeSchemaTag(QString tagName);
91 QString makePackageTag(QString tagName);
92
93 void writeComment(const QString &text, QTextStream &xs);
94
95 UMLObjectList findChildObjsInAssociations(UMLClassifier *c, UMLAssociationList associations);
96
97 QString fixTypeName(const QString& string);
98
99 QString fixInitialStringDeclValue(QString value, const QString &type);
100
101 QString getElementName(UMLClassifier *c);
102 QString getElementTypeName(UMLClassifier *c);
103 QString getElementGroupTypeName(UMLClassifier *c);
104
105 void writeChildObjsInAssociation(UMLClassifier *c, UMLAssociationList assoc, QTextStream &s);
106
107 bool hasBeenWritten(UMLClassifier *c);
108 void markAsWritten(UMLClassifier *c);
109
110 QString schemaNamespaceTag;
111 QString packageNamespaceTag;
112 QString schemaNamespaceURI;
113 QString packageNamespaceURI;
114 QString startline;
115 UMLClassifierList writtenClassifiers;
116};
117
118#endif // XMLSCHEMAWRITER_H
association.h
attribute.h
SimpleCodeGenerator
Definition: simplecodegenerator.h:30
UMLAttributeList
Definition: umlattributelist.h:21
UMLAttribute
Sets up attribute information.
Definition: attribute.h:23
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:35
UMLObjectList
Definition: umlobjectlist.h:25
XMLSchemaWriter
Definition: xmlschemawriter.h:34
XMLSchemaWriter::hasBeenWritten
bool hasBeenWritten(UMLClassifier *c)
Definition: xmlschemawriter.cpp:462
XMLSchemaWriter::getElementName
QString getElementName(UMLClassifier *c)
Definition: xmlschemawriter.cpp:801
XMLSchemaWriter::makeSchemaTag
QString makeSchemaTag(QString tagName)
Definition: xmlschemawriter.cpp:837
XMLSchemaWriter::findAttributeGroups
QStringList findAttributeGroups(UMLClassifier *c)
Definition: xmlschemawriter.cpp:410
XMLSchemaWriter::writeConcreteClassifier
void writeConcreteClassifier(UMLClassifier *c, QTextStream &XMLSchema)
Definition: xmlschemawriter.cpp:375
XMLSchemaWriter::packageNamespaceURI
QString packageNamespaceURI
basic packageNamespace URI
Definition: xmlschemawriter.h:113
XMLSchemaWriter::fixTypeName
QString fixTypeName(const QString &string)
Definition: xmlschemawriter.cpp:775
XMLSchemaWriter::findAttributes
UMLAttributeList findAttributes(UMLClassifier *c)
Definition: xmlschemawriter.cpp:182
XMLSchemaWriter::fixInitialStringDeclValue
QString fixInitialStringDeclValue(QString value, const QString &type)
Definition: xmlschemawriter.cpp:786
XMLSchemaWriter::writtenClassifiers
UMLClassifierList writtenClassifiers
a list of UMLClassifiers we have already written
Definition: xmlschemawriter.h:115
XMLSchemaWriter::findChildObjsInAssociations
UMLObjectList findChildObjsInAssociations(UMLClassifier *c, UMLAssociationList associations)
Definition: xmlschemawriter.cpp:654
XMLSchemaWriter::getElementTypeName
QString getElementTypeName(UMLClassifier *c)
Definition: xmlschemawriter.cpp:810
XMLSchemaWriter::writeChildObjsInAssociation
void writeChildObjsInAssociation(UMLClassifier *c, UMLAssociationList assoc, QTextStream &s)
Definition: xmlschemawriter.cpp:447
XMLSchemaWriter::packageNamespaceTag
QString packageNamespaceTag
basic packageNamespace tag
Definition: xmlschemawriter.h:111
XMLSchemaWriter::startline
QString startline
a , used at the end of each line
Definition: xmlschemawriter.h:114
XMLSchemaWriter::determineIfHasChildNodes
bool determineIfHasChildNodes(UMLClassifier *c)
Definition: xmlschemawriter.cpp:434
XMLSchemaWriter::writeComment
void writeComment(const QString &text, QTextStream &xs)
Definition: xmlschemawriter.cpp:552
XMLSchemaWriter::writeElementDecl
void writeElementDecl(const QString &elementName, const QString &elementTypeName, QTextStream &xs)
Definition: xmlschemawriter.cpp:147
XMLSchemaWriter::~XMLSchemaWriter
virtual ~XMLSchemaWriter()
Definition: xmlschemawriter.cpp:36
XMLSchemaWriter::writeAttributeGroupDecl
void writeAttributeGroupDecl(const QString &elementName, UMLAttributeList &attribs, QTextStream &xs)
Definition: xmlschemawriter.cpp:525
XMLSchemaWriter::getElementGroupTypeName
QString getElementGroupTypeName(UMLClassifier *c)
Definition: xmlschemawriter.cpp:819
XMLSchemaWriter::XMLSchemaWriter
XMLSchemaWriter()
Definition: xmlschemawriter.cpp:25
XMLSchemaWriter::schemaNamespaceURI
QString schemaNamespaceURI
basic schemaNamespace URI
Definition: xmlschemawriter.h:112
XMLSchemaWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: xmlschemawriter.cpp:43
XMLSchemaWriter::writeComplexTypeClassifierDecl
void writeComplexTypeClassifierDecl(UMLClassifier *c, UMLAssociationList associations, UMLAssociationList aggregations, UMLAssociationList compositions, UMLClassifierList superclassifiers, QTextStream &XMLSchema)
Definition: xmlschemawriter.cpp:281
XMLSchemaWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: xmlschemawriter.cpp:52
XMLSchemaWriter::writeAssociationRoleDecl
void writeAssociationRoleDecl(UMLClassifier *c, const QString &multi, QTextStream &xs)
Definition: xmlschemawriter.cpp:678
XMLSchemaWriter::writeAttributeDecl
void writeAttributeDecl(UMLAttribute *attrib, QTextStream &xs)
Definition: xmlschemawriter.cpp:493
XMLSchemaWriter::schemaNamespaceTag
QString schemaNamespaceTag
basic schemaNamespace tag
Definition: xmlschemawriter.h:110
XMLSchemaWriter::writeAssociationDecls
bool writeAssociationDecls(UMLAssociationList associations, bool noRoleOK, bool didOne, Uml::ID::Type id, QTextStream &xs)
Definition: xmlschemawriter.cpp:584
XMLSchemaWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: xmlschemawriter.cpp:846
XMLSchemaWriter::writeAbstractClassifier
void writeAbstractClassifier(UMLClassifier *c, QTextStream &XMLSchema)
Definition: xmlschemawriter.cpp:216
XMLSchemaWriter::writeAttributeDecls
void writeAttributeDecls(UMLAttributeList &attribs, QTextStream &xs)
Definition: xmlschemawriter.cpp:483
XMLSchemaWriter::markAsWritten
void markAsWritten(UMLClassifier *c)
Definition: xmlschemawriter.cpp:473
XMLSchemaWriter::writeClassifier
void writeClassifier(UMLClassifier *c, QTextStream &XMLSchema)
Definition: xmlschemawriter.cpp:161
XMLSchemaWriter::writeGroupClassifierDecl
void writeGroupClassifierDecl(UMLClassifier *c, UMLClassifierList superclassifiers, QTextStream &XMLSchema)
Definition: xmlschemawriter.cpp:251
XMLSchemaWriter::makePackageTag
QString makePackageTag(QString tagName)
Definition: xmlschemawriter.cpp:828
codegenerator.h
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:291
Uml::ProgrammingLanguage::XMLSchema
@ XMLSchema
Definition: basictypes.h:311
simplecodegenerator.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:12
umlattributelist.h
umlclassifierlist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:12
umlobjectlist.h