From d5039dd8c45e8257e4f013f6c8e93cc0e1350a9f Mon Sep 17 00:00:00 2001 From: Erlend Stav <erlend.stav@sintef.no> Date: Mon, 8 Oct 2012 15:17:15 +0000 Subject: [PATCH] Fixed some minor bugs with separator chars etc. and corrected reference to properties --- .../transformations/serviceModelUML2Java.m2t | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/transformations/org.universaal.tools.transformationcommand/transformations/serviceModelUML2Java.m2t b/transformations/org.universaal.tools.transformationcommand/transformations/serviceModelUML2Java.m2t index 8d306aa7b..2b2098fb7 100644 --- a/transformations/org.universaal.tools.transformationcommand/transformations/serviceModelUML2Java.m2t +++ b/transformations/org.universaal.tools.transformationcommand/transformations/serviceModelUML2Java.m2t @@ -130,7 +130,7 @@ import org.universAAL.middleware.api.annotation.UniversAALService;' //declare the service '\n\n@UniversAALService(namespace = ' self.name '.namespace, name="' self.name '")\n' - '@OntologyClasses(values = {' ontologyClass '.class})\n' + '@OntologyClasses(value = {' ontologyClass '.class})\n' 'public interface ' self.name ' {\n' //set the namespace based on the packagename reversed @@ -295,7 +295,7 @@ import org.universAAL.ontology.phThing.PhysicalThing; var valueType:String = "" separator = "" effectProps->forEach(p:uml.Property) { - separator + p.owner.name + '.' + p.name + separator + p.owner.name + '.PROP_' p.toUpperFormat() separator = ", " valueType = p.type.name // Use type of last property } @@ -334,7 +334,7 @@ import org.universAAL.ontology.phThing.PhysicalThing; separator = ", " } } - ') + '); ' } @@ -345,7 +345,22 @@ import org.universAAL.ontology.phThing.PhysicalThing; } + uml.Classifier::toUpperFormat():String { + var txt:String + var res:String + + txt = self.name.trim() + res = "" + + txt->forEach(aChar:String) { + if (aChar.isUpperCase(0)) { + res = res + "_"; + } + res = res + aChar; + } + return res.toUpper() + } } -- GitLab