summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Eysholdt2011-08-10 14:34:28 (EDT)
committer Ed Merks2011-08-10 14:35:51 (EDT)
commit8434ec060e0da2bd028cf49088a8dc6dccd4b3d9 (patch)
treee3f6bed59db172c0b868a32057d823b2adafecf6
parent203d3683509ce5c1ccf10b949e711eccc5d4137c (diff)
downloadorg.eclipse.emf-8434ec060e0da2bd028cf49088a8dc6dccd4b3d9.zip
org.eclipse.emf-8434ec060e0da2bd028cf49088a8dc6dccd4b3d9.tar.gz
org.eclipse.emf-8434ec060e0da2bd028cf49088a8dc6dccd4b3d9.tar.bz2
register validator using EPackage literals instead of using the registry.
this is a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=354425
-rwxr-xr-xorg.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreJavaValidator.java37
1 files changed, 29 insertions, 8 deletions
diff --git a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreJavaValidator.java b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreJavaValidator.java
index ca223f9..3b05a72 100755
--- a/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreJavaValidator.java
+++ b/org.eclipse.emf.ecore.xcore/src/org/eclipse/emf/ecore/xcore/validation/XcoreJavaValidator.java
@@ -1,13 +1,34 @@
package org.eclipse.emf.ecore.xcore.validation;
-
-public class XcoreJavaValidator extends AbstractXcoreJavaValidator {
+import java.util.ArrayList;
+import java.util.List;
-// @Check
-// public void checkGreetingStartsWithCapital(Greeting greeting) {
-// if (!Character.isUpperCase(greeting.getName().charAt(0))) {
-// warning("Name should start with a capital", MyDslPackage.Literals.GREETING__NAME);
-// }
-// }
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.xcore.XcorePackage;
+import org.eclipse.xtext.common.types.TypesPackage;
+import org.eclipse.xtext.xbase.XbasePackage;
+import org.eclipse.xtext.xtype.XtypePackage;
+
+public class XcoreJavaValidator extends AbstractXcoreJavaValidator
+{
+
+ @Override
+ protected List<EPackage> getEPackages()
+ {
+ List<EPackage> result = new ArrayList<EPackage>();
+ result.add(XcorePackage.eINSTANCE);
+ result.add(XbasePackage.eINSTANCE);
+ result.add(TypesPackage.eINSTANCE);
+ result.add(XtypePackage.eINSTANCE);
+ return result;
+ }
+
+ // @Check
+ // public void checkGreetingStartsWithCapital(Greeting greeting) {
+ // if (!Character.isUpperCase(greeting.getName().charAt(0))) {
+ // warning("Name should start with a capital",
+ // MyDslPackage.Literals.GREETING__NAME);
+ // }
+ // }
}