Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » serialize xml (non-containment) revisited
serialize xml (non-containment) revisited [message #420629] Fri, 04 July 2008 09:19 Go to next message
ronald Mising name is currently offline ronald Mising name
Messages: 52
Registered: July 2009
Member
Hi all,

Sorry to re-open this topic, I've tried very hard to get this working
but I didn't succeed yet.

I've created a small model from java annotations:

/**
* @model
*/
public interface MM_Document extends EObject {

/**
* @model containment="true"
*/
MM_Application getMM_Application();
....
}

The result from the code given below is

<?xml version="1.0" encoding="ASCII"?>
<MM_Document xmlns="http:///www.xmltest.com/designer"/>

Whereas I´d have expected/need something like

<?xml version="1.0" encoding="ASCII"?>
<MM_Document xmlns="http:///www.xmltest.com/designer"
<MM_Application name="testname" version="123"/>
</MM_Document>

1) So, Is this a non-containment relation and can it be saved to XML?
2) What exactly determines the tagnames ? (Like MM_Application) for I
remember getting something like mM_Application and mMApplication...

TIA
Ronaldo

DesignerFactory factory = DesignerFactory.eINSTANCE;
DesignerPackage designerPackage = DesignerPackage.eINSTANCE;
designerPackage.setName("bd");
designerPackage.setNsPrefix("");
designerPackage.setNsURI("http:///www.xmltest.com/designer");

MM_Application application
=DesignerPackage.getDesignerFactory().createMM_Application() ;
application.setName("testname");
application.setVersion("123");

MM_Document document =
designerPackage.getDesignerFactory().createMM_Document();
document.setMM_Application(application);

ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("xml", new DesignerResourceFactoryImpl());

URI fileURI = URI.createFileURI(new
File("test/TestSerialize.xml").getAbsolutePath());

Resource resource = resourceSet.createResource(fileURI);
resource.getContents().add(document);
resource.getContents().add(application);
resource.getContents().add(storageUnit);

Map options = new HashMap();
options.put(XMLResource.OPTION_ENCODING, "UTF-8");
try {
resource.save(System.out, null);
resource.save(options);
} catch (IOException e) {
}
Re: serialize xml (non-containment) revisited [message #420634 is a reply to message #420629] Fri, 04 July 2008 11:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Ronaldo,

Comments below.

Ronaldo wrote:
> Hi all,
>
> Sorry to re-open this topic, I've tried very hard to get this working
> but I didn't succeed yet.
>
> I've created a small model from java annotations:
>
> /**
> * @model
> */
> public interface MM_Document extends EObject {
>
> /**
> * @model containment="true"
> */
> MM_Application getMM_Application();
> ....
> }
>
> The result from the code given below is
>
> <?xml version="1.0" encoding="ASCII"?>
> <MM_Document xmlns="http:///www.xmltest.com/designer"/>
>
> Whereas I´d have expected/need something like
>
> <?xml version="1.0" encoding="ASCII"?>
> <MM_Document xmlns="http:///www.xmltest.com/designer"
> <MM_Application name="testname" version="123"/>
> </MM_Document>
>
> 1) So, Is this a non-containment relation and can it be saved to XML?
> 2) What exactly determines the tagnames ? (Like MM_Application) for I
> remember getting something like mM_Application and mMApplication...
The tag name is determined by the feature name. For XML Schema based
models, they're typically a document root with features corresponding to
global element declarations. If there's no document root instance at
the root of the resource, the EClass's name is used as the name of the
root element. Extended meta data annotations can be used to tailor the
name used in the XML to be different from the actual name used in the
Ecore model.
>
> TIA
> Ronaldo
>
> DesignerFactory factory = DesignerFactory.eINSTANCE;
> DesignerPackage designerPackage = DesignerPackage.eINSTANCE;
> designerPackage.setName("bd");
> designerPackage.setNsPrefix("");
> designerPackage.setNsURI("http:///www.xmltest.com/designer");
>
> MM_Application application
> =DesignerPackage.getDesignerFactory().createMM_Application() ;
> application.setName("testname");
> application.setVersion("123");
>
> MM_Document document =
> designerPackage.getDesignerFactory().createMM_Document();
> document.setMM_Application(application);
>
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("xml", new DesignerResourceFactoryImpl());
>
> URI fileURI = URI.createFileURI(new
> File("test/TestSerialize.xml").getAbsolutePath());
>
> Resource resource = resourceSet.createResource(fileURI);
> resource.getContents().add(document);
> resource.getContents().add(application);
Notice that you're adding the application directly to the resource's
contents. This will remove it as a contained child of the document.
Also, an XMLResource is not able to serialize multiple root objects
(because you can only have one root element in XML).
> resource.getContents().add(storageUnit);
>
> Map options = new HashMap();
> options.put(XMLResource.OPTION_ENCODING, "UTF-8");
> try {
> resource.save(System.out, null);
> resource.save(options);
> } catch (IOException e) {
> }
Re: serialize xml (non-containment) revisited [message #420733 is a reply to message #420634] Wed, 09 July 2008 04:54 Go to previous messageGo to next message
ronald Mising name is currently offline ronald Mising name
Messages: 52
Registered: July 2009
Member
Hi,

Problem: I get a Feature 'MM_Application' not found when loading the XML
file.

I´ve succeeded in saving a model like this from Java annotations. Using
an annotation in the ecore model, I've renamed the mM_Application to
MM_Application which is what I want:

<?xml version="1.0" encoding="UTF-8"?>
<MM_Document
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http:///com/test/designer/model.ecore">
<MM_Application version="1234"/>
</MM_Document>

I guess I will be able to remove the noNamespaceSchemaLocation later and
set the xmlms:xsi to the real namespace.
But... I can't load this file, not even with the generated XYZExample
file in the generated test project... And not in the generated editor.
I get a Feature 'MM_Application' not found...

My guess is that the ecore annotation is lost, and that I need to set it
somehow when loading the xml. But I'm also using the generated
XyZResourceFactoryImpl, am I (?), so I figured that should do add all
the necessary things...

This is the code to create and save the model:

modelPackage = ModelPackage.eINSTANCE;
modelFactory = ModelFactory.eINSTANCE;

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "xml",
new ModelResourceFactoryImpl());

