Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2013-12-10 12:14:55 -0500
committerJuergen Haug2013-12-11 11:26:23 -0500
commit560d916180e0ea081ef1228270470f6d355177ab (patch)
tree47a6614f13043a89e94d50e551fa708660439c64 /plugins/org.eclipse.etrice.generator.config
parent9e7bc7e8513767a6d5ba506cd0209b09e831a840 (diff)
downloadorg.eclipse.etrice-560d916180e0ea081ef1228270470f6d355177ab.tar.gz
org.eclipse.etrice-560d916180e0ea081ef1228270470f6d355177ab.tar.xz
org.eclipse.etrice-560d916180e0ea081ef1228270470f6d355177ab.zip
[config] added dynamic config for enum + validation + fixes
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.config')
-rw-r--r--plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend9
-rw-r--r--plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java13
2 files changed, 12 insertions, 10 deletions
diff --git a/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend b/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend
index b5d1e0c1f..260ce9ea2 100644
--- a/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend
+++ b/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend
@@ -39,6 +39,7 @@ import org.eclipse.etrice.generator.base.IDataConfiguration
import org.eclipse.etrice.generator.base.IResourceURIAcceptor
import org.eclipse.etrice.generator.config.util.DataConfigurationHelper
import org.eclipse.xtext.scoping.impl.ImportUriResolver
+import java.util.HashSet
class DataConfiguration implements IDataConfiguration {
@@ -162,17 +163,17 @@ class DataConfiguration implements IDataConfiguration {
}
override getDynConfigReadAttributes(ActorClass actor) {
- val result = new ArrayList<Attribute>
+ val result = new HashSet<Attribute>
var configs = DataConfigurationHelper::dynActorClassAttrMap.get(actor)
configs?.forEach(c|if(c.readOnly) result.add(c.attribute))
- return result
+ return result.toList
}
override getDynConfigWriteAttributes(ActorClass actor) {
- val result = new ArrayList<Attribute>
+ val result = new HashSet<Attribute>
var configs = DataConfigurationHelper::dynActorClassAttrMap.get(actor)
configs?.forEach(c|if(!c.readOnly) result.add(c.attribute))
- return result
+ return result.toList
}
override void addReferencedModels(IResourceURIAcceptor acceptor, EObject root) {
diff --git a/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java b/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java
index dca84345d..0bf7c2b15 100644
--- a/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java
+++ b/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java
@@ -13,6 +13,7 @@ package org.eclipse.etrice.generator.config;
import com.google.common.base.Objects;
import com.google.inject.Inject;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.EList;
@@ -436,8 +437,8 @@ public class DataConfiguration implements IDataConfiguration {
}
public List<Attribute> getDynConfigReadAttributes(final ActorClass actor) {
- ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
- final ArrayList<Attribute> result = _arrayList;
+ HashSet<Attribute> _hashSet = new HashSet<Attribute>();
+ final HashSet<Attribute> result = _hashSet;
List<AttrInstanceConfig> configs = DataConfigurationHelper.dynActorClassAttrMap.get(actor);
if (configs!=null) {
final Procedure1<AttrInstanceConfig> _function = new Procedure1<AttrInstanceConfig>() {
@@ -451,12 +452,12 @@ public class DataConfiguration implements IDataConfiguration {
};
IterableExtensions.<AttrInstanceConfig>forEach(configs, _function);
}
- return result;
+ return IterableExtensions.<Attribute>toList(result);
}
public List<Attribute> getDynConfigWriteAttributes(final ActorClass actor) {
- ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
- final ArrayList<Attribute> result = _arrayList;
+ HashSet<Attribute> _hashSet = new HashSet<Attribute>();
+ final HashSet<Attribute> result = _hashSet;
List<AttrInstanceConfig> configs = DataConfigurationHelper.dynActorClassAttrMap.get(actor);
if (configs!=null) {
final Procedure1<AttrInstanceConfig> _function = new Procedure1<AttrInstanceConfig>() {
@@ -471,7 +472,7 @@ public class DataConfiguration implements IDataConfiguration {
};
IterableExtensions.<AttrInstanceConfig>forEach(configs, _function);
}
- return result;
+ return IterableExtensions.<Attribute>toList(result);
}
public void addReferencedModels(final IResourceURIAcceptor acceptor, final EObject root) {

Back to the top