|
Re: ignoring unknown entries [message #535977 is a reply to message #535919] |
Wed, 26 May 2010 14:25 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------060905010804030208050809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Mauro,
This option is useful:
/**
* This options allows you to record unknown features during
deserialization/loading.
* The default is <code>Boolean.FALSE</code> unless set to
<code>Boolean.TRUE</code> explicitly.
* The unknown features and their values can be accessed via
getEObjectToExtensionMap().
* @see #getEObjectToExtensionMap()
*/
String OPTION_RECORD_UNKNOWN_FEATURE = "RECORD_UNKNOWN_FEATURE";
Note that it doesn't just ignore them, it records them, so you'd have to
clear out the map if you don't want them saved.
Mauro Condarelli wrote:
> Hi,
> I recently simplified my models.
> As a result I have now several XML files I'm unable to read back because:
>
> Problem loading file:/C:/Tmp/La-Missione.world
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'time' not found. (file:/C:/Tmp/La-Missione.world, 4, 73)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at it.condarelli.writer.model.world.Model.load(Model.java:55)
> at it.condarelli.writer.model.world.Model.<init>(Model.java:38)
> at it.condarelli.writer.editors.WorldEditor.init(WorldEditor.ja va:150)
> ...
>
> Which is perfectly right (Feature 'time' was deleted from the model).
>
> Is there some Option I can give to
>
> resource = resourceSet.getResource(uri, true);
>
> to simply ignore "unknown" features?
>
> What is the standard way to handle an evolving model in the life-cycle of an application?
>
> TiA
> Mauro
>
--------------060905010804030208050809
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mauro,<br>
<br>
This option is useful:<br>
<blockquote> /**<br>
* This options allows you to record unknown features during
deserialization/loading.<br>
* The default is <code>Boolean.FALSE</code> unless set
to <code>Boolean.TRUE</code> explicitly. <br>
* The unknown features and their values can be accessed via
getEObjectToExtensionMap().<br>
* @see #getEObjectToExtensionMap() <br>
*/<br>
String OPTION_RECORD_UNKNOWN_FEATURE = "RECORD_UNKNOWN_FEATURE";<br>
</blockquote>
Note that it doesn't just ignore them, it records them, so you'd have
to clear out the map if you don't want them saved.<br>
<br>
<br>
Mauro Condarelli wrote:
<blockquote cite="mid:htiug0$qpf$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,
I recently simplified my models.
As a result I have now several XML files I'm unable to read back because:
Problem loading <a class="moz-txt-link-freetext" href="file:/C:/Tmp/La-Missione.world">file:/C:/Tmp/La-Missione.world </a>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'time' not found. (<a class="moz-txt-link-freetext" href="file:/C:/Tmp/La-Missione.world">file:/C:/Tmp/La-Missione.world </a>, 4, 73)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at it.condarelli.writer.model.world.Model.load(Model.java:55)
at it.condarelli.writer.model.world.Model.<init>( Model.java:38)
at it.condarelli.writer.editors.WorldEditor.init(WorldEditor.ja va:150)
....
Which is perfectly right (Feature 'time' was deleted from the model).
Is there some Option I can give to
resource = resourceSet.getResource(uri, true);
to simply ignore "unknown" features?
What is the standard way to handle an evolving model in the life-cycle of an application?
TiA
Mauro
</pre>
</blockquote>
</body>
</html>
--------------060905010804030208050809--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02371 seconds