void UmlClass::java(Q3Dict<Q3CString> & prop) { if (!scanning) { Q3CString d = (stereotype() == "interface") ? JavaSettings::interfaceDecl() : JavaSettings::classDecl(); Q3CString * v; if ((v = prop.find("Java/Final")) != 0) { if (*v == "TRUE") set_isJavaFinal(TRUE); prop.remove("Java/Final"); } if ((v = prop.find("Java/Strictfp")) != 0) { if (*v == "TRUE") { int index; if ((index = d.find("${public}")) != -1) d.insert((unsigned) index + 9, "strictfp "); else if ((index = d.find("${visibility}")) != -1) d.insert((unsigned) index + 13, "strictfp "); } prop.remove("Java/Strictfp"); } set_JavaDecl(d); } }
void UmlClass::corba(Q3Dict<Q3CString> & prop) { if (!scanning) { Q3CString * v; if (stereotype() == "union") { if ((v = prop.find("CORBA/ImplementationType")) != 0) { UmlTypeSpec t; t.explicit_type = *v; // !!!!!!!!!!!! set_SwitchType(t); prop.remove("CORBA/ImplementationType"); } set_IdlDecl(IdlSettings::unionDecl()); } else if (stereotype() == "typedef") { if ((v = prop.find("CORBA/ImplementationType")) != 0) { UmlTypeSpec t; t.explicit_type = *v; // no quidu set_BaseType(t); prop.remove("CORBA/ImplementationType"); } QString d = IdlSettings::typedefDecl(); if ((v = prop.find("CORBA/ArrayDimensions")) != 0) { if (!v->isEmpty()) { int index; if ((index = d.find("${name}")) != -1) d.insert(index + 7, "[" + *v + "]"); } prop.remove("CORBA/ArrayDimensions"); } set_IdlDecl(d); } else if (stereotype() == "struct") set_IdlDecl(IdlSettings::structDecl()); else if (stereotype() == "enum") set_IdlDecl(IdlSettings::enumDecl()); else if (stereotype() == "interface") set_IdlDecl(IdlSettings::interfaceDecl()); else if (stereotype() == "exception") set_IdlDecl(IdlSettings::exceptionDecl()); else if (stereotype() == "") set_IdlDecl(IdlSettings::valuetypeDecl()); } }
void UmlClass::cplusplus(Q3Dict<Q3CString> & prop) { if (!scanning) { if (stereotype() == "typedef") { Q3CString * bt = prop.find("Cplusplus/ImplementationType"); if (bt != 0) { UmlTypeSpec t; t.explicit_type = *bt; // no quidu set_BaseType(t); } set_CppDecl(CppSettings::typedefDecl()); } else if (stereotype() == "struct") set_CppDecl(CppSettings::structDecl()); else if (stereotype() == "union") set_CppDecl(CppSettings::unionDecl()); else if (stereotype() == "enum") set_CppDecl(CppSettings::enumDecl()); else set_CppDecl(CppSettings::classDecl()); prop.remove("Cplusplus/ImplementationType"); } Q3CString * v; if ((v = prop.find("Cplusplus/BodySourceFile")) != 0) { _body_file = *v; prop.remove("Cplusplus/BodySourceFile"); } else if ((v = prop.find("Traversal/BodyFile")) != 0) { _body_file = *v; prop.remove("Traversal/BodyFile"); } if ((v = prop.find("Cplusplus/HeaderSourceFile")) != 0) { _file = *v; prop.remove("Cplusplus/HeaderSourceFile"); } else if ((v = prop.find("Traversal/CodeFile")) != 0) { _file = *v; prop.remove("Traversal/CodeFile"); } }
void UmlClass::importIdlConstant(UmlItem * parent, const Q3CString & id, const Q3CString & s, const Q3CString & doc, Q3Dict<Q3CString> & prop) { // use a class to define the constant ! UmlClass * x; if ((x = UmlClass::create(parent, legalName(s))) == 0) { UmlCom::trace("<br>cannot create class '" + s + "' in " + parent->fullName()); throw 0; } newItem(x, id); x->lang = Corba; x->set_Stereotype("constant"); if (!doc.isEmpty()) x->set_Description(doc); Q3CString type; Q3CString value; Q3CString * v; if ((v = prop.find("CORBA/ImplementationType")) != 0) { type = *v; prop.remove("CORBA/ImplementationType"); } if ((v = prop.find("CORBA/ConstValue")) != 0) { if (!v->isEmpty()) value = " = " + *v; prop.remove("CORBA/ConstValue"); } Q3CString d = IdlSettings::constDecl(); int index; if ((index = d.find("${type}")) != -1) d.replace(index, 7, type); if ((index = d.find("${value}")) != -1) d.replace(index, 8, value); x->setProperties(prop); x->set_IdlDecl(d); }