resourceSet = new ResourceSetImpl();

File xmlFile = new File("test/testSerialize.xml");
URI xmlLocationUri = URI.createFileURI(xmlFile.getAbsolutePath());

Resource resource = resourceSet.createResource(xmlLocationUri);

EClass eClass = (EClass)modelPackage.getEClassifier("Document");
EObject rootObject = modelFactory.create(eClass);
resource.getContents().add(rootObject);

Document document = (Document)rootObject;

Application application = modelFactory.createApplication();
application.setVersion("1234");

document.setApplication(application);

Map<Object, Object> options = new HashMap<Object, Object>();
options.put(XMLResource.OPTION_ENCODING, "UTF-8");
try {
resource.save(options);
} catch (IOException e) {
throw new RuntimeException(e);
}


And here is the code to load the XML:

File xmlFile = new File("test/testSerialize.xml");
URI xmlLocationUri = URI.createFileURI(xmlFile.getAbsolutePath());

ModelResourceFactoryImpl modelResourceFactory = new
ModelResourceFactoryImpl();
Resource resource = modelResourceFactory.createResource(xmlLocationUri);

HashMap options = new HashMap();
options.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
try {
resource.load(options);
} catch (IOException e) {
e.printStackTrace();
}

Just to be sure; here's the ModelResourceFactoryImpl's createResource
method:

public Resource createResource(URI uri) {
XMLResource result = new ModelResourceImpl(uri);
result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTEND ED_META_DATA,
extendedMetaData);
result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTEND ED_META_DATA,
extendedMetaData);
result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA _LOCATION,
Boolean.TRUE);
result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_EN CODED_ATTRIBUTE_STYLE,
Boolean.TRUE);
result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_EN CODED_ATTRIBUTE_STYLE,
Boolean.TRUE);
result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LE XICAL_HANDLER,
Boolean.TRUE);
return result;
}

I'm going slightly mad over this, any help is very appreciated.

Ronaldo


