Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2019-02-16 11:15:15 -0500
committerJuergen Haug2019-02-25 06:31:01 -0500
commit621741b7bf2b94027b69accbc57f8f520532a5d2 (patch)
treea57704e7b3bd5b9c3e362402f131291db4b3ab8d /plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator
parenta7b0badaed395687bf9e9cc6fe13b38b7e8ef50e (diff)
downloadorg.eclipse.etrice-621741b7bf2b94027b69accbc57f8f520532a5d2.tar.gz
org.eclipse.etrice-621741b7bf2b94027b69accbc57f8f520532a5d2.tar.xz
org.eclipse.etrice-621741b7bf2b94027b69accbc57f8f520532a5d2.zip
Bug 544723 - [room] Add annotation for deprecated elements
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend9
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend4
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend7
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/EnumerationTypeGen.xtend13
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend10
5 files changed, 18 insertions, 25 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend
index b8ad9fb1a..65c69abac 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend
@@ -21,31 +21,28 @@ import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass
import org.eclipse.etrice.core.room.ActorClass
-import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
+import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
-import org.eclipse.etrice.core.room.util.RoomHelpers
-
@Singleton
class ActorClassDataGen {
@Inject IGeneratorFileIO fileIO
@Inject extension RoomHelpers
@Inject extension RoomExtensions
- @Inject extension FileSystemHelpers
@Inject extension ProcedureHelpers
def doGenerate(Root root) {
val HashMap<ActorClass, WiredActorClass> ac2wired = new HashMap<ActorClass, WiredActorClass>
root.wiredInstances.filter(w|w instanceof WiredActorClass).forEach[w|ac2wired.put((w as WiredActorClass).actorClass, w as WiredActorClass)]
- for (xpac: root.actorClasses.filter[isValidGenerationLocation].map[root.getExpandedActorClass(it)]) {
+ root.actorClasses.filter[!isDeprecatedGeneration].map[root.getExpandedActorClass(it)].forEach[xpac |
val wired = ac2wired.get(xpac.actorClass)
val path = xpac.actorClass.getPath
var file = xpac.actorClass.name+"_DataObject.java"
fileIO.generateFile("generating ActorClass implementation", path + file, root.generate(xpac, wired))
- }
+ ]
}
def generate(Root root, ExpandedActorClass xpac, WiredActorClass wired) {
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend
index 13e19f72e..50120f34a 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend
@@ -62,7 +62,7 @@ class ActorClassGen extends GenericActorClassGenerator {
def doGenerate(Root root) {
val HashMap<ActorClass, WiredActorClass> ac2wired = new HashMap<ActorClass, WiredActorClass>
root.wiredInstances.filter(w|w instanceof WiredActorClass).forEach[w|ac2wired.put((w as WiredActorClass).actorClass, w as WiredActorClass)]
- for (xpac: root.actorClasses.filter[isValidGenerationLocation].map[root.getExpandedActorClass(it)]) {
+ root.actorClasses.filter[!isDeprecatedGeneration].map[root.getExpandedActorClass(it)].forEach[xpac |
val wired = ac2wired.get(xpac.actorClass)
val manualBehavior = xpac.actorClass.isBehaviorAnnotationPresent("BehaviorManual")
val path = xpac.actorClass.getPath
@@ -70,7 +70,7 @@ class ActorClassGen extends GenericActorClassGenerator {
if (manualBehavior)
file = "Abstract"+file
fileIO.generateFile("generating ActorClass implementation", path + file, root.generate(xpac, wired, manualBehavior))
- }
+ ]
}
def generate(Root root, ExpandedActorClass xpac, WiredActorClass wired, boolean manualBehavior) {
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend
index a3f909696..28c34dacb 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend
@@ -23,7 +23,6 @@ import org.eclipse.etrice.core.room.ComplexType
import org.eclipse.etrice.core.room.DataClass
import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
-import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
@@ -35,15 +34,15 @@ class DataClassGen {
@Inject extension RoomExtensions
@Inject extension ProcedureHelpers
@Inject extension Initialization
- @Inject extension FileSystemHelpers
+ @Inject extension RoomHelpers
@Inject RoomHelpers roomHelpers
def doGenerate(Root root) {
- for (dc: root.dataClasses.filter(cl|cl.isValidGenerationLocation)) {
+ root.dataClasses.filter[!isDeprecatedGeneration].forEach[dc |
var path = dc.getPath
var file = dc.getJavaFileName
fileIO.generateFile("generating DataClass implementation", path + file, root.generate(dc))
- }
+ ]
}
def generate(Root root, DataClass dc) {
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/EnumerationTypeGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/EnumerationTypeGen.xtend
index 9bdfa987b..e92243555 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/EnumerationTypeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/EnumerationTypeGen.xtend
@@ -14,13 +14,12 @@
package org.eclipse.etrice.generator.java.gen
-import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
import com.google.inject.Inject
-import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.room.EnumerationType
-
-import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
+import org.eclipse.etrice.core.room.util.RoomHelpers
+import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
+import org.eclipse.etrice.generator.generic.RoomExtensions
/**
* @author Henrik Rentz-Reichert
@@ -31,14 +30,14 @@ class EnumerationTypeGen {
@Inject IGeneratorFileIO fileIO
@Inject extension JavaExtensions
@Inject extension RoomExtensions
- @Inject extension FileSystemHelpers
+ @Inject extension RoomHelpers
def doGenerate(Root root) {
- for (et: root.enumClasses.filter(cl|cl.isValidGenerationLocation)) {
+ root.enumClasses.filter[!isDeprecatedGeneration].forEach[ et |
var path = et.getPath
var file = et.getJavaFileName
fileIO.generateFile("generating Enumeration implementation", path + file, root.generate(et))
- }
+ ]
}
def generate(Root root, EnumerationType et) {
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
index 749a6a1b3..57780cb3e 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
@@ -17,19 +17,18 @@ package org.eclipse.etrice.generator.java.gen
import com.google.inject.Inject
import com.google.inject.Singleton
import org.eclipse.etrice.core.genmodel.etricegen.Root
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician
import org.eclipse.etrice.core.room.CommunicationType
import org.eclipse.etrice.core.room.DataClass
import org.eclipse.etrice.core.room.Message
import org.eclipse.etrice.core.room.ProtocolClass
-import org.eclipse.etrice.generator.fsm.base.FileSystemHelpers
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator
+import org.eclipse.etrice.generator.generic.ILanguageExtension
import org.eclipse.etrice.generator.generic.ProcedureHelpers
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.TypeHelpers
import org.eclipse.etrice.generator.java.Main
-import org.eclipse.etrice.generator.generic.ILanguageExtension
-import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician
import org.eclipse.etrice.generator.java.setup.GeneratorOptionsHelper
@Singleton
@@ -42,12 +41,11 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
@Inject extension Initialization
@Inject extension TypeHelpers
@Inject extension DataClassGen
- @Inject extension FileSystemHelpers
@Inject protected extension GeneratorOptionsHelper
@Inject IDiagnostician diagnostician
def doGenerate(Root root) {
- for (pc: root.protocolClasses.filter(cl|cl.isValidGenerationLocation)) {
+ root.protocolClasses.filter[!isDeprecatedGeneration].forEach[pc |
val path = pc.getPath
val file = pc.getJavaFileName
val contents =
@@ -63,7 +61,7 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
diagnostician.error("synchronous protocols not supported yet", pc, null)
else
fileIO.generateFile("generating ProtocolClass implementation", path + file, contents)
- }
+ ]
}
def generate(Root root, ProtocolClass pc) {'''

Back to the top