Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-09-11 13:09:59 -0400
committerAnsgar Radermacher2013-09-11 13:09:59 -0400
commitfc19e3d5c70b7b321ad237651a7e75efcd252c68 (patch)
treec53d6821a1731861397d910ad8eb5687f6f9edc0 /extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src
parent379f22556e2d58fa2ef0eeca92d326ca7d7b4518 (diff)
downloadorg.eclipse.papyrus-fc19e3d5c70b7b321ad237651a7e75efcd252c68.tar.gz
org.eclipse.papyrus-fc19e3d5c70b7b321ad237651a7e75efcd252c68.tar.xz
org.eclipse.papyrus-fc19e3d5c70b7b321ad237651a7e75efcd252c68.zip
- Added //$NON-NLS-1$ tags
- Added hasStereotypeTree funtion to GenUtils
Diffstat (limited to 'extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/StdStereo.java2
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java12
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java3
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl2
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java5
5 files changed, 13 insertions, 11 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/StdStereo.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/StdStereo.java
index b27a63cd525..16e8aec7fed 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/StdStereo.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/StdStereo.java
@@ -11,7 +11,7 @@
package org.eclipse.papyrus.cpp.codegen;
-import org.eclipse.papyrus.cpp.codegen.utils.GenUtils;
+import org.eclipse.papyrus.acceleo.GenUtils;
import org.eclipse.uml2.uml.Element;
public class StdStereo {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java
index d9986d37fc9..70dce57d00f 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java
@@ -22,15 +22,15 @@ import org.eclipse.papyrus.C_Cpp.ManualGeneration;
import org.eclipse.papyrus.C_Cpp.NoCodeGen;
import org.eclipse.papyrus.C_Cpp.Template;
import org.eclipse.papyrus.acceleo.AcceleoDriver;
+import org.eclipse.papyrus.acceleo.GenUtils;
import org.eclipse.papyrus.acceleo.ModelElementsCreator;
import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils;
-import org.eclipse.papyrus.cpp.codegen.utils.GenUtils;
-import org.eclipse.papyrus.cpp.profile.StUtils;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Namespace;
import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.util.UMLUtil;
@@ -99,10 +99,10 @@ public class CppModelElementsCreator extends ModelElementsCreator {
// treat case of manual code generation
if(GenUtils.hasStereotype(classifier, ManualGeneration.class)) {
- ManualGeneration mg = StUtils.getApplication(classifier, ManualGeneration.class);
- Include cppInclude = StUtils.getApplication(classifier, Include.class);
+ ManualGeneration mg = UMLUtil.getStereotypeApplication(classifier, ManualGeneration.class);
+ Include cppInclude = UMLUtil.getStereotypeApplication(classifier, Include.class);
String fileContent = commentHeader + cppInclude.getHeader();
- createFile(container, classifier.getName() + "." + hppExt, fileContent, true);
+ createFile(container, classifier.getName() + "." + hppExt, fileContent, true); //$NON-NLS-1$
String manualURI = "TODO"; // fileContent = AcceleoDriver.evaluateURI(new URI(CppPackageHeader)), classifier);
@@ -115,7 +115,7 @@ public class CppModelElementsCreator extends ModelElementsCreator {
}
// Only generate when no CppNoCodeGen stereotype is applied to the class
- else if((!GenUtils.hasStereotype(classifier, NoCodeGen.class)) && (!GenUtils.hasStereotype(classifier, External.class)) && (!GenUtils.hasStereotype(classifier, Template.class))) {
+ else if((!GenUtils.hasStereotypeTree(classifier, NoCodeGen.class)) && (!GenUtils.hasStereotype(classifier, External.class)) && (!GenUtils.hasStereotype(classifier, Template.class))) {
// Template Bound Class
if(GenUtils.isTemplateBoundElement(classifier)) {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
index 3fa445e0adb..0b74e6c3570 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java
@@ -33,6 +33,7 @@ import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.ParameterableElement;
import org.eclipse.uml2.uml.PrimitiveType;
import org.eclipse.uml2.uml.TemplateParameter;
+import org.eclipse.uml2.uml.util.UMLUtil;
@@ -276,7 +277,7 @@ public class CppGenUtils {
*/
public static String getGeneralizationVisibility(Element element) {
// get visibility and target name
- Visibility cppVisibility = GenUtils.getApplication(element, Visibility.class);
+ Visibility cppVisibility = UMLUtil.getStereotypeApplication(element, Visibility.class);
if(cppVisibility != null) {
return cppVisibility.getValue();
} else {
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl
index 85a8711232e..98dedb83e9f 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl
@@ -14,7 +14,7 @@
/]
[query public getTemplateTypeName(arg0 : TemplateParameter) : String
- = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getType(org.eclipse.uml2.uml.TemplateParameter)', Sequence{arg0})
+ = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getTemplateTypeName(org.eclipse.uml2.uml.TemplateParameter)', Sequence{arg0})
/]
[query public getNamespace(arg0 : NamedElement) : String
diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java
index 81389c8a0de..adc21bc8024 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java
@@ -24,6 +24,7 @@ import org.eclipse.uml2.uml.Operation;
import org.eclipse.uml2.uml.Parameter;
import org.eclipse.uml2.uml.ParameterDirectionKind;
import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.util.UMLUtil;
/**
@@ -71,7 +72,7 @@ public class Modifier {
public static void update(Element propertyOperationOrParameter) {
// Pointer
- Ptr cppPtr = GenUtils.getApplication(propertyOperationOrParameter, Ptr.class);
+ Ptr cppPtr = UMLUtil.getStereotypeApplication(propertyOperationOrParameter, Ptr.class);
if(cppPtr != null) {
ptr = (cppPtr.getDeclaration() != null) ? cppPtr.getDeclaration() : "*"; //$NON-NLS-1$
} else {
@@ -88,7 +89,7 @@ public class Modifier {
GenUtils.hasStereotype(propertyOperationOrParameter, Ptr.class);
// Array
- Array cppArray = GenUtils.getApplication(propertyOperationOrParameter, Array.class);
+ Array cppArray = UMLUtil.getStereotypeApplication(propertyOperationOrParameter, Array.class);
if(cppArray != null) {
// explicit array definition
array = (cppArray.getDefinition() != null) ? cppArray.getDefinition() : "[]"; //$NON-NLS-1$

Back to the top