I hate exceptions. Yes, I really hate exceptions.
I’ve defined a EDataType EPoint that uses the java class org.eclipse.draw2d.geometry.Point.
In the code I set the start and end point of the ElementView by the corresponding setter that I pass instances of the class Point ( and not EPoint! ).
ElementView view = factory.createElementView(); view.setStartPoint(new Point(20, 20)); view.setEndPoint(new Point(100, 100));
Saving the model produces the following file content:
The instances are serialized by the method toString() of the class Point which outputs Point(xx, yy) but these values lead the loading process fail while this message appears:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'Point(20, 20)' is not legal. (file:/.../test1/model.pe, 7, 76) 18:28:12 zprototype.model.impl.ModelManagerImpl::load Model could not be loaded (org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'Point(20, 20)' is not legal. (file:/.../test1/model.pe, 7, 76)) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397) at zprototype.model.impl.ModelManagerImpl.load(ModelManagerImpl.java:63)
I tried to replace the Point class by another one but it’s the same problem with that. Now my question is why the value is not legal? Does the deserializer not know how to create the objects from the string?