Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2014-05-23 11:13:25 -0400
committerHenrik Rentz-Reichert2014-05-23 11:13:25 -0400
commit43973e0a96610e859727d62542df758f0bb7daee (patch)
tree5e7016dae9150f56f4c18904e941bfec2ee3b553
parent0a3344ce3ef12c5c5402dbe49fd96dec0ee941d9 (diff)
parent49541944944abded515e735b16f1ea7af65f541c (diff)
downloadorg.eclipse.etrice-43973e0a96610e859727d62542df758f0bb7daee.tar.gz
org.eclipse.etrice-43973e0a96610e859727d62542df758f0bb7daee.tar.xz
org.eclipse.etrice-43973e0a96610e859727d62542df758f0bb7daee.zip
Merge branch 'change/26756/8'
Conflicts: plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java Change-Id: Idbb5060dbf0bf80ec6a97fce3efb265fc6040928
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java31
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ReachabilityValidator.java25
-rw-r--r--plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/CustomValidatorManager.java247
-rw-r--r--plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/ICustomValidator.java66
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/plugin.xml8
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/RoomGenmodelValidator.java134
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedActorClassImpl.java43
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomModelValidator.java114
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java5
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomRuntimeModule.java27
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/IRoomValidator.java28
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java203
-rw-r--r--plugins/org.eclipse.etrice.doc/manual/etrice.pdf68
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java14
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGeneratorBaseModule.java6
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GenerationEMFDiagnostician.java43
-rw-r--r--runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jarbin8085 -> 8085 bytes
17 files changed, 730 insertions, 332 deletions
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java
index fd0909494..2769924ed 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java
@@ -13,11 +13,15 @@
package org.eclipse.etrice.abstractexec.behavior;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.common.validation.ICustomValidator;
import org.eclipse.etrice.core.genmodel.base.NullDiagnostician;
import org.eclipse.etrice.core.genmodel.base.NullLogger;
import org.eclipse.etrice.core.genmodel.builder.GeneratorModelBuilder;
@@ -29,12 +33,12 @@ import org.eclipse.etrice.core.room.GeneralProtocolClass;
import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.MessageFromIf;
import org.eclipse.etrice.core.room.ProtocolClass;
+import org.eclipse.etrice.core.room.RoomPackage;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.core.room.StateGraphItem;
import org.eclipse.etrice.core.room.Trigger;
import org.eclipse.etrice.core.room.TriggeredTransition;
import org.eclipse.etrice.core.room.util.RoomHelpers;
-import org.eclipse.etrice.core.validation.IRoomValidator;
import org.eclipse.etrice.core.validation.ValidationUtil;
import org.eclipse.xtext.validation.ValidationMessageAcceptor;
@@ -42,7 +46,7 @@ import org.eclipse.xtext.validation.ValidationMessageAcceptor;
* @author rentzhnr
*
*/
-public class AbstractExecutionValidator implements IRoomValidator {
+public class AbstractExecutionValidator implements ICustomValidator {
// c&p in tests
public static final String DIAG_CODE_VIOLATION_TRIGGER = "etrice.violation_trigger";
@@ -50,10 +54,13 @@ public class AbstractExecutionValidator implements IRoomValidator {
public static final String DIAG_CODE_MISSING_TRIGGER = "etrice.receive_message";
public static final String DIAG_CODE_MISSING_MESSAGESEND = "etrice.send_message";
+ private static final Set<EClass> classesToCheck = new HashSet<EClass>();
private static boolean traceExec = false;
private static String traceName = "";
static {
- if (Activator.getDefault().isDebugging()) {
+ classesToCheck.add(RoomPackage.Literals.ACTOR_CLASS);
+
+ if (Activator.getDefault() != null && Activator.getDefault().isDebugging()) {
String value = Platform
.getDebugOption("org.eclipse.etrice.abstractexec.behavior/trace/abstractexec");
if (value != null && value.equalsIgnoreCase(Boolean.toString(true))) {
@@ -64,21 +71,16 @@ public class AbstractExecutionValidator implements IRoomValidator {
}
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.etrice.core.validation.IRoomValidator#validate(org.eclipse
- * .emf.ecore.EObject,
- * org.eclipse.xtext.validation.ValidationMessageAcceptor)
- */
@Override
public void validate(EObject object,
- ValidationMessageAcceptor messageAcceptor) {
+ ValidationMessageAcceptor messageAcceptor, ICustomValidator.ValidationContext context) {
if (!(object instanceof ActorClass))
return;
+ if(context.isGeneration())
+ return;
+
ActorClass ac = (ActorClass) object;
if (traceExec) {
@@ -170,6 +172,11 @@ public class AbstractExecutionValidator implements IRoomValidator {
public String getDescription() {
return "This validator checks the state machine against the protocol semantics of its ports.";
}
+
+ @Override
+ public Set<EClass> getClassesToCheck() {
+ return classesToCheck;
+ }
private void createMarkersForProposals(ProposalGenerator propGen,
ValidationMessageAcceptor messageAcceptor, State st,
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ReachabilityValidator.java b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ReachabilityValidator.java
index 6a1ea8853..35b5ed6f0 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ReachabilityValidator.java
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ReachabilityValidator.java
@@ -14,31 +14,43 @@
package org.eclipse.etrice.abstractexec.behavior;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.common.validation.ICustomValidator;
import org.eclipse.etrice.core.genmodel.base.NullDiagnostician;
import org.eclipse.etrice.core.genmodel.base.NullLogger;
import org.eclipse.etrice.core.genmodel.builder.GeneratorModelBuilder;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.RoomPackage;
import org.eclipse.etrice.core.room.StateGraphItem;
-import org.eclipse.etrice.core.validation.IRoomValidator;
import org.eclipse.etrice.core.validation.ValidationUtil;
import org.eclipse.xtext.validation.ValidationMessageAcceptor;
-public class ReachabilityValidator implements IRoomValidator {
+public class ReachabilityValidator implements ICustomValidator {
public static final String DIAG_CODE_UNREACHABLE = "etrice.unreachable";
+ private static final Set<EClass> classesToCheck = new HashSet<EClass>();
+ {
+ classesToCheck.add(RoomPackage.Literals.ACTOR_CLASS);
+ }
+
@Override
- public void validate(EObject object, ValidationMessageAcceptor messageAcceptor) {
+ public void validate(EObject object, ValidationMessageAcceptor messageAcceptor, ICustomValidator.ValidationContext context) {
if (!(object instanceof ActorClass))
return;
-
+
+ if(context.isGeneration())
+ return;
+
ActorClass ac = (ActorClass) object;
if (ac.isAbstract())
@@ -93,4 +105,9 @@ public class ReachabilityValidator implements IRoomValidator {
return "This validator checks the reachability of state graph items.";
}
+ @Override
+ public Set<EClass> getClassesToCheck() {
+ return classesToCheck;
+ }
+
}
diff --git a/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/CustomValidatorManager.java b/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/CustomValidatorManager.java
new file mode 100644
index 000000000..307652478
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/CustomValidatorManager.java
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.validation;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.xtext.Constants;
+import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
+import org.eclipse.xtext.validation.Check;
+import org.eclipse.xtext.validation.CheckMode;
+import org.eclipse.xtext.validation.EValidatorRegistrar;
+import org.eclipse.xtext.validation.ValidationMessageAcceptor;
+
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.name.Named;
+
+/**
+ * Abstract manager for custom validators. <br>
+ * By default to be added through xtexts ComposedCheck and executes custom validators for current language from registry.
+ *
+ */
+public class CustomValidatorManager extends AbstractDeclarativeValidator {
+
+ public static final String VAL_CONTEXT_SETUP_KEY = CustomValidatorManager.class.getName() + ".contextSetup";
+ public static final String VAL_CONTEXT_SETUP_ECLIPSE = "eclipse";
+ public static final String VAL_CONTEXT_SETUP_STANDALONE = "standalone";
+
+ public static final String VAL_CONTEXT_TARGET_KEY = CustomValidatorManager.class.getName() + ".contextTarget";
+ public static final String VAL_CONTEXT_TARGET_RESOURCE = "resource";
+ public static final String VAL_CONTEXT_TARGET_GENERATION = "generation";
+
+ public static class RegistryImpl implements ICustomValidator.Registry{
+
+ private Map<String, List<ICustomValidator>> map = Maps.newHashMap();
+
+ @Override
+ public void add(String language, ICustomValidator validator) {
+ if(!map.containsKey(language))
+ map.put(language, new ArrayList<ICustomValidator>());
+
+ List<ICustomValidator> registered = map.get(language);
+ boolean alreadyRegistered = false;
+ for(ICustomValidator v : registered)
+ alreadyRegistered |= v.getClass().equals(validator.getClass());
+
+ if(!alreadyRegistered)
+ registered.add(validator);
+ }
+
+ @Override
+ public List<ICustomValidator> get(String language) {
+ if(map.containsKey(language))
+ return map.get(language);
+
+ return new ArrayList<ICustomValidator>();
+ }
+
+ }
+
+ public static class ValidationContextImpl implements ICustomValidator.ValidationContext{
+
+ private boolean isStandalone;
+ private boolean isGeneration;
+ private CheckMode mode;
+
+ public ValidationContextImpl(boolean isStandalone, boolean isGeneration, CheckMode mode){
+ this.isStandalone = isStandalone;
+ this.isGeneration = isGeneration;
+ this.mode = mode;
+ }
+
+ @Override
+ public boolean isStandalone() {
+ return isStandalone;
+ }
+
+ @Override
+ public boolean isGeneration() {
+ return isGeneration;
+ }
+
+ @Override
+ public CheckMode getCheckMode() {
+ return mode;
+ }
+
+ }
+
+ @SuppressWarnings("serial")
+ public static class StandaloneValidatorExtension extends ArrayList<String>{}
+
+ @Inject@Named(Constants.LANGUAGE_NAME)
+ protected String languageName;
+
+ @Inject
+ public void registerStandaloneValidators(StandaloneValidatorExtension extension, Injector injector){
+ for(String className : extension)
+ instanceAndRegisterValidator(injector, className);
+ }
+
+ private void instanceAndRegisterValidator(Injector injector, String className) {
+ try {
+ Class<?> clazz = Class.forName(className);
+ ICustomValidator instance = (ICustomValidator) injector.getInstance(clazz);
+ ICustomValidator.Registry.INSTANCE.add(languageName, instance);
+ }
+ catch (Throwable e) {
+ System.out.println("Failed to load custom validator " + className);
+ }
+ }
+
+ @Check
+ public void checkObject(EObject object) {
+ ICustomValidator.ValidationContext context = new ValidationContextImpl(isStandalone(), isGeneration(), getCheckMode());
+ Set<EClass> checkTypes = new HashSet<EClass>(object.eClass().getEAllSuperTypes());
+ checkTypes.add(object.eClass());
+
+ for(ICustomValidator val : getCustomValidators())
+ executeValidator(val, object, checkTypes, this, context);
+ }
+
+ protected void executeValidator(
+ final ICustomValidator validator,
+ final EObject object,
+ final Set<EClass> checkTypes,
+ final ValidationMessageAcceptor messageAcceptor,
+ final ICustomValidator.ValidationContext context) {
+
+ ISafeRunnable runnable = new ISafeRunnable() {
+ @Override
+ public void handleException(Throwable exception) {
+ System.out.println("Exception in ICustomValidator " + validator.getName());
+ exception.printStackTrace();
+ }
+
+ @Override
+ public void run() throws Exception {
+ if(checkTypes == null || !Sets.intersection(checkTypes, validator.getClassesToCheck()).isEmpty())
+ validator.validate(object, messageAcceptor, context);
+ }
+ };
+ SafeRunner.run(runnable);
+ }
+
+ protected boolean isStandalone(){
+ String contextSetup = (String) getContext().get(VAL_CONTEXT_SETUP_KEY);
+
+ // !EMFPlugin.IS_ECLIPSE_RUNNING
+ return VAL_CONTEXT_SETUP_STANDALONE.equals(contextSetup);
+ }
+
+ protected boolean isGeneration(){
+ String target = (String) getContext().get(VAL_CONTEXT_TARGET_KEY);
+
+ return VAL_CONTEXT_TARGET_GENERATION.equals(target);
+ }
+
+ protected List<ICustomValidator> getCustomValidators(){
+ return ICustomValidator.Registry.INSTANCE.get(languageName);
+ }
+
+ @Override
+ public void register(EValidatorRegistrar registrar) {
+ // as separate validator do register
+ // super.register(registrar);
+ // if added throught org.eclipse.xtext.validation.ComposedCheck, not necessary
+ }
+
+ @Override
+ protected List<EPackage> getEPackages() {
+ // as separate validator define an ePackage
+ // if added through org.eclipse.xtext.validation.ComposedCheck, not necessary
+ return super.getEPackages();
+ }
+
+ /**
+ * resource check from xtext
+ */
+ protected boolean acceptResource(EObject source) {
+ // from #checkIsFromCurrentlyCheckedResource(source)
+ if (source != null && getCurrentObject() != null && source.eResource() != getCurrentObject().eResource())
+ return false;
+
+ return true;
+ }
+
+ //
+ // ValidationMessageAcceptor
+ //
+
+ @Override
+ public void acceptError(String message, EObject object, EStructuralFeature feature, int index, String code,
+ String... issueData) {
+ if(acceptResource(object))
+ super.acceptError(message, object, feature, index, code, issueData);
+ }
+ @Override
+ public void acceptInfo(String message, EObject object, EStructuralFeature feature, int index, String code,
+ String... issueData) {
+ if(acceptResource(object))
+ super.acceptInfo(message, object, feature, index, code, issueData);
+ }
+ @Override
+ public void acceptError(String message, EObject object, int offset, int length, String code, String... issueData) {
+ if(acceptResource(object))
+ super.acceptError(message, object, offset, length, code, issueData);
+ }
+ @Override
+ public void acceptInfo(String message, EObject object, int offset, int length, String code, String... issueData) {
+ if(acceptResource(object))
+ super.acceptInfo(message, object, offset, length, code, issueData);
+ }
+ @Override
+ public void acceptWarning(String message, EObject object, EStructuralFeature feature, int index, String code,
+ String... issueData) {
+ if(acceptResource(object))
+ super.acceptWarning(message, object, feature, index, code, issueData);
+ }
+ @Override
+ public void acceptWarning(String message, EObject object, int offset, int length, String code, String... issueData) {
+ if(acceptResource(object))
+ super.acceptWarning(message, object, offset, length, code, issueData);
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/ICustomValidator.java b/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/ICustomValidator.java
new file mode 100644
index 000000000..cb15e841d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.common/src/org/eclipse/etrice/core/common/validation/ICustomValidator.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.validation;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.validation.CheckMode;
+import org.eclipse.xtext.validation.ValidationMessageAcceptor;
+
+/**
+ * Interface for plug-in/extensible model validators.
+ */
+public interface ICustomValidator {
+
+ String getName();
+ String getDescription();
+ Set<EClass> getClassesToCheck();
+
+ void validate(EObject object, ValidationMessageAcceptor messageAcceptor, ValidationContext context);
+
+ /**
+ * Provides information for the current context or environment.
+ */
+ interface ValidationContext{
+ /**
+ * If current setup is standalone, then eclipse may not be running
+ * or validator should behave like in non-eclipse mode.
+ * <p> Can be ignored for now.
+ */
+ boolean isStandalone();
+
+ /**
+ * Whether validaton should be tailored to generation.
+ */
+ boolean isGeneration();
+
+ /**
+ * @see org.eclipse.xtext.validation.CheckMode
+ */
+ CheckMode getCheckMode();
+ }
+
+ /**
+ * Global (standalone) registry for custom validators.
+ */
+ interface Registry{
+
+ Registry INSTANCE = new CustomValidatorManager.RegistryImpl();
+
+ void add(String language, ICustomValidator validator);
+
+ List<ICustomValidator> get(String language);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel/plugin.xml b/plugins/org.eclipse.etrice.core.genmodel/plugin.xml
index c0cb74f71..3ed6b62ee 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/plugin.xml
+++ b/plugins/org.eclipse.etrice.core.genmodel/plugin.xml
@@ -22,5 +22,13 @@
type="etricegen"
class="org.eclipse.etrice.core.genmodel.etricegen.util.ETriceGenResourceFactoryImpl"/>
</extension>
+ <extension
+ point="org.eclipse.etrice.core.room.validation">
+ <validator
+ class="org.eclipse.etrice.core.genmodel.RoomGenmodelValidator"
+ classToCheck="org.eclipse.etrice.core.room.RoomModel"
+ mode="FAST">
+ </validator>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/RoomGenmodelValidator.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/RoomGenmodelValidator.java
new file mode 100644
index 000000000..15516da98
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/RoomGenmodelValidator.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.genmodel;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.etrice.core.common.validation.ICustomValidator;
+import org.eclipse.etrice.core.genmodel.base.NullLogger;
+import org.eclipse.etrice.core.genmodel.builder.GeneratorModelBuilder;
+import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician;
+import org.eclipse.etrice.core.room.RoomModel;
+import org.eclipse.etrice.core.room.RoomPackage;
+import org.eclipse.xtext.validation.CheckMode;
+import org.eclipse.xtext.validation.ValidationMessageAcceptor;
+
+
+public class RoomGenmodelValidator implements ICustomValidator {
+
+ private static final Set<EClass> classesToCheck = new HashSet<EClass>();
+ {
+ classesToCheck.add(RoomPackage.Literals.ROOM_MODEL);
+ }
+
+ private class Diag implements IDiagnostician {
+ private ValidationMessageAcceptor acceptor;
+
+ private Diag(ValidationMessageAcceptor acceptor){
+ this.acceptor = acceptor;
+ }
+
+ @Override
+ public void warning(String msg, EObject source, EStructuralFeature feature) {
+ acceptor.acceptWarning(msg, source, feature, INSIGNIFICANT_INDEX, null);
+ }
+
+ @Override
+ public void warning(String msg, EObject source, EStructuralFeature feature, int index) {
+ acceptor.acceptWarning(msg, source, feature, index, null);
+ }
+
+ @Override
+ public void error(String msg, EObject source, EStructuralFeature feature) {
+ acceptor.acceptError(msg, source, feature, INSIGNIFICANT_INDEX, null);
+ }
+
+ @Override
+ public void error(String msg, EObject source, EStructuralFeature feature, int index) {
+ acceptor.acceptError(msg, source, feature, index, null);
+ }
+
+ @Override
+ public boolean isFailed() {
+ return false;
+ }
+ }
+
+
+ @Override
+ public String getName() {
+ return "Genmodel Validator";
+ }
+
+
+ @Override
+ public String getDescription() {
+ return "This validator checks ROOM models by creating actual system instances, which covers aspects like wiring.";
+ }
+
+
+ @Override
+ public Set<EClass> getClassesToCheck() {
+ return classesToCheck;
+ }
+
+
+ @Override
+ public void validate(EObject object, ValidationMessageAcceptor messageAcceptor, ValidationContext context) {
+ if(!(object instanceof RoomModel))
+ return;
+
+ if(context.isGeneration())
+ return;
+
+ RoomModel model = (RoomModel) object;
+ if (context.getCheckMode() == CheckMode.ALL) {
+// System.out.println("checking model " + model.getName());
+
+ ArrayList<RoomModel> models = new ArrayList<RoomModel>();
+
+ Resource resource = model.eResource();
+ if (resource != null) {
+ ResourceSet rs = resource.getResourceSet();
+ if (rs != null) {
+ EcoreUtil.resolveAll(rs);
+ for (Resource res : rs.getResources()) {
+ for (EObject obj : res.getContents()) {
+ if (obj instanceof RoomModel)
+ models.add((RoomModel) obj);
+ }
+ }
+ }
+ }
+ if (models.isEmpty())
+ models.add(model);
+
+ Diag diagnostician = new Diag(messageAcceptor);
+ GeneratorModelBuilder builder = new GeneratorModelBuilder(new NullLogger(), diagnostician);
+ builder.createGeneratorModel(models, true);
+
+// System.out.println("done checking model " + model.getName() + " with result: "
+// + (diagnostician.isFailed() ? "failed" : "ok"));
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedActorClassImpl.java b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedActorClassImpl.java
index 38caf275a..43c5cd59e 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedActorClassImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedActorClassImpl.java
@@ -313,7 +313,8 @@ public class ExpandedActorClassImpl extends EObjectImpl implements ExpandedActor
}
private void validationError(String msg, EObject obj, EStructuralFeature feature, int idx) {
- validator.error(msg, copy2orig.get(obj), feature, idx);
+ assert obj.eResource() != null : "val error in artificial model object";
+ validator.error(msg, obj, feature, idx);
}
private void buildStateGraph() {
@@ -509,66 +510,72 @@ public class ExpandedActorClassImpl extends EObjectImpl implements ExpandedActor
}
}
else {
- validationError(getActorClass().getName()+": The TOP level has to have an initial transition!", sg, RoomPackage.eINSTANCE.getStateGraph_Transitions());
+ validationError(getActorClass().getName()+": The TOP level has to have an initial transition!", getActorClass().getStateMachine(), RoomPackage.eINSTANCE.getStateGraph_Transitions());
}
}
else {
if (initCount>1)
- validationError(getActorClass().getName()+": There has to be exactly one initial transition!", sg, RoomPackage.eINSTANCE.getStateGraph_Transitions());
+ validationError(getActorClass().getName()+": There has to be exactly one initial transition!", getActorClass().getStateMachine(), RoomPackage.eINSTANCE.getStateGraph_Transitions());
}
for (ChoicePoint cp : sg.getChPoints()) {
NodeData data = node2data.get(cp);
- int idx = sg.getChPoints().indexOf(cp);
+
+ ChoicePoint orig = (ChoicePoint) copy2orig.get(cp);
+ StateGraph origContainer = (StateGraph) orig.eContainer();
+ int idx = origContainer.getChPoints().indexOf(orig);
if (data==null) {
- validationError(getActorClass().getName()+": ChoicePoint is not connected!", sg, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
+ validationError(getActorClass().getName()+": ChoicePoint is not connected!", origContainer, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
}
else {
// several incoming transitions possible, see bug 340496
// if (data.getInTrans().size()!=1)
// validationError(getActorClass().getName()+": ChoicePoint has "+data.getInTrans().size()+" incoming transitions!", sg, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
if (data.getOutTrans().size()<2)
- validationError(getActorClass().getName()+": ChoicePoint should have 2 or more branches but has "+data.getOutTrans().size(), sg, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
+ validationError(getActorClass().getName()+": ChoicePoint should have 2 or more branches but has "+data.getOutTrans().size(), origContainer, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
if (getDefaultBranch(data.getOutTrans())==null)
- validationError(getActorClass().getName()+": ChoicePoint has no default branch!", sg, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
+ validationError(getActorClass().getName()+": ChoicePoint has no default branch!", origContainer, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
if (!data.getLoopTransitions().isEmpty())
- validationError(getActorClass().getName()+": ChoicePoint is connected to itself!", sg, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
+ validationError(getActorClass().getName()+": ChoicePoint is connected to itself!", origContainer, RoomPackage.eINSTANCE.getStateGraph_ChPoints(), idx);
}
}
for (TrPoint tp : sg.getTrPoints()) {
NodeData data = node2data.get(tp);
- int idx = sg.getTrPoints().indexOf(tp);
+
+ TrPoint orig = (TrPoint) copy2orig.get(tp);
+ StateGraph origContainer = (StateGraph) orig.eContainer();
+ int idx = origContainer.getTrPoints().indexOf(orig);
if (data==null) {
if (!getActorClass(tp).isAbstract())
- validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" is not connected", sg, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
+ validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" is not connected", origContainer, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
}
else {
if ((tp instanceof EntryPoint)||(tp instanceof ExitPoint)) {
// non-abstract classes must have incoming transitions for entry and exit points
if (!getActorClass().isAbstract() && data.getInTrans().isEmpty())
- validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" has no incoming transition!", sg, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
+ validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" has no incoming transition!", origContainer, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
if (getActorClass(tp).isAbstract()) {
// transition points inherited from abstract base classes
// (of from abstract classes themselves) must not have more than one outgoing transition
if (data.getOutTrans().size()>1)
- validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have at most one outgoing transition!", sg, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
+ validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have at most one outgoing transition!", origContainer, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
}
else {
// non-abstract or non-inherited transition points must have one outgoing transition
if (data.getOutTrans().size()!=1)
- validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have exactly one outgoing transition!", sg, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
+ validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have exactly one outgoing transition!", origContainer, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
}
if (!data.getLoopTransitions().isEmpty())
- validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have no self transitions!", sg, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
+ validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have no self transitions!", origContainer, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
}
else if (tp instanceof TransitionPoint) {
if (data.getOutTrans().size()<data.getLoopTransitions().size())
- validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have no incoming transitions!", sg, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
+ validationError(getActorClass().getName()+": TrPoint "+RoomNameProvider.getFullPath(tp)+" must have no incoming transitions!", origContainer, RoomPackage.eINSTANCE.getStateGraph_TrPoints(), idx);
}
}
}
@@ -812,8 +819,10 @@ public class ExpandedActorClassImpl extends EObjectImpl implements ExpandedActor
for (Transition next : getOutgoingTransitions(node)) {
// from the second transition in the chain on we have:
if (next instanceof TriggeredTransition) {
- int idx = ((StateGraph)next.eContainer()).getTransitions().indexOf(next);
- validationError("Segments following the triggering transition can have no triggers!\n", next.eContainer(), RoomPackage.eINSTANCE.getStateGraph_Transitions(), idx);
+ TriggeredTransition orig = (TriggeredTransition)copy2orig.get(next);
+ StateGraph origContainer = (StateGraph) orig.eContainer();
+ int idx = origContainer.getTransitions().indexOf(orig);
+ validationError("Segments following the triggering transition can have no triggers!\n", origContainer, RoomPackage.eINSTANCE.getStateGraph_Transitions(), idx);
}
collectChainTransitions(tc, next);
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomModelValidator.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomModelValidator.java
deleted file mode 100644
index 2091ffe00..000000000
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomModelValidator.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.core.ui;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.etrice.core.validation.RoomJavaValidator;
-import org.eclipse.xtext.validation.Check;
-import org.eclipse.xtext.validation.CheckMode;
-
-import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician;
-import org.eclipse.etrice.core.room.RoomModel;
-import org.eclipse.etrice.core.genmodel.base.ILogger;
-import org.eclipse.etrice.core.genmodel.builder.GeneratorModelBuilder;
-
-public class RoomModelValidator extends RoomJavaValidator implements ILogger {
-
- private class Diag implements IDiagnostician {
- private boolean failed = false;
-
- @Override
- public void warning(String msg, EObject source, EStructuralFeature feature) {
- warning(msg, source, feature, INSIGNIFICANT_INDEX);
- }
-
- @Override
- public void warning(String msg, EObject source, EStructuralFeature feature, int index) {
- issueWarning(msg, source, feature, index);
- }
-
- @Override
- public void error(String msg, EObject source, EStructuralFeature feature) {
- error(msg, source, feature, INSIGNIFICANT_INDEX);
- }
-
- @Override
- public void error(String msg, EObject source, EStructuralFeature feature, int index) {
- failed = true;
- issueError(msg, source, feature, index);
- }
-
- @Override
- public boolean isFailed() {
- return failed;
- }
- }
-
- @Check
- public void checkModel(RoomModel model) {
- if (getCheckMode()==CheckMode.ALL) {
- System.out.println("checking model "+model.getName());
-
- ArrayList<RoomModel> models = new ArrayList<RoomModel>();
-
- Resource resource = model.eResource();
- if (resource!=null) {
- ResourceSet rs = resource.getResourceSet();
- if (rs!=null) {
- EcoreUtil.resolveAll(rs);
- for (Resource res : rs.getResources()) {
- for (EObject obj : res.getContents()) {
- if (obj instanceof RoomModel)
- models.add((RoomModel) obj);
- }
- }
- }
- }
- if (models.isEmpty())
- models.add(model);
-
- Diag diagnostician = new Diag();
- GeneratorModelBuilder builder = new GeneratorModelBuilder(this, diagnostician);
- builder.createGeneratorModel(models, true);
-
- System.out.println("done checking model "+model.getName()+" with result: "+(diagnostician.isFailed()?"failed":"ok"));
- }
- }
-
- public void issueError(String msg, EObject source, EStructuralFeature feature, int index) {
- if (index==IDiagnostician.INSIGNIFICANT_INDEX)
- index = INSIGNIFICANT_INDEX;
- error(msg, source, feature, index);
- }
-
- public void issueWarning(String msg, EObject source, EStructuralFeature feature, int index) {
- if (index==IDiagnostician.INSIGNIFICANT_INDEX)
- index = INSIGNIFICANT_INDEX;
- warning(msg, source, feature, index);
- }
-
- @Override
- public void logInfo(String text) {
- }
-
- @Override
- public void logError(String text, EObject obj) {
- }
-
-}
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java
index e6cb43200..cb205c503 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java
+++ b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/RoomUiModule.java
@@ -34,11 +34,6 @@ public class RoomUiModule extends org.eclipse.etrice.core.ui.AbstractRoomUiModul
super(plugin);
}
- @org.eclipse.xtext.service.SingletonBinding(eager=true)
- public Class<? extends org.eclipse.etrice.core.validation.RoomJavaValidator> bindRoomJavaValidator() {
- return org.eclipse.etrice.core.ui.RoomModelValidator.class;
- }
-
@Override
public Class<? extends IContentOutlinePage> bindIContentOutlinePage() {
return RoomOutlinePage.class;
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomRuntimeModule.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomRuntimeModule.java
index f1585c344..902086b12 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomRuntimeModule.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomRuntimeModule.java
@@ -13,15 +13,18 @@
package org.eclipse.etrice.core;
import org.eclipse.etrice.core.common.scoping.ModelLocatorUriResolver;
+import org.eclipse.etrice.core.common.validation.CustomValidatorManager.StandaloneValidatorExtension;
import org.eclipse.etrice.core.converter.RoomValueConverterService;
import org.eclipse.etrice.core.naming.RoomFragmentProvider;
import org.eclipse.etrice.core.naming.RoomQualifiedNameProvider;
+import org.eclipse.etrice.core.validation.ValidatorExtensionManager;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
import org.eclipse.xtext.resource.IFragmentProvider;
import org.eclipse.xtext.scoping.impl.ImportUriResolver;
import com.google.inject.Binder;
+import com.google.inject.Provider;
/**
@@ -30,6 +33,30 @@ import com.google.inject.Binder;
public class RoomRuntimeModule extends org.eclipse.etrice.core.AbstractRoomRuntimeModule {
@Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+
+ if(!ValidatorExtensionManager.Registry.isAvailable())
+ bindCustomValidator(binder);
+ }
+
+ protected void bindCustomValidator(Binder binder){
+ binder.bind(StandaloneValidatorExtension.class).toProvider(new Provider<StandaloneValidatorExtension>(){
+
+ @Override
+ public StandaloneValidatorExtension get() {
+ StandaloneValidatorExtension classNames = new StandaloneValidatorExtension();
+ classNames.add("org.eclipse.etrice.core.genmodel.RoomGenmodelValidator");
+ classNames.add("org.eclipse.etrice.abstractexec.behavior.ReachabilityValidator");
+ classNames.add("org.eclipse.etrice.abstractexec.behavior.AbstractExecutionValidator");
+
+ return classNames;
+ }
+
+ });
+ }
+
+ @Override
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return RoomQualifiedNameProvider.class;
}
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/IRoomValidator.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/IRoomValidator.java
deleted file mode 100644
index 88002ada6..000000000
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/IRoomValidator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * 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:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.core.validation;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.validation.ValidationMessageAcceptor;
-
-/**
- * @author Henrik Rentz-Reichert
- *
- */
-public interface IRoomValidator {
-
- String getName();
- String getDescription();
- void validate(EObject object, ValidationMessageAcceptor messageAcceptor);
-
-}
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java
index 12d85c618..c0f1c6b51 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/ValidatorExtensionManager.java
@@ -9,7 +9,6 @@
* Henrik Rentz-Reichert (initial contribution)
*
*******************************************************************************/
-
package org.eclipse.etrice.core.validation;
import java.util.ArrayList;
@@ -22,40 +21,40 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.common.validation.CustomValidatorManager;
+import org.eclipse.etrice.core.common.validation.ICustomValidator;
import org.eclipse.etrice.core.room.RoomPackage;
-import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
import org.eclipse.xtext.validation.Check;
import org.eclipse.xtext.validation.CheckMode;
import org.eclipse.xtext.validation.CheckType;
-import org.eclipse.xtext.validation.EValidatorRegistrar;
import org.eclipse.xtext.validation.ValidationMessageAcceptor;
/**
- * @author Henrik Rentz-Reichert
- *
+ * Custom validator manager for room language, that provides registration via an
+ * extension point.
+ *
*/
-public class ValidatorExtensionManager extends AbstractDeclarativeValidator {
-
+public class ValidatorExtensionManager extends CustomValidatorManager {
+
public static class ValidatorInfo {
public static final String SEP = "@";
-
- private IRoomValidator validator;
+
+ private ICustomValidator validator;
private String id;
-
- public ValidatorInfo(IRoomValidator validator, String id) {
+
+ public ValidatorInfo(ICustomValidator validator, String id) {
super();
this.validator = validator;
this.id = id;
}
-
- public IRoomValidator getValidator() {
+
+ public ICustomValidator getValidator() {
return validator;
}
@@ -71,31 +70,35 @@ public class ValidatorExtensionManager extends AbstractDeclarativeValidator {
return id;
}
}
-
+
public static class Registry {
-
- private static final String PACKAGE = RoomPackage.class.getPackage().getName()+".";
+
+ private static final String PACKAGE = RoomPackage.class.getPackage().getName() + ".";
private static final String IVALIDATOR_ID = "org.eclipse.etrice.core.room.validation";
private static Registry instance = null;
- private HashMap<String, ArrayList<IRoomValidator>> fastClass2Ext = new HashMap<String, ArrayList<IRoomValidator>>();
- private HashMap<String, ArrayList<IRoomValidator>> normalClass2Ext = new HashMap<String, ArrayList<IRoomValidator>>();
- private HashMap<String, ArrayList<IRoomValidator>> expensiveClass2Ext = new HashMap<String, ArrayList<IRoomValidator>>();
- private ArrayList<ValidatorInfo> infos = new ArrayList<ValidatorExtensionManager.ValidatorInfo>();
- private ArrayList<ValidatorInfo> excludedInfos = new ArrayList<ValidatorExtensionManager.ValidatorInfo>();
- private HashSet<IRoomValidator> excluded = new HashSet<IRoomValidator>();
-
+ private HashMap<String, ArrayList<ICustomValidator>> fastClass2Ext = new HashMap<String, ArrayList<ICustomValidator>>();
+ private HashMap<String, ArrayList<ICustomValidator>> normalClass2Ext = new HashMap<String, ArrayList<ICustomValidator>>();
+ private HashMap<String, ArrayList<ICustomValidator>> expensiveClass2Ext = new HashMap<String, ArrayList<ICustomValidator>>();
+ private ArrayList<ValidatorInfo> infos = new ArrayList<ValidatorInfo>();
+ private ArrayList<ValidatorInfo> excludedInfos = new ArrayList<ValidatorInfo>();
+ private HashSet<ICustomValidator> excluded = new HashSet<ICustomValidator>();
+
public static Registry getInstance() {
- if (instance==null)
+ if (instance == null)
instance = new Registry();
-
+
return instance;
}
-
+
+ public static boolean isAvailable() {
+ return EMFPlugin.IS_ECLIPSE_RUNNING && Platform.getExtensionRegistry() != null
+ && Platform.getExtensionRegistry().getExtensionPoint(IVALIDATOR_ID) != null;
+ }
+
public void loadValidatorExtensions() {
- IConfigurationElement[] config = Platform.getExtensionRegistry()
- .getConfigurationElementsFor(IVALIDATOR_ID);
-
- // compute all sub classes for all classes of the Room package
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(IVALIDATOR_ID);
+
+ // compute all sub classes for all classes of the Room package
HashMap<String, ArrayList<String>> cls2sub = new HashMap<String, ArrayList<String>>();
for (EClassifier cls : RoomPackage.eINSTANCE.getEClassifiers()) {
if (cls instanceof EClass) {
@@ -105,30 +108,28 @@ public class ValidatorExtensionManager extends AbstractDeclarativeValidator {
}
}
}
-
+
// now we add each extension to our maps
for (IConfigurationElement e : config) {
try {
final Object ext = e.createExecutableExtension("class");
- if (ext instanceof IRoomValidator) {
- IRoomValidator validator = (IRoomValidator) ext;
- infos.add(new ValidatorInfo(
- validator,
- e.getName()+ValidatorInfo.SEP+e.getNamespaceIdentifier()
- ));
+ if (ext instanceof ICustomValidator) {
+ ICustomValidator validator = (ICustomValidator) ext;
+ infos.add(new ValidatorInfo(validator, e.getName() + ValidatorInfo.SEP
+ + e.getNamespaceIdentifier()));
String mode = e.getAttribute("mode");
String classToCheck = e.getAttribute("classToCheck");
if (classToCheck.startsWith(PACKAGE))
classToCheck = classToCheck.substring(PACKAGE.length());
EClassifier cls = RoomPackage.eINSTANCE.getEClassifier(classToCheck);
if (cls instanceof EClass) {
- HashMap<String,ArrayList<IRoomValidator>> map = getMap(mode);
- if (map!=null) {
- put(map, ((EClass) cls).getName(), (IRoomValidator) ext);
+ HashMap<String, ArrayList<ICustomValidator>> map = getMap(mode);
+ if (map != null) {
+ put(map, ((EClass) cls).getName(), (ICustomValidator) ext);
ArrayList<String> subTypes = cls2sub.get(cls.getName());
- if (subTypes!=null)
+ if (subTypes != null)
for (String type : subTypes) {
- put(map, type, (IRoomValidator) ext);
+ put(map, type, (ICustomValidator) ext);
}
}
}
@@ -142,12 +143,12 @@ public class ValidatorExtensionManager extends AbstractDeclarativeValidator {
}
}
}
-
+
public void exclude(ValidatorInfo info) {
excludedInfos.add(info);
excluded.add(info.getValidator());
}
-
+
public void include(ValidatorInfo info) {
excludedInfos.remove(info);
excluded.remove(info.getValidator());
@@ -172,54 +173,60 @@ public class ValidatorExtensionManager extends AbstractDeclarativeValidator {
public List<ValidatorInfo> getExcludedInfos() {
return Collections.unmodifiableList(excludedInfos);
}
-
- public void validate(EObject object, CheckMode checkMode, ValidationMessageAcceptor messageAcceptor) {
-
- // we initialize the set of executed validators with the excluded ones
- HashSet<IRoomValidator> executed = new HashSet<IRoomValidator>(excluded);
-
+
+ public List<ICustomValidator> getValidatorsToExecute(EObject object, CheckMode checkMode,
+ ValidationMessageAcceptor messageAcceptor) {
+ // we initialize the set of executed validators with the excluded
+ // ones
+ HashSet<ICustomValidator> executed = new HashSet<ICustomValidator>(excluded);
+
if (checkMode.shouldCheck(CheckType.FAST))
- validate(object, messageAcceptor, fastClass2Ext, executed);
+ return validate(object, messageAcceptor, fastClass2Ext, executed);
if (checkMode.shouldCheck(CheckType.NORMAL))
- validate(object, messageAcceptor, normalClass2Ext, executed);
+ return validate(object, messageAcceptor, normalClass2Ext, executed);
if (checkMode.shouldCheck(CheckType.EXPENSIVE))
- validate(object, messageAcceptor, expensiveClass2Ext, executed);
+ return validate(object, messageAcceptor, expensiveClass2Ext, executed);
+
+ assert (false) : "unexpected CheckType";
+ return new ArrayList<ICustomValidator>();
}
- private void validate(EObject object,
- ValidationMessageAcceptor messageAcceptor,
- HashMap<String, ArrayList<IRoomValidator>> map, HashSet<IRoomValidator> executed) {
- ArrayList<IRoomValidator> validators = map.get(object.eClass().getName());
- if (validators!=null)
- for (IRoomValidator validator : validators) {
+ private List<ICustomValidator> validate(EObject object, ValidationMessageAcceptor messageAcceptor,
+ HashMap<String, ArrayList<ICustomValidator>> map, HashSet<ICustomValidator> executed) {
+ ArrayList<ICustomValidator> result = new ArrayList<ICustomValidator>();
+
+ ArrayList<ICustomValidator> validators = map.get(object.eClass().getName());
+ if (validators != null)
+ for (ICustomValidator validator : validators) {
if (!executed.contains(validator)) {
executed.add(validator);
- executeExtension(validator, object, messageAcceptor);
+ result.add(validator);
}
}
+
+ return result;
}
-
- private void put(String cls, String sub,
- HashMap<String,ArrayList<String>> cls2sub) {
-
+
+ private void put(String cls, String sub, HashMap<String, ArrayList<String>> cls2sub) {
+
ArrayList<String> list = cls2sub.get(cls);
- if (list==null) {
+ if (list == null) {
list = new ArrayList<String>();
cls2sub.put(cls, list);
}
list.add(sub);
}
- private void put(HashMap<String, ArrayList<IRoomValidator>> map, String cls, IRoomValidator val) {
- ArrayList<IRoomValidator> list = map.get(cls);
- if (list==null) {
- list = new ArrayList<IRoomValidator>();
+ private void put(HashMap<String, ArrayList<ICustomValidator>> map, String cls, ICustomValidator val) {
+ ArrayList<ICustomValidator> list = map.get(cls);
+ if (list == null) {
+ list = new ArrayList<ICustomValidator>();
map.put(cls, list);
}
list.add(val);
}
-
- private HashMap<String, ArrayList<IRoomValidator>> getMap(String mode) {
+
+ private HashMap<String, ArrayList<ICustomValidator>> getMap(String mode) {
if (mode.equals(CheckType.FAST.name()))
return fastClass2Ext;
else if (mode.equals(CheckType.NORMAL.name()))
@@ -229,48 +236,28 @@ public class ValidatorExtensionManager extends AbstractDeclarativeValidator {
else
return null;
}
-
- private void executeExtension(
- final IRoomValidator validator,
- final EObject object,
- final ValidationMessageAcceptor messageAcceptor) {
-
- ISafeRunnable runnable = new ISafeRunnable() {
- @Override
- public void handleException(Throwable exception) {
- System.out.println("Exception in IRoomValidator " + validator.getName());
- exception.printStackTrace();
- }
-
- @Override
- public void run() throws Exception {
- validator.validate(object, messageAcceptor);
- }
- };
- SafeRunner.run(runnable);
- }
}
- public ValidatorExtensionManager() {
-
+ protected boolean isRegistryAvailable;
+
+ public ValidatorExtensionManager(){
+ super();
+ isRegistryAvailable = Registry.isAvailable();
}
@Check
public void checkObject(EObject object) {
- //EcoreUtil.resolveAll(object.eResource().getResourceSet());
- Registry.getInstance().validate(object, getCheckMode(), getMessageAcceptor());
- }
+ if (isRegistryAvailable) {
+ ICustomValidator.ValidationContext context = new ValidationContextImpl(isStandalone(), isGeneration(),
+ getCheckMode());
+ for (ICustomValidator val : Registry.getInstance().getValidatorsToExecute(object, getCheckMode(),
+ getMessageAcceptor()))
+ executeValidator(val, object, null, getMessageAcceptor(), context);
- @Override
- public void register(EValidatorRegistrar registrar) {
- // HOWTO: if this validator is registered for the RoomPackage then it is called twice
+ }
+ else
+ // use default registry
+ super.checkObject(object);
}
-// @Override
-// protected List<EPackage> getEPackages() {
-// List<EPackage> result = new ArrayList<EPackage>();
-// result.add(RoomPackage.eINSTANCE);
-// return result;
-// }
-
}
diff --git a/plugins/org.eclipse.etrice.doc/manual/etrice.pdf b/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
index 9af480701..fd933877a 100644
--- a/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
+++ b/plugins/org.eclipse.etrice.doc/manual/etrice.pdf
@@ -2430,7 +2430,7 @@ jAă󻱢N?EOߚ%'SS0 ϻ8dD~Eݒ.?"Ĥĵo[
εtG՜e:
Ԕd(?7Қ|DJT
T3$)'y|V.QG4M `jGa]\##2N~H
-M$6\wf:u5:D[Pq7;fO1LD
+M$6\wf:u5:D[Pq7;fO1LD
~3۔Ɵxi
J.pD5 ɍ'y~WwltԨp\?gpf+T[}Д-GhT6>hSήY6@o/^ 1o8`0|fz#DbH<ȨK l/K b,ս][!wcGW%/T;3Mypmz㤅 /pDT*-z}TBtsUFWo[R[][ϤR^ޟ<;ȧ,
֬gze/| XB,a{.>?鏯3ˈ.Eʀ'*jU
@@ -2862,7 +2862,7 @@ eU RJ#K8%eEB).EYDTIN<"J+ oI 8BꆦȠj(,
$'b\2O%*)jm +nMP%E?乐2p|ٷ##NN&UYB>a:R:::yHe(!.),A$8\&RD{\*E}j<Y e?FU&#.HHVBC
M."%čZ!NJ#J!̬[COG;4)J΀CAeBS{
B8w݆R֑!PC 5|QZ*N_^|^
-:z!U(6KaiH,=G#b$]C>c
+:z!U(6KaiH,=G#b$]C>c

,_rF"X *d ,ֿ{i/쳙eB-"dx? i !TL\L ˜JHX2/D٤*=Gc y;z!b$!e}z:
@|h 
@@ -3468,7 +3468,7 @@ endobj
/Filter /FlateDecode
>>
stream
-x
+x
endstream
endobj
806 0 obj <<
@@ -4774,7 +4774,7 @@ K.Kzkjj
"***2Lrˎ;>)e._`m3 F,%=K
2gQ3y޽n`
-
+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PQf3$} klܨ@F'/.p'/L7yQ4o'M CR׫DKi#Z fU]{P 32f!zC,@x8J,x6>S3E80.ǶM&yiѽӡu]c[l˾=%wX˅טxB7lӽ^Hl49ut ߢnh KZ,xo0p[std.[֤_~Urv7
Z*<5g35kDI̻ynKgh~An-<|RA
ͣ?ТTbx 4jzIk68t/_g[A"YzZje_
-8e8}Bhh:quP.
+8e8}Bhh:quP.
}_IbOk<>wCøg
HTQ8"D z䁆ݗ)V!GfS׻fx]&Tÿ
I-&?"Dh9(f^ow 6Lbˬro^NNIҝ,(lnHD&]J7,f+jU+aԋ:GD`mQg6h2tiqyv7r<2BȡwO$xjxfj
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java
index 5632fffc3..ce5603ccd 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGenerator.java
@@ -20,6 +20,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
@@ -382,9 +383,7 @@ public abstract class AbstractGenerator {
@Inject
private ModelLoader modelLoader;
- /**
- * The rsource validator which is injected using the ROOM DSL injector
- */
+ @Inject
protected IResourceValidator validator;
/**
@@ -399,12 +398,9 @@ public abstract class AbstractGenerator {
* setup the ROOM core model plug-in and create a validator using injection
*/
protected void setupRoomModel() {
- Injector roomInjector;
- if (EMFPlugin.IS_ECLIPSE_RUNNING)
- roomInjector = new org.eclipse.etrice.core.RoomStandaloneSetup().createInjector();
- else
- roomInjector = new org.eclipse.etrice.core.RoomStandaloneSetup().createInjectorAndDoEMFRegistration();
- validator = roomInjector.getInstance(IResourceValidator.class);
+ if (!EMFPlugin.IS_ECLIPSE_RUNNING)
+ new org.eclipse.etrice.core.RoomStandaloneSetup().createInjectorAndDoEMFRegistration();
+
org.eclipse.etrice.core.genmodel.SetupGenmodel.doSetup();
}
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGeneratorBaseModule.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGeneratorBaseModule.java
index 8ffe812d4..bd466b7e7 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGeneratorBaseModule.java
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/AbstractGeneratorBaseModule.java
@@ -12,6 +12,7 @@
package org.eclipse.etrice.generator.base;
+import org.eclipse.emf.ecore.EValidator;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.etrice.core.genmodel.base.ILogger;
import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician;
@@ -63,8 +64,11 @@ public abstract class AbstractGeneratorBaseModule implements Module {
binder.bind(ITranslationProvider.class).to(bindITranslationProvider());
if (bindIDataConfiguration()!=null)
binder.bind(IDataConfiguration.class).to(bindIDataConfiguration());
+
+ binder.bind(EValidator.Registry.class).toInstance(EValidator.Registry.INSTANCE);
+ binder.bind(org.eclipse.emf.ecore.util.Diagnostician.class).to(GenerationEMFDiagnostician.class).asEagerSingleton();
}
-
+
/**
* Abstract method that retrieves a class to which {@link ILanguageExtension} is bound
* @return a Class extending {@link ILanguageExtension}
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GenerationEMFDiagnostician.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GenerationEMFDiagnostician.java
new file mode 100644
index 000000000..a9408ce2c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GenerationEMFDiagnostician.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.generator.base;
+
+import java.util.Map;
+
+import org.eclipse.etrice.core.common.validation.CustomValidatorManager;
+import org.eclipse.xtext.validation.CancelableDiagnostician;
+
+import com.google.inject.Inject;
+
+/**
+ * Diagnostician that adds the ValidationContext to validation calls.
+ *
+ */
+public class GenerationEMFDiagnostician extends CancelableDiagnostician {
+
+ @Inject
+ public GenerationEMFDiagnostician(Registry registry) {
+ super(registry);
+ }
+
+ @Override
+ public Map<Object, Object> createDefaultContext() {
+ Map<Object, Object> context = super.createDefaultContext();
+ context.put(CustomValidatorManager.VAL_CONTEXT_SETUP_STANDALONE,
+ CustomValidatorManager.VAL_CONTEXT_SETUP_STANDALONE);
+ context.put(CustomValidatorManager.VAL_CONTEXT_TARGET_KEY,
+ CustomValidatorManager.VAL_CONTEXT_TARGET_GENERATION);
+
+ return context;
+ }
+
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar b/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar
index c4b1891cc..a7b3ac822 100644
--- a/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar
+++ b/runtime/org.eclipse.etrice.runtime.java.aspects/dist/org.eclipse.etrice.runtime.java.aspects.jar
Binary files differ

Back to the top