Ed Merks wrote:
> Ronaldo,
>
> Comments below.
>
> Ronaldo wrote:
>> Hi all,
>>
>> Sorry to re-open this topic, I've tried very hard to get this working
>> but I didn't succeed yet.
>>
>> I've created a small model from java annotations:
>>
>> /**
>> * @model
>> */
>> public interface MM_Document extends EObject {
>>
>> /**
>> * @model containment="true"
>> */
>> MM_Application getMM_Application();
>> ....
>> }
>>
>> The result from the code given below is
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <MM_Document xmlns="http:///www.xmltest.com/designer"/>
>>
>> Whereas I´d have expected/need something like
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <MM_Document xmlns="http:///www.xmltest.com/designer"
>> <MM_Application name="testname" version="123"/>
>> </MM_Document>
>>
>> 1) So, Is this a non-containment relation and can it be saved to XML?
>> 2) What exactly determines the tagnames ? (Like MM_Application) for I
>> remember getting something like mM_Application and mMApplication...
> The tag name is determined by the feature name. For XML Schema based
> models, they're typically a document root with features corresponding to
> global element declarations. If there's no document root instance at
> the root of the resource, the EClass's name is used as the name of the
> root element. Extended meta data annotations can be used to tailor the
> name used in the XML to be different from the actual name used in the
> Ecore model.
>>
>> TIA
>> Ronaldo
>>
>> DesignerFactory factory = DesignerFactory.eINSTANCE;
>> DesignerPackage designerPackage = DesignerPackage.eINSTANCE;
>> designerPackage.setName("bd");
>> designerPackage.setNsPrefix("");
>> designerPackage.setNsURI("http:///www.xmltest.com/designer");
>>
>> MM_Application application
>> =DesignerPackage.getDesignerFactory().createMM_Application() ;
>> application.setName("testname");
>> application.setVersion("123");
>>
>> MM_Document document =
>> designerPackage.getDesignerFactory().createMM_Document();
>> document.setMM_Application(application);
>>
>> ResourceSet resourceSet = new ResourceSetImpl();
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
>> .put("xml", new DesignerResourceFactoryImpl());
>>
>> URI fileURI = URI.createFileURI(new
>> File("test/TestSerialize.xml").getAbsolutePath());
>>
>> Resource resource = resourceSet.createResource(fileURI);
>> resource.getContents().add(document);
>> resource.getContents().add(application);
> Notice that you're adding the application directly to the resource's
> contents. This will remove it as a contained child of the document.
> Also, an XMLResource is not able to serialize multiple root objects
> (because you can only have one root element in XML).
>> resource.getContents().add(storageUnit);
>> Map options = new HashMap();
>> options.put(XMLResource.OPTION_ENCODING, "UTF-8");
>> try {
>> resource.save(System.out, null);
>> resource.save(options);
>> } catch (IOException e) {
>> }
Re: serialize xml (non-containment) revisited [message #420738 is a reply to message #420733] Wed, 09 July 2008 06:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Ronaldo,

Comments below.

Ronaldo wrote:
> Hi,
>
> Problem: I get a Feature 'MM_Application' not found when loading the
> XML file.
Sounds like to be an options issue. It makes me wonder if you're using
the generated resource factory to save and load your instances.
>
> I´ve succeeded in saving a model like this from Java annotations.
> Using an annotation in the ecore model, I've renamed the
> mM_Application to MM_Application which is what I want:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <MM_Document
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http:///com/test/designer/model.ecore">
> <MM_Application version="1234"/>
> </MM_Document>
>
> I guess I will be able to remove the noNamespaceSchemaLocation later
> and set the xmlms:xsi to the real namespace.
This also seems likely to be an options issue...
> But... I can't load this file, not even with the generated XYZExample
> file in the generated test project... And not in the generated editor.
> I get a Feature 'MM_Application' not found...
Have you done something in terms of change which extensions your editor
supports?
>
> My guess is that the ecore annotation is lost, and that I need to set
> it somehow when loading the xml. But I'm also using the generated
> XyZResourceFactoryImpl, am I (?), so I figured that should do add all
> the necessary things...
It sounds like you aren't.
>
> This is the code to create and save the model:
>
> modelPackage = ModelPackage.eINSTANCE;
> modelFactory = ModelFactory.eINSTANCE;
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "xml",
> new ModelResourceFactoryImpl());
This extension should happen in your generated plugin.xml. In EMF 2.4
you can exploit content type-based registration. The generator also
lets you specify which extension you want your factory and editor to
support via options in the GenPackage (one level down from the root
GenModel in the Generator).

