[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Brian Thomas
thomas at mail630.gsfc.nasa.gov
Fri Oct 3 13:50:07 UTC 2003
CVS commit by thomas:
Patch to fix name of fields, the objects they pass and the name of the list they are stored in when codeclassfield comes from an association.
M +14 -0 javacodeclassfielddeclarationblock.cpp 1.4
--- kdesdk/umbrello/umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp #1.3:1.4
@@ -62,7 +62,21 @@ void JavaCodeClassFieldDeclarationBlock:
QString initialV = jcf->getInitialValue();
+ if (!cf->parentIsAttribute() && !cf->fieldIsSingleValue())
+ typeName = "List";
+
QString body = staticValue+scopeStr+" "+typeName+" "+fieldName;
if (!initialV.isEmpty())
body.append(" = " + initialV);
+ else if (!cf->parentIsAttribute())
+ {
+ // FIX?: IF a constructor method exists in the classifiercodedoc
+ // of the parent Object, then we can use that instead (if its empty).
+ if(cf->fieldIsSingleValue())
+ {
+ if(!typeName.isEmpty())
+ body.append(" = new " + typeName + " ( )");
+ } else
+ body.append(" = new Vector ( )");
+ }
setText(body+";");
More information about the umbrello-devel
mailing list