Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-12-11 15:34:08 +0000
committerHenrik Rentz-Reichert2012-12-11 15:34:08 +0000
commitdaac5384b47ad472c9cbbc8ba44d2392d6783c0e (patch)
tree40cfd2989a9ccd7d436e7f97e675897012165abe
parent7d7ac4ccb0bb1e7c3b8f85c3b0576ea6d3848812 (diff)
downloadorg.eclipse.etrice-daac5384b47ad472c9cbbc8ba44d2392d6783c0e.tar.gz
org.eclipse.etrice-daac5384b47ad472c9cbbc8ba44d2392d6783c0e.tar.xz
org.eclipse.etrice-daac5384b47ad472c9cbbc8ba44d2392d6783c0e.zip
[generator.*] MODEL_LOCATION tag translation in default implementation
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CTranslationProvider.java20
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java11
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaTranslationProvider.java15
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/DefaultTranslationProvider.java15
4 files changed, 21 insertions, 40 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CTranslationProvider.java b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CTranslationProvider.java
index 87e6bf130..22f534b08 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CTranslationProvider.java
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CTranslationProvider.java
@@ -14,7 +14,6 @@ package org.eclipse.etrice.generator.c.gen;
import java.util.ArrayList;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.CommunicationType;
@@ -27,17 +26,15 @@ import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RoomClass;
import org.eclipse.etrice.core.room.SAPRef;
import org.eclipse.etrice.core.room.SPPRef;
-import org.eclipse.etrice.core.genmodel.base.ILogger;
-import org.eclipse.etrice.generator.base.ITranslationProvider;
-import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.etrice.generator.base.DefaultTranslationProvider;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
+import org.eclipse.etrice.generator.generic.RoomExtensions;
import com.google.inject.Inject;
-public class CTranslationProvider implements ITranslationProvider {
+public class CTranslationProvider extends DefaultTranslationProvider {
@Inject private RoomExtensions roomExt;
- @Inject ILogger logger;
@Inject ILanguageExtension langExt;
@Override
@@ -144,15 +141,8 @@ public class CTranslationProvider implements ITranslationProvider {
public String translateTag(String tag, DetailCode code) {
if (tag.equals("ifitem.index"))
return "((etReplSubPort*)ifitem)->index";
-
- if (tag.equals("MODEL_LOCATION")) {
- return RoomNameProvider.getDetailCodeLocation(code);
- }
-
- logger.logInfo("unrecognized tag '"+tag+"' in "
- +RoomNameProvider.getDetailCodeLocation(code)+" of "
- +RoomNameProvider.getClassLocation(RoomNameProvider.getModelClass(code)));
- return TAG_START+"?"+tag+"?"+TAG_END;
+
+ return super.translateTag(tag, code);
}
private String getOrigComment(String orig) {
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java
index 9767452e9..79d54f867 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/CppTranslationProvider.java
@@ -14,23 +14,17 @@ package org.eclipse.etrice.generator.cpp.gen;
import java.util.ArrayList;
-import org.eclipse.etrice.core.genmodel.base.ILogger;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
import org.eclipse.etrice.core.room.DetailCode;
import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.generator.base.DefaultTranslationProvider;
-import com.google.inject.Inject;
-
/**
* @author hrentz
*
*/
public class CppTranslationProvider extends DefaultTranslationProvider {
- @Inject ILogger logger;
-
@Override
public boolean translateMembers() {
return true;
@@ -60,10 +54,7 @@ public class CppTranslationProvider extends DefaultTranslationProvider {
if (tag.equals("ifitem.index"))
return "ifitem.getIdx()";
- logger.logInfo("unrecognized tag '"+tag+"' in "
- +RoomNameProvider.getDetailCodeLocation(code)+" of "
- +RoomNameProvider.getClassLocation(RoomNameProvider.getModelClass(code)));
- return TAG_START+"?"+tag+"?"+TAG_END;
+ return super.translateTag(tag, code);
}
}
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaTranslationProvider.java b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaTranslationProvider.java
index be430db18..fb6e088cb 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaTranslationProvider.java
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/JavaTranslationProvider.java
@@ -14,15 +14,11 @@ package org.eclipse.etrice.generator.java.gen;
import java.util.ArrayList;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.DetailCode;
import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.generator.base.DefaultTranslationProvider;
-import org.eclipse.etrice.core.genmodel.base.ILogger;
-
-import com.google.inject.Inject;
/**
* @author hrentz
@@ -30,8 +26,6 @@ import com.google.inject.Inject;
*/
public class JavaTranslationProvider extends DefaultTranslationProvider {
- @Inject ILogger logger;
-
@Override
public boolean translateMembers() {
return true;
@@ -71,14 +65,7 @@ public class JavaTranslationProvider extends DefaultTranslationProvider {
if (tag.equals("ifitem.index"))
return "ifitem.getIdx()";
- if (tag.equals("MODEL_LOCATION")) {
- return RoomNameProvider.getDetailCodeLocation(code);
- }
-
- logger.logInfo("unrecognized tag '"+tag+"' in "
- +RoomNameProvider.getDetailCodeLocation(code)+" of "
- +RoomNameProvider.getClassLocation(RoomNameProvider.getModelClass(code)));
- return TAG_START+"?"+tag+"?"+TAG_END;
+ return super.translateTag(tag, code);
}
}
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/DefaultTranslationProvider.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/DefaultTranslationProvider.java
index 16de1af80..9fabb14c7 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/DefaultTranslationProvider.java
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/DefaultTranslationProvider.java
@@ -14,6 +14,8 @@ package org.eclipse.etrice.generator.base;
import java.util.ArrayList;
+import org.eclipse.etrice.core.genmodel.base.ILogger;
+import org.eclipse.etrice.core.naming.RoomNameProvider;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.DetailCode;
@@ -21,8 +23,12 @@ import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.Operation;
+import com.google.inject.Inject;
+
public class DefaultTranslationProvider implements ITranslationProvider {
+ @Inject ILogger logger;
+
@Override
public boolean translateMembers() {
return false;
@@ -60,7 +66,14 @@ public class DefaultTranslationProvider implements ITranslationProvider {
@Override
public String translateTag(String tag, DetailCode code) {
- return TAG_START+tag+TAG_END;
+ if (tag.equals("MODEL_LOCATION")) {
+ return RoomNameProvider.getDetailCodeLocation(code);
+ }
+
+ logger.logInfo("unrecognized tag '"+tag+"' in "
+ +RoomNameProvider.getDetailCodeLocation(code)+" of "
+ +RoomNameProvider.getClassLocation(RoomNameProvider.getModelClass(code)));
+ return TAG_START+"?"+tag+"?"+TAG_END;
}
@Override

Back to the top