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

- Main Page
- Related Pages
- Topics
- 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 "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
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
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:463
XMLSchemaWriter::getElementName
QString getElementName(UMLClassifier *c)
Definition xmlschemawriter.cpp:802
XMLSchemaWriter::makeSchemaTag
QString makeSchemaTag(QString tagName)
Definition xmlschemawriter.cpp:838
XMLSchemaWriter::findAttributeGroups
QStringList findAttributeGroups(UMLClassifier *c)
Definition xmlschemawriter.cpp:411
XMLSchemaWriter::writeConcreteClassifier
void writeConcreteClassifier(UMLClassifier *c, QTextStream &XMLSchema)
Definition xmlschemawriter.cpp:376
XMLSchemaWriter::packageNamespaceURI
QString packageNamespaceURI
basic packageNamespace URI
Definition xmlschemawriter.h:115
XMLSchemaWriter::fixTypeName
QString fixTypeName(const QString &string)
Definition xmlschemawriter.cpp:776
XMLSchemaWriter::findAttributes
UMLAttributeList findAttributes(UMLClassifier *c)
Definition xmlschemawriter.cpp:183
XMLSchemaWriter::fixInitialStringDeclValue
QString fixInitialStringDeclValue(QString value, const QString &type)
Definition xmlschemawriter.cpp:787
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:655
XMLSchemaWriter::getElementTypeName
QString getElementTypeName(UMLClassifier *c)
Definition xmlschemawriter.cpp:811
XMLSchemaWriter::writeChildObjsInAssociation
void writeChildObjsInAssociation(UMLClassifier *c, UMLAssociationList assoc, QTextStream &s)
Definition xmlschemawriter.cpp:448
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:435
XMLSchemaWriter::writeComment
void writeComment(const QString &text, QTextStream &xs)
Definition xmlschemawriter.cpp:553
XMLSchemaWriter::writeElementDecl
void writeElementDecl(const QString &elementName, const QString &elementTypeName, QTextStream &xs)
Definition xmlschemawriter.cpp:148
XMLSchemaWriter::~XMLSchemaWriter
virtual ~XMLSchemaWriter()
Definition xmlschemawriter.cpp:37
XMLSchemaWriter::writeAttributeGroupDecl
void writeAttributeGroupDecl(const QString &elementName, UMLAttributeList &attribs, QTextStream &xs)
Definition xmlschemawriter.cpp:526
XMLSchemaWriter::getElementGroupTypeName
QString getElementGroupTypeName(UMLClassifier *c)
Definition xmlschemawriter.cpp:820
XMLSchemaWriter::XMLSchemaWriter
XMLSchemaWriter()
Definition xmlschemawriter.cpp:26
XMLSchemaWriter::schemaNamespaceURI
QString schemaNamespaceURI
basic schemaNamespace URI
Definition xmlschemawriter.h:114
XMLSchemaWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition xmlschemawriter.cpp:44
XMLSchemaWriter::writeComplexTypeClassifierDecl
void writeComplexTypeClassifierDecl(UMLClassifier *c, UMLAssociationList associations, UMLAssociationList aggregations, UMLAssociationList compositions, UMLClassifierList superclassifiers, QTextStream &XMLSchema)
Definition xmlschemawriter.cpp:282
XMLSchemaWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition xmlschemawriter.cpp:53
XMLSchemaWriter::writeAssociationRoleDecl
void writeAssociationRoleDecl(UMLClassifier *c, const QString &multi, QTextStream &xs)
Definition xmlschemawriter.cpp:679
XMLSchemaWriter::writeAttributeDecl
void writeAttributeDecl(UMLAttribute *attrib, QTextStream &xs)
Definition xmlschemawriter.cpp:494
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:585
XMLSchemaWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition xmlschemawriter.cpp:847
XMLSchemaWriter::writeAbstractClassifier
void writeAbstractClassifier(UMLClassifier *c, QTextStream &XMLSchema)
Definition xmlschemawriter.cpp:217
XMLSchemaWriter::writeAttributeDecls
void writeAttributeDecls(UMLAttributeList &attribs, QTextStream &xs)
Definition xmlschemawriter.cpp:484
XMLSchemaWriter::markAsWritten
void markAsWritten(UMLClassifier *c)
Definition xmlschemawriter.cpp:474
XMLSchemaWriter::writeClassifier
void writeClassifier(UMLClassifier *c, QTextStream &XMLSchema)
Definition xmlschemawriter.cpp:162
XMLSchemaWriter::writeGroupClassifierDecl
void writeGroupClassifierDecl(UMLClassifier *c, UMLClassifierList superclassifiers, QTextStream &XMLSchema)
Definition xmlschemawriter.cpp:252
XMLSchemaWriter::makePackageTag
QString makePackageTag(QString tagName)
Definition xmlschemawriter.cpp:829
codegenerator.h
Uml::ID::Type
std::string Type
Definition basictypes.h:371
Uml::ProgrammingLanguage::Enum
Enum
Definition basictypes.h:291
simplecodegenerator.h
umlassociationlist.h
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition umlassociationlist.h:14
umlattributelist.h
umlclassifierlist.h
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition umlclassifierlist.h:14
umlobjectlist.h