umbrello 26.03.70-f7b1fd3 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

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-2022 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
6*/
7
8#ifndef XMLSCHEMAWRITER_H
9#define XMLSCHEMAWRITER_H
10
11#include "umlattribute.h"
12#include "umlassociation.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
36 public:
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
47 private:
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
66#if 0
72 void writeAttributes(UMLClassifier *c, QTextStream &j);
73#endif
74
75 void writeElementDecl(const QString &elementName, const QString &elementTypeName, QTextStream &xs);
76
77 void writeAttributeDecls(UMLAttributeList &attribs, QTextStream &xs);
78
79 void writeAttributeDecl(UMLAttribute *attrib, QTextStream &xs);
80
81 UMLAttributeList findAttributes(UMLClassifier *c);
82
83 QStringList findAttributeGroups(UMLClassifier *c);
84
85 bool writeAssociationDecls(UMLAssociationList associations, bool noRoleOK, bool didOne,
86 Uml::ID::Type id, QTextStream &xs);
87
88 void writeAttributeGroupDecl(const QString &elementName, UMLAttributeList &attribs, QTextStream &xs);
89
90 void writeAssociationRoleDecl(UMLClassifier *c, const QString &multi, QTextStream &xs);
91
92 QString makeSchemaTag(QString tagName);
93 QString makePackageTag(QString tagName);
94
95 void writeComment(const QString &text, QTextStream &xs);
96
97 UMLObjectList findChildObjsInAssociations(UMLClassifier *c, UMLAssociationList associations);
98
99 QString fixTypeName(const QString& string);
100
101 QString fixInitialStringDeclValue(QString value, const QString &type);
102
103 QString getElementName(UMLClassifier *c);
104 QString getElementTypeName(UMLClassifier *c);
105 QString getElementGroupTypeName(UMLClassifier *c);
106
107 void writeChildObjsInAssociation(UMLClassifier *c, UMLAssociationList assoc, QTextStream &s);
108
109 bool hasBeenWritten(UMLClassifier *c);
110 void markAsWritten(UMLClassifier *c);
111
112 QString schemaNamespaceTag;
113 QString packageNamespaceTag;
114 QString schemaNamespaceURI;
115 QString packageNamespaceURI;
116 QString startline;
117 UMLClassifierList writtenClassifiers;
118};
119
120#endif // XMLSCHEMAWRITER_H
SimpleCodeGenerator
Definition: simplecodegenerator.h:30
UMLAttribute
Sets up attribute information.
Definition: umlattribute.h:23
UMLAttributeList
Definition: umlattributelist.h:21
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: umlclassifier.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:115
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:117
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:113
XMLSchemaWriter::startline
QString startline
a , used at the end of each line
Definition: xmlschemawriter.h:116
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:114
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:112
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
simplecodegenerator.h
umlassociation.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:14
umlattribute.h
umlattributelist.h
umlclassifierlist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:14
umlobjectlist.h