Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » serialized EObjects with xmi
serialized EObjects with xmi [message #428878] Wed, 01 April 2009 12:13 Go to next message
Michael Burkhardt is currently offline Michael BurkhardtFriend
Messages: 64
Registered: July 2009
Member
Hello *,

I have a tree of EObjects and want to serialize them. Within a XMI file is a
description of my model. I read about serialize EObjects to String by using XMI,
but I did'nt found any tutorial, which describes this transformation.

Has anybody an idea how to do this?

Ciao, Micha
Re: serialized EObjects with xmi [message #428879 is a reply to message #428878] Wed, 01 April 2009 12:23 Go to previous messageGo to next message
Palash is currently offline PalashFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Michael,

Edit the default JET template so that the generated EMF interfaces all
extend java.io.Serializable.

This is how you can do it:

http://blog.eclipse-tips.com/2008/08/using-dynamic-templates -in-emf.html

Regards,
Palash.

Michael Burkhardt wrote:

> Hello *,

> I have a tree of EObjects and want to serialize them. Within a XMI file is a
> description of my model. I read about serialize EObjects to String by using
XMI,
> but I did'nt found any tutorial, which describes this transformation.

> Has anybody an idea how to do this?

> Ciao, Micha
Re: serialized EObjects with xmi [message #428887 is a reply to message #428878] Wed, 01 April 2009 13:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060602050600080908080106
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Micha,

I'm not sure if you were talking about java.io.Serializeable as Palash
assumed. Maybe this answers your question:
< http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8706.html>

http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8706.html

Of course XML resource has this method so you can use a string writer
directly with that to save to an in-memory string.

/**
* Saves the resource to the writer using the specified options.
* @param writer the writer
* @param options the save options.
*/
void save(Writer writer, Map<?, ?> options) throws IOException;


Michael Burkhardt wrote:
> Hello *,
>
> I have a tree of EObjects and want to serialize them. Within a XMI
> file is a description of my model. I read about serialize EObjects to
> String by using XMI, but I did'nt found any tutorial, which describes
> this transformation.
>
> Has anybody an idea how to do this?
>
> Ciao, Micha

--------------060602050600080908080106
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Micha,<br>
<br>
I'm not sure if you were talking about java.io.Serializeable as Palash
assumed.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: serialized EObjects with xmi [message #428907 is a reply to message #428887] Wed, 01 April 2009 15:38 Go to previous messageGo to next message
Michael Burkhardt is currently offline Michael BurkhardtFriend
Messages: 64
Registered: July 2009
Member
Hi Ed,

I don't mean java.io.Serializeable. It would be great, if the XMI file would be
used to create a String. In the XMI are information about concat and describe
EObject as String.

Ciao, Micha

--- Original-Nachricht ---
Absender: Ed Merks
Datum: 01.04.2009 15:17
> Micha,
>
> I'm not sure if you were talking about java.io.Serializeable as Palash
> assumed. Maybe this answers your question:
> < http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8706.html>
>
> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8706.html
>
> Of course XML resource has this method so you can use a string writer
> directly with that to save to an in-memory string.
>
> /**
> * Saves the resource to the writer using the specified options.
> * @param writer the writer
> * @param options the save options.
> */
> void save(Writer writer, Map<?, ?> options) throws IOException;
>
>
> Michael Burkhardt wrote:
>> Hello *,
>>
>> I have a tree of EObjects and want to serialize them. Within a XMI
>> file is a description of my model. I read about serialize EObjects to
>> String by using XMI, but I did'nt found any tutorial, which describes
>> this transformation.
>>
>> Has anybody an idea how to do this?
>>
>> Ciao, Micha
Re: serialized EObjects with xmi [message #428910 is a reply to message #428907] Wed, 01 April 2009 16:28 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Micha,

I did answer that question though didn't I? I.e., save to a
StringWriter. Or am I still missing the point?

Michael Burkhardt wrote:
> Hi Ed,
>
> I don't mean java.io.Serializeable. It would be great, if the XMI file
> would be used to create a String. In the XMI are information about
> concat and describe EObject as String.
>
> Ciao, Micha
>
> --- Original-Nachricht ---
> Absender: Ed Merks
> Datum: 01.04.2009 15:17
>> Micha,
>>
>> I'm not sure if you were talking about java.io.Serializeable as
>> Palash assumed. Maybe this answers your question:
>> < http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8706.html>
>>
>>
>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8706.html
>>
>> Of course XML resource has this method so you can use a string writer
>> directly with that to save to an in-memory string.
>>
>> /**
>> * Saves the resource to the writer using the specified options.
>> * @param writer the writer
>> * @param options the save options.
>> */
>> void save(Writer writer, Map<?, ?> options) throws IOException;
>>
>>
>> Michael Burkhardt wrote:
>>> Hello *,
>>>
>>> I have a tree of EObjects and want to serialize them. Within a XMI
>>> file is a description of my model. I read about serialize EObjects
>>> to String by using XMI, but I did'nt found any tutorial, which
>>> describes this transformation.
>>>
>>> Has anybody an idea how to do this?
>>>
>>> Ciao, Micha


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:emf load
Next Topic:create an instance of association in EMF
Goto Forum:
  


Current Time: Fri Mar 29 12:12:57 GMT 2024

Powered by FUDForum. Page generated in 0.04266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top