Also note that you can invoke Generate Test Code and that will generate
a *.tests project with an XyzExample.java that shows much of what your
doing here. It's more careful to register the resource factory local to
the package registry rather than in the global registry.
>
> resourceSet = new ResourceSetImpl();
>
> File xmlFile = new File("test/testSerialize.xml");
> URI xmlLocationUri = URI.createFileURI(xmlFile.getAbsolutePath());
>
> Resource resource = resourceSet.createResource(xmlLocationUri);
>
> EClass eClass = (EClass)modelPackage.getEClassifier("Document");
Given you've generated the code, ModelFactory.eINSTANCE.createDocument()
would seem to be better. I wonder if you shouldn't be creating a
DocumentRoot instance though; have a look at the generated example to
see how to do that properly for an XML Schema-based model..
> EObject rootObject = modelFactory.create(eClass);
> resource.getContents().add(rootObject);
>
> Document document = (Document)rootObject;
>
> Application application = modelFactory.createApplication();
> application.setVersion("1234");
>
> document.setApplication(application);
>
> Map<Object, Object> options = new HashMap<Object, Object>();
> options.put(XMLResource.OPTION_ENCODING, "UTF-8");
You could change the default encoding in the generated resource factory.
> try {
> resource.save(options);
> } catch (IOException e) {
> throw new RuntimeException(e);
> }
>
>
> And here is the code to load the XML:
>
> File xmlFile = new File("test/testSerialize.xml");
> URI xmlLocationUri = URI.createFileURI(xmlFile.getAbsolutePath());
>
> ModelResourceFactoryImpl modelResourceFactory = new
> ModelResourceFactoryImpl();
> Resource resource = modelResourceFactory.createResource(xmlLocationUri);
>
> HashMap options = new HashMap();
> options.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
> try {
> resource.load(options);
> } catch (IOException e) {
> e.printStackTrace();
> }
>
> Just to be sure; here's the ModelResourceFactoryImpl's createResource
> method:
>
> public Resource createResource(URI uri) {
> XMLResource result = new ModelResourceImpl(uri);
> result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTEND ED_META_DATA,
> extendedMetaData);
> result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTEND ED_META_DATA,
> extendedMetaData);
I can tell you had a null namespace schema.
> result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA _LOCATION,
> Boolean.TRUE);
> result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_EN CODED_ATTRIBUTE_STYLE,
> Boolean.TRUE);
> result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_EN CODED_ATTRIBUTE_STYLE,
> Boolean.TRUE);
> result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LE XICAL_HANDLER,
> Boolean.TRUE);
> return result;
> }
>
> I'm going slightly mad over this, any help is very appreciated.
It sounds to me likely that you need to use a document root at the root
of the document. Try starting with the generated example. In terms of
integration with Eclipse, use the generator options to control the
extension that's used and since you want an extension like "xml" which
will collide with others using that extension, you'll want to take
advantage of content types; keep in mind that if you change options that
change the generated plugin.xml registrations that this file does not
regenerate once it exists, so you need to delete it to regenerate it.
>
> Ronaldo
>
>
> Ed Merks wrote:
>> Ronaldo,
>>
>> Comments below.
>>
>> Ronaldo wrote:
>>> Hi all,
>>>
>>> Sorry to re-open this topic, I've tried very hard to get this
>>> working but I didn't succeed yet.
>>>
>>> I've created a small model from java annotations:
>>>
>>> /**
>>> * @model
>>> */
>>> public interface MM_Document extends EObject {
>>>
>>> /**
>>> * @model containment="true"
>>> */
>>> MM_Application getMM_Application();
>>> ....
>>> }
>>>
>>> The result from the code given below is
>>>
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <MM_Document xmlns="http:///www.xmltest.com/designer"/>
>>>
>>> Whereas I´d have expected/need something like
>>>
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <MM_Document xmlns="http:///www.xmltest.com/designer"
>>> <MM_Application name="testname" version="123"/>
>>> </MM_Document>
>>>
>>> 1) So, Is this a non-containment relation and can it be saved to XML?
>>> 2) What exactly determines the tagnames ? (Like MM_Application) for
>>> I remember getting something like mM_Application and mMApplication...
>> The tag name is determined by the feature name. For XML Schema based
>> models, they're typically a document root with features corresponding
>> to global element declarations. If there's no document root instance
>> at the root of the resource, the EClass's name is used as the name of
>> the root element. Extended meta data annotations can be used to
>> tailor the name used in the XML to be different from the actual name
>> used in the Ecore model.
>>>
>>> TIA
>>> Ronaldo
>>>
>>> DesignerFactory factory = DesignerFactory.eINSTANCE;
>>> DesignerPackage designerPackage = DesignerPackage.eINSTANCE;
>>> designerPackage.setName("bd");
>>> designerPackage.setNsPrefix("");
>>> designerPackage.setNsURI("http:///www.xmltest.com/designer");
>>>
>>> MM_Application application
>>> =DesignerPackage.getDesignerFactory().createMM_Application() ;
>>> application.setName("testname");
>>> application.setVersion("123");
>>>
>>> MM_Document document =
>>> designerPackage.getDesignerFactory().createMM_Document();
>>> document.setMM_Application(application);
>>>
>>> ResourceSet resourceSet = new ResourceSetImpl();
>>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
>>> .put("xml", new DesignerResourceFactoryImpl());
>>>
>>> URI fileURI = URI.createFileURI(new
>>> File("test/TestSerialize.xml").getAbsolutePath());
>>>
>>> Resource resource = resourceSet.createResource(fileURI);
>>> resource.getContents().add(document);
>>> resource.getContents().add(application);
>> Notice that you're adding the application directly to the resource's
>> contents. This will remove it as a contained child of the document.
>> Also, an XMLResource is not able to serialize multiple root objects
>> (because you can only have one root element in XML).
>>> resource.getContents().add(storageUnit);
>>> Map options = new HashMap();
>>> options.put(XMLResource.OPTION_ENCODING, "UTF-8");
>>> try {
>>> resource.save(System.out, null);
>>> resource.save(options);
>>> } catch (IOException e) {
>>> }
Re: serialize xml (non-containment) revisited [message #420751 is a reply to message #420738] Wed, 09 July 2008 09:49 Go to previous message
Ronald is currently offline Ronald
Messages: 68
Registered: July 2009
Member
Hi Ed,

I'm really sorry, I don't get it. I've used EMF for 2 years now, I
customized JET and build my own plugins, but this "simple" xml
serialization.... I'm sorry but I feel like a noob... :(

So lets get back to the basics... I've provided all the steps I need I
think. The problem arises in step 2 when I add annotations to rename the
tags being used (i.e. storageUnit --> MM_StorageUnit).

When I generate the test plugin, the Example is like

ResourceSet resourceSet = new ResourceSetImpl();
// Register the appropriate resource factory to handle all file
extensions.
//
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put
(Resource.Factory.Registry.DEFAULT_EXTENSION, new
ModelResourceFactoryImpl());
// Register the package to ensure it is available during loading.
//
resourceSet.getPackageRegistry().put(ModelPackage.eNS_URI,
ModelPackage.eINSTANCE);
// If there are no arguments, emit an appropriate usage message.
//
if (args.length == 0) {
System.out.println("Enter a list of file paths or URIs that have content
like this:"); //$NON-NLS-1$
try {
Resource resource =
resourceSet.createResource(URI.createURI("http:///My.model")); //$NON-NLS-1$
Application root = ModelFactory.eINSTANCE.createApplication();
resource.getContents().add(root);
resource.save(System.out, null);
}
catch (IOException exception) {
exception.printStackTrace();
}
}

and it produces

<?xml version="1.0" encoding="ASCII"?>
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="com/test/designer/model.ecore "/>

Question:
1) What do you mean by using a documentRoot... I only see that the generator
uses the first element (child of the package) in the genmodel to create this
example. Is this correct?

== STEP 1 ==
Next, I modified the example to add an additional element:
......
try {
...
resource.getContents().add(root);
StorageUnit storageUnit = ModelFactory.eINSTANCE.createStorageUnit();
<==== ADD ADDITIONAL SUB ELEMENT
storageUnit.setName("some name");
root.setStorageUnit(storageUnit);

resource.save(System.out, null);
}
catch (IOException exception) {
......

Which produces:

<?xml version="1.0" encoding="ASCII"?>
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="com/test/designer/model.ecore ">
<storageUnit name="some name"/>
</Application>

Note that the tag "storageUnit" starts with a lowercase character. Reading
this back by providing the file as an argument to the example shows no
problems. It loads fine.

== STEP 2 ==
I modified the ecore in the ecore editor to add metadata annotations. The
resulting ecore is attached.

Regenerating everything and running the example test produces:

<?xml version="1.0" encoding="ASCII"?>
<MM_Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="com/test/designer/model.ecore "/>

After adding a second element, it looks like

<?xml version="1.0" encoding="ASCII"?>
<MM_Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="com/test/designer/model.ecore ">
<MM_StorageUnit name="some name"/>
</MM_Application>

Which is promising... But when I try to reload this same file (yes, I copied
the contents to a file and provided that file as an argument) the result is

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'MM_StorageUnit'
not found. (file:/P:/workspace/Designer.tests/model/test.xml, 3, 37)
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)

So, the generated code can write the file but cannot read it back?

Questions:
2) What do I need to change on the example to be able to read the file?
3) Is changing the tag name using extendedMetaData annotations the right
way?
4) Do I have to add an annotation to the class, the method or both and are
they preserved when reloading the genmodel?

Any help is very appreciated.

Ronaldo


Previous Topic:How to reuse models stored within installed plugins
Next Topic:Position of generated CDO.MF
Goto Forum:
  


Current Time: Tue Sep 02 10:05:51 EDT 2014

Powered by FUDForum. Page generated in 0.02347 seconds