#include "UmlItem.h"
#include "FileOut.h"
#include "UmlTypeSpec.h"
#include "UmlCom.h"
#include "UmlClass.h"
UmlItem::~UmlItem() {
}
void UmlItem::xmi(int, char **) {
UmlCom::trace("Error : must be applied on the project
");
}
void UmlItem::write(FileOut & out) {
const QVector ch = children();
unsigned n = ch.size();
for (unsigned i = 0; i != n; i += 1)
ch[i]->write(out);
}
void UmlItem::write(FileOut &, bool) {
}
void UmlItem::write_description_properties(FileOut & out) {
if (! description().isEmpty()) {
static int rank = 0;
out.indent();
out << "\n";
}
if (_gen_extension) {
QCString ste = stereotype();
const QDict up = properties();
QDictIterator it(up);
if (it.current()) {
out.indent();
out << "\n";
if (! ste.isEmpty()) {
_stereotypes[ste].append(this);
out.indent();
out << "\t\n";
}
do {
out.indent();
out << "\t\n";
++it;
} while (it.current());
out.indent();
out << "\n";
}
else if (! ste.isEmpty()) {
_stereotypes[ste].append(this);
out.indent();
out << "\n";
out.indent();
out << "\t\n";
out.indent();
out << "\n";
}
}
}
void UmlItem::search_class_assoc() {
}
void UmlItem::memo_relation(UmlItem * r) {
parent()->memo_relation(r);
}
void UmlItem::write_multiplicity(FileOut & out, QCString s)
{
if (!s.isEmpty()) {
static UmlItem * rank = 0;
QCString min;
QCString max;
int index = s.find("..");
if (index != -1) {
min = s.left(index).stripWhiteSpace();
max = s.mid(index+2).stripWhiteSpace();
}
else
min = max = s.stripWhiteSpace();
out.indent();
out << "\n";
out.indent();
out << "\n";
}
}
void UmlItem::write_type(FileOut & out, const UmlTypeSpec & t)
{
if (t.type != 0) {
out.indent();
out << "\n";
}
else if (!t.explicit_type.isEmpty()) {
out.indent();
out << "\n";
}
}
void UmlItem::write_default_value(FileOut & out, QCString v)
{
if (! v.isEmpty()) {
if (v[0] == '=') {
v = v.mid(1);
if (v.isEmpty())
return;
}
static UmlItem * rank = 0;
out.indent();
out << "\n";
}
}
bool UmlItem::_gen_views;
Language UmlItem::_lang;
bool UmlItem::_uml_20;
bool UmlItem::_use_profile;
bool UmlItem::_pk_prefix;
bool UmlItem::_vis_prefix;
bool UmlItem::_primitive_type;
bool UmlItem::_linefeed;
bool UmlItem::_gen_extension;