Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Emfatic] Pattern Validation and Creating Dynamic Instances
[Emfatic] Pattern Validation and Creating Dynamic Instances [message #623168] Sat, 11 September 2010 13:33
Toñi Reina is currently offline Toñi Reina
Messages: 204
Registered: July 2009
Senior Member
Hi all,

I'm writing a small metamodel to test some regular expressions. I
have used emfatic, and as you can see below, the metamodel is very
simple. It only contains the root class named Test and other class with
two attributes: name and value. Value represents a string that should
match a regular expression (the regular expression I'm testing). To
constraint the values, a datatype named RegExp1 has been specified (you
can see the details below.

@namespace(uri="http://regexp.test", prefix="test")
package testregexp;

class Test {
val Example[+] examples;
}


class Example{
attr String name;
attr RegExp1 value;
}


@ExtendedMetaData(name="RegExp1",
baseType="http://www.eclipse.org/emf/2003/XMLType#string",
pattern="[A-Z]")
datatype RegExp1: String;


My problem arises when I try to write a model that conforms to this
metamodel by creating a dynamic instance with the Sample Reflective
Ecore Model Editor. Every time I try to write some text in the value
attribute the exception I have included below is thrown. My question is
if I'm missing something, it's seems there's some kind of problem with
the validation of the regular expression, but I really don't know what
the problem is, so I'd be grateful if you could give some hint:

null Error
Unhandled event loop exception

java.lang.NullPointerException
at
org.eclipse.emf.ecore.util.EObjectValidator.reportDataValueT ypeViolation(EObjectValidator.java:1652)
at
org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:1447)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:209)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:197)
at
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$EDataTyp eValueHandler.isValid(PropertyDescriptor.java:176)
at org.eclipse.jface.viewers.CellEditor.isCorrect(CellEditor.ja va:529)
at
org.eclipse.emf.edit.ui.provider.PropertyDescriptor$EDataTyp eCellEditor.isCorrect(PropertyDescriptor.java:253)
at org.eclipse.jface.viewers.CellEditor.setValue(CellEditor.jav a:853)
at
org.eclipse.ui.views.properties.PropertySheetEntry.getEditor (PropertySheetEntry.java:384)
at
org.eclipse.ui.views.properties.PropertySheetViewer.activate CellEditor(PropertySheetViewer.java:163)
at
org.eclipse.ui.views.properties.PropertySheetViewer.handleSe lect(PropertySheetViewer.java:727)
at
org.eclipse.ui.views.properties.PropertySheetViewer.access$8 (PropertySheetViewer.java:707)
at
org.eclipse.ui.views.properties.PropertySheetViewer$6.mouseD own(PropertySheetViewer.java:816)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:185)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

Regards,
Toñi
Previous Topic:[texo] Annotations not generated
Next Topic:[Emfatic] Pattern Validation and Creating Dynamic Instances
Goto Forum:
  


Current Time: Wed Jul 30 03:07:54 EDT 2014

Powered by FUDForum. Page generated in 0.01683 seconds