Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2013-03-05 09:27:38 -0500
committerJuergen Haug2013-03-06 10:04:46 -0500
commit42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23 (patch)
tree2352fa3b78e5e72969a52696b5a5450034d2d40f /plugins/org.eclipse.etrice.core.config
parent91fe7f5032f5bc365ac0530d53d67567ce932174 (diff)
downloadorg.eclipse.etrice-42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23.tar.gz
org.eclipse.etrice-42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23.tar.xz
org.eclipse.etrice-42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23.zip
[core] (Bug 398876) add documentation to Xtext generated meta
models activated xtend2 support Change-Id: I448bc6724c3a8a6b3ba325486e1fb01b1d5f0597
Diffstat (limited to 'plugins/org.eclipse.etrice.core.config')
-rw-r--r--plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore8
-rw-r--r--plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java8
-rw-r--r--plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java34
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext75
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend37
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend69
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java22
-rw-r--r--plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java10
-rw-r--r--plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java87
9 files changed, 254 insertions, 96 deletions
diff --git a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore
index 5a4e3c07e..832c29af7 100644
--- a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore
+++ b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore
@@ -4,22 +4,22 @@
<eClassifiers xsi:type="ecore:EClass" name="ConfigModel">
<eOperations name="getActorClassConfigs" upperBound="-1" eType="#//ActorClassConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorClassConfig>();&#xD;&#xA;&#x9; &#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9; &#x9;&#x9;&#x9;&#x9;if(element instanceof ActorClassConfig)&#xD;&#xA;&#x9; &#x9;&#x9;&#x9;&#x9;&#x9;list.add((ActorClassConfig) element);&#xD;&#xA;&#x9; &#x9;&#x9; return list;"/>
+ <details key="body" value="EList&lt;ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorClassConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof ActorClassConfig)&#xD;&#xA;&#x9;&#x9;list.add((ActorClassConfig) element);&#xD;&#xA;return list;&#xD;&#xA;"/>
</eAnnotations>
</eOperations>
<eOperations name="getActorInstanceConfigs" upperBound="-1" eType="#//ActorInstanceConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorInstanceConfig>();&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;&#x9;&#x9; &#x9;&#x9;if(element instanceof ActorInstanceConfig)&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;list.add((ActorInstanceConfig) element);&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;return list;"/>
+ <details key="body" value="EList&lt;ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorInstanceConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof ActorInstanceConfig)&#xD;&#xA;&#x9;&#x9;list.add((ActorInstanceConfig) element);&#xD;&#xA;return list;"/>
</eAnnotations>
</eOperations>
<eOperations name="getProtocolClassConfigs" upperBound="-1" eType="#//ProtocolClassConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ProtocolClassConfig>();&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;&#x9;&#x9; &#x9;&#x9;if(element instanceof ProtocolClassConfig)&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;list.add((ProtocolClassConfig) element);&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;return list;"/>
+ <details key="body" value="EList&lt;ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ProtocolClassConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof ProtocolClassConfig)&#xD;&#xA;&#x9;&#x9;list.add((ProtocolClassConfig) element);&#xD;&#xA;return list;&#xD;&#xA;"/>
</eAnnotations>
</eOperations>
<eOperations name="getSubSystemConfigs" upperBound="-1" eType="#//SubSystemConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;SubSystemConfig>();&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;&#x9;&#x9; &#x9;&#x9;if(element instanceof SubSystemConfig)&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;list.add((SubSystemConfig) element);&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;return list;"/>
+ <details key="body" value="EList&lt;SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;SubSystemConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof SubSystemConfig)&#xD;&#xA;&#x9;&#x9;list.add((SubSystemConfig) element);&#xD;&#xA;return list;"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
diff --git a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java
index ad8430e70..7344b6a92 100644
--- a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java
+++ b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java
@@ -88,7 +88,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();\r\n\t \t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t \t\t\t\tif(element instanceof ActorClassConfig)\r\n\t \t\t\t\t\tlist.add((ActorClassConfig) element);\r\n\t \t\t return list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof ActorClassConfig)\r\n\t\tlist.add((ActorClassConfig) element);\r\nreturn list;\r\n'"
* @generated
*/
EList<ActorClassConfig> getActorClassConfigs();
@@ -97,7 +97,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();\r\n\t\t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t\t\t \t\tif(element instanceof ActorInstanceConfig)\r\n\t\t\t\t\t\tlist.add((ActorInstanceConfig) element);\r\n\t\t\t\treturn list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof ActorInstanceConfig)\r\n\t\tlist.add((ActorInstanceConfig) element);\r\nreturn list;'"
* @generated
*/
EList<ActorInstanceConfig> getActorInstanceConfigs();
@@ -106,7 +106,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();\r\n\t\t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t\t\t \t\tif(element instanceof ProtocolClassConfig)\r\n\t\t\t\t\t\tlist.add((ProtocolClassConfig) element);\r\n\t\t\t\treturn list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof ProtocolClassConfig)\r\n\t\tlist.add((ProtocolClassConfig) element);\r\nreturn list;\r\n'"
* @generated
*/
EList<ProtocolClassConfig> getProtocolClassConfigs();
@@ -115,7 +115,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();\r\n\t\t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t\t\t \t\tif(element instanceof SubSystemConfig)\r\n\t\t\t\t\t\tlist.add((SubSystemConfig) element);\r\n\t\t\t\treturn list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof SubSystemConfig)\r\n\t\tlist.add((SubSystemConfig) element);\r\nreturn list;'"
* @generated
*/
EList<SubSystemConfig> getSubSystemConfigs();
diff --git a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java
index 1ce0df62a..006bc1e2c 100644
--- a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java
+++ b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java
@@ -164,10 +164,11 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<ActorClassConfig> getActorClassConfigs()
{
EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorClassConfig)
- list.add((ActorClassConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorClassConfig)
+ list.add((ActorClassConfig) element);
+ return list;
+
}
/**
@@ -178,10 +179,10 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<ActorInstanceConfig> getActorInstanceConfigs()
{
EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorInstanceConfig)
- list.add((ActorInstanceConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorInstanceConfig)
+ list.add((ActorInstanceConfig) element);
+ return list;
}
/**
@@ -192,10 +193,11 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<ProtocolClassConfig> getProtocolClassConfigs()
{
EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ProtocolClassConfig)
- list.add((ProtocolClassConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ProtocolClassConfig)
+ list.add((ProtocolClassConfig) element);
+ return list;
+
}
/**
@@ -206,10 +208,10 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<SubSystemConfig> getSubSystemConfigs()
{
EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof SubSystemConfig)
- list.add((SubSystemConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof SubSystemConfig)
+ list.add((SubSystemConfig) element);
+ return list;
}
/**
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext
index 8b65ca514..8614ef026 100644
--- a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext
@@ -10,77 +10,8 @@
*
*******************************************************************************/
-import ecore;
import xtext;
-import room;
-process(xtext::GeneratedMetamodel this) :
- process(ePackage)
-;
-
-process(ecore::EPackage this) :
- this.eClassifiers.typeSelect(ecore::EClass).process()
-;
-
-process(EClass this) :
- switch(name){
- case("ConfigModel"):
- (addOperation(
- "getActorClassConfigs",
- ePackage.getEClassifier("ActorClassConfig"),
- -1,
- 'EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorClassConfig)
- list.add((ActorClassConfig) element);
- return list;'
- )->addOperation(
- "getActorInstanceConfigs",
- ePackage.getEClassifier("ActorInstanceConfig"),
- -1,
- 'EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorInstanceConfig)
- list.add((ActorInstanceConfig) element);
- return list;'
- )->addOperation(
- "getProtocolClassConfigs",
- ePackage.getEClassifier("ProtocolClassConfig"),
- -1,
- 'EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ProtocolClassConfig)
- list.add((ProtocolClassConfig) element);
- return list;'
- )->addOperation(
- "getSubSystemConfigs",
- ePackage.getEClassifier("SubSystemConfig"),
- -1,
- 'EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof SubSystemConfig)
- list.add((SubSystemConfig) element);
- return list;'
- ))
- default: null
- }
-;
-
-
-
-create ecore::EOperation addOperation(ecore::EClassifier c, String strName, ecore::EClassifier type, Integer upperBound, String strBody):
- setName(strName) ->
- setEType(type) ->
- setUpperBound(upperBound)->
- addBodyAnnotation(strBody)->
- ((ecore::EClass)c).eOperations.add(this);
-
-create ecore::EAnnotation addBodyAnnotation(ecore::EOperation op, String strBody):
- setSource("http://www.eclipse.org/emf/2002/GenModel") ->
- this.createBody(strBody) ->
- op.eAnnotations.add(this);
-
-create ecore::EStringToStringMapEntry createBody(ecore::EAnnotation anno, String strBody):
- setKey("body") ->
- setValue(strBody) ->
- anno.details.add(this);
+process(GeneratedMetamodel this) :
+ JAVA org.eclipse.etrice.core.postprocessing.PostprocessorController.process(org.eclipse.xtext.GeneratedMetamodel)
+; \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
new file mode 100644
index 000000000..fb33a36fc
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.emf.ecore.util.EcoreUtil.*
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class DocuPostprocessor {
+
+ def process(GeneratedMetamodel metamodel) {
+// var pckg = metamodel.EPackage
+//
+// var mdl = pckg.getClass("ConfigModel")
+// mdl.setDocumentation(
+// '''
+// <br>
+// ''')
+//
+// mdl.getAttribute("name").setDocumentation(
+// '''
+// <br>
+// ''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend
new file mode 100644
index 000000000..1fd64822f
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class ImplPostProcessing {
+
+ def process(GeneratedMetamodel metamodel) {
+ var configPackage = metamodel.EPackage
+
+ var configModel = configPackage.getClass("ConfigModel")
+ configModel.addOperation(
+ "getActorClassConfigs",
+ configPackage.getEClassifier("ActorClassConfig"),
+ -1,
+ '''
+ EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorClassConfig)
+ list.add((ActorClassConfig) element);
+ return list;
+ ''')
+ configModel.addOperation(
+ "getActorInstanceConfigs",
+ configPackage.getEClassifier("ActorInstanceConfig"),
+ -1,
+ '''
+ EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorInstanceConfig)
+ list.add((ActorInstanceConfig) element);
+ return list;''')
+ configModel.addOperation(
+ "getProtocolClassConfigs",
+ configPackage.getEClassifier("ProtocolClassConfig"),
+ -1,
+ '''
+ EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ProtocolClassConfig)
+ list.add((ProtocolClassConfig) element);
+ return list;
+ ''')
+ configModel.addOperation(
+ "getSubSystemConfigs",
+ configPackage.getEClassifier("SubSystemConfig"),
+ -1,
+ '''
+ EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof SubSystemConfig)
+ list.add((SubSystemConfig) element);
+ return list;''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java
new file mode 100644
index 000000000..9b90b83ab
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+public class PostprocessorController {
+ public static void process(GeneratedMetamodel metamodel){
+ new DocuPostprocessor().process(metamodel);
+ new ImplPostProcessing().process(metamodel);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java
new file mode 100644
index 000000000..9c18df4e3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java
@@ -0,0 +1,10 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class DocuPostprocessor {
+ public Object process(final GeneratedMetamodel metamodel) {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java
new file mode 100644
index 000000000..873d23dd6
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java
@@ -0,0 +1,87 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.etrice.core.postprocessing.PostprocessingHelpers;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class ImplPostProcessing {
+ public boolean process(final GeneratedMetamodel metamodel) {
+ boolean _xblockexpression = false;
+ {
+ EPackage configPackage = metamodel.getEPackage();
+ EClass configModel = PostprocessingHelpers.getClass(configPackage, "ConfigModel");
+ EClassifier _eClassifier = configPackage.getEClassifier("ActorClassConfig");
+ int _minus = (-1);
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();");
+ _builder.newLine();
+ _builder.append("for(ConfigElement element : this.getConfigElements())");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if(element instanceof ActorClassConfig)");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("list.add((ActorClassConfig) element);");
+ _builder.newLine();
+ _builder.append("return list;");
+ _builder.newLine();
+ PostprocessingHelpers.addOperation(configModel,
+ "getActorClassConfigs", _eClassifier, Integer.valueOf(_minus), _builder.toString());
+ EClassifier _eClassifier_1 = configPackage.getEClassifier("ActorInstanceConfig");
+ int _minus_1 = (-1);
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append("EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();");
+ _builder_1.newLine();
+ _builder_1.append("for(ConfigElement element : this.getConfigElements())");
+ _builder_1.newLine();
+ _builder_1.append("\t");
+ _builder_1.append("if(element instanceof ActorInstanceConfig)");
+ _builder_1.newLine();
+ _builder_1.append("\t\t");
+ _builder_1.append("list.add((ActorInstanceConfig) element);");
+ _builder_1.newLine();
+ _builder_1.append("return list;");
+ PostprocessingHelpers.addOperation(configModel,
+ "getActorInstanceConfigs", _eClassifier_1, Integer.valueOf(_minus_1), _builder_1.toString());
+ EClassifier _eClassifier_2 = configPackage.getEClassifier("ProtocolClassConfig");
+ int _minus_2 = (-1);
+ StringConcatenation _builder_2 = new StringConcatenation();
+ _builder_2.append("EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();");
+ _builder_2.newLine();
+ _builder_2.append("for(ConfigElement element : this.getConfigElements())");
+ _builder_2.newLine();
+ _builder_2.append("\t");
+ _builder_2.append("if(element instanceof ProtocolClassConfig)");
+ _builder_2.newLine();
+ _builder_2.append("\t\t");
+ _builder_2.append("list.add((ProtocolClassConfig) element);");
+ _builder_2.newLine();
+ _builder_2.append("return list;");
+ _builder_2.newLine();
+ PostprocessingHelpers.addOperation(configModel,
+ "getProtocolClassConfigs", _eClassifier_2, Integer.valueOf(_minus_2), _builder_2.toString());
+ EClassifier _eClassifier_3 = configPackage.getEClassifier("SubSystemConfig");
+ int _minus_3 = (-1);
+ StringConcatenation _builder_3 = new StringConcatenation();
+ _builder_3.append("EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();");
+ _builder_3.newLine();
+ _builder_3.append("for(ConfigElement element : this.getConfigElements())");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("if(element instanceof SubSystemConfig)");
+ _builder_3.newLine();
+ _builder_3.append("\t\t");
+ _builder_3.append("list.add((SubSystemConfig) element);");
+ _builder_3.newLine();
+ _builder_3.append("return list;");
+ boolean _addOperation = PostprocessingHelpers.addOperation(configModel,
+ "getSubSystemConfigs", _eClassifier_3, Integer.valueOf(_minus_3), _builder_3.toString());
+ _xblockexpression = (_addOperation);
+ }
+ return _xblockexpression;
+ }
+}

Back to the top