Skip to main content



      Home
Home » Modeling » EMF » Serializing a list of any type
Serializing a list of any type [message #409760] Fri, 01 June 2007 10:00 Go to next message
Eclipse UserFriend
Hi,

I would like to create an EObject with an attribute called allMyObjects.

This attribute would be used to store any type of objects i.e.: EObject,
EList, String, Integer, Long, Date etc.

I thought of modeling this with a "to many" relation of EJavaObject but I've
found out that EJavaObject are not serialized by Resources.

What are the options when it comes to modeling a list of any type and have
this list saved and retrieved from at Resource?

Thanks
Jean-Claude
Re: Serializing a list of any type [message #409762 is a reply to message #409760] Fri, 01 June 2007 10:44 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------030706090702070501020903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jean-Claude,

In EMF 2.3 we've made EJavaObject a serializeable EDataType, but it's
implemented to use java.io.Serializeable, so the resulting serialization
is not human readable and is extremely verbose. It might be better use
an multi-valued EReference to EObject and then serialize EObjects that
are instances of SimpleAnyType which is very similar to Java's wrapper
types for primitives, i.e., an Integer is a java.lang.Object, but an int
is not. This search page is a great place to look up previous answers
related to this:

http://www.eclipse.org/search/search.cgi?cmd=Search%21&f orm=extended&wf=574a74&ps=10&m=all&t=5&u l=%2Fnewslists%2Fnews.eclipse.tools.emf&wm=wrd&t=New s&t=Mail
< http://www.eclipse.org/search/search.cgi?cmd=Search%21&f orm=extended&wf=574a74&ps=10&m=all&t=5&u l=%2Fnewslists%2Fnews.eclipse.tools.emf&wm=wrd&t=New s&t=Mail>


jc wrote:
> Hi,
>
> I would like to create an EObject with an attribute called allMyObjects.
>
> This attribute would be used to store any type of objects i.e.: EObject,
> EList, String, Integer, Long, Date etc.
>
> I thought of modeling this with a "to many" relation of EJavaObject but I've
> found out that EJavaObject are not serialized by Resources.
>
> What are the options when it comes to modeling a list of any type and have
> this list saved and retrieved from at Resource?
>
> Thanks
> Jean-Claude
>
>
>
>
>
>


--------------030706090702070501020903
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">
Jean-Claude,<br>
<br>
In EMF 2.3 we've made EJavaObject a serializeable EDataType, but it's
implemented to use java.io.Serializeable, so the resulting
serialization is not human readable and is extremely verbose.&nbsp; It might
be better use an multi-valued EReference to EObject and then serialize
EObjects that are instances of SimpleAnyType which is very similar to
Java's wrapper types for primitives, i.e., an Integer is a
java.lang.Object, but an int is not.&nbsp;&nbsp; This search page is a great
place to look up previous answers related to this:<br>
<blockquote><a
href=" http://www.eclipse.org/search/search.cgi?cmd=Search%21&a mp ;form=extended&amp;wf=574a74&amp;ps=10&amp;m=all &amp;t=5&amp;ul=%2Fnewslists%2Fnews.eclipse.tools.em f&amp;wm=wrd&amp;t=News&amp;t=Mail "> http://www.eclipse.org/search/search.cgi?cmd=Search%21&a mp ;form=extended&amp;wf=574a74&amp;ps=10&amp;m=all &amp;t=5&amp;ul=%2Fnewslists%2Fnews.eclipse.tools.em f&amp;wm=wrd&amp;t=News&amp;t=Mail </a><br>
</blockquote>
<br>
jc wrote:
<blockquote cite="mid:f3p8qm$nf$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,

I would like to create an EObject with an attribute called allMyObjects.

This attribute would be used to store any type of objects i.e.: EObject,
EList, String, Integer, Long, Date etc.

I thought of modeling this with a "to many" relation of EJavaObject but I've
found out that EJavaObject are not serialized by Resources.

What are the options when it comes to modeling a list of any type and have
this list saved and retrieved from at Resource?

Thanks
Jean-Claude





</pre>
</blockquote>
<br>
</body>
</html>

--------------030706090702070501020903--
Re: Serializing a list of any type [message #409769 is a reply to message #409762] Fri, 01 June 2007 13:17 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0071_01C7A44F.3BDC3F50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I've searched for the SimpleAnyType and that's what I would need.

However I do I specify this in the Ecore Model Editor. Seems like a bit =
of a dumb question but the GUI that I have does not seem to have the =
SimpleAnyType option. I'm using EMF 2.1.
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:f3pbdj$lrr$1@build.eclipse.org...
Jean-Claude,

In EMF 2.3 we've made EJavaObject a serializeable EDataType, but it's =
implemented to use java.io.Serializeable, so the resulting serialization =
is not human readable and is extremely verbose. It might be better use =
an multi-valued EReference to EObject and then serialize EObjects that =
are instances of SimpleAnyType which is very similar to Java's wrapper =
types for primitives, i.e., an Integer is a java.lang.Object, but an int =
is not. This search page is a great place to look up previous answers =
related to this:

=
http://www.eclipse.org/search/search.cgi?cmd=3DSearch%21& ;form=3Dextended&=
wf=3D574a74&ps=3D10&m=3Dall&t=3D5&ul=3D%2Fne wslists%2Fnews.eclipse.tools.=
emf&wm=3Dwrd&t=3DNews&t=3DMail


jc wrote:=20
Hi,

I would like to create an EObject with an attribute called allMyObjects.

This attribute would be used to store any type of objects i.e.: EObject, =

EList, String, Integer, Long, Date etc.

I thought of modeling this with a "to many" relation of EJavaObject but =
I've=20
found out that EJavaObject are not serialized by Resources.

What are the options when it comes to modeling a list of any type and =
have=20
this list saved and retrieved from at Resource?

Thanks
Jean-Claude





=20

------=_NextPart_000_0071_01C7A44F.3BDC3F50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I've searched for the SimpleAnyType and =
that's what=20
I would need.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However I do I specify this in the =
Ecore Model=20
Editor. Seems like a bit of a dumb question but the GUI that I have does =
not=20
seem to have the SimpleAnyType option. I'm using EMF 2.1.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:f3pbdj$lrr$1@build.eclipse.org">news:f3pbdj$lrr$1@build.ecli=
pse.org</A>...</DIV>Jean-Claude,<BR><BR>In=20
EMF 2.3 we've made EJavaObject a serializeable EDataType, but it's =
implemented=20
to use java.io.Serializeable, so the resulting serialization is not =
human=20
readable and is extremely verbose.&nbsp; It might be better use an=20
multi-valued EReference to EObject and then serialize EObjects that =
are=20
instances of SimpleAnyType which is very similar to Java's wrapper =
types for=20
primitives, i.e., an Integer is a java.lang.Object, but an int is=20
not.&nbsp;&nbsp; This search page is a great place to look up previous =
answers=20
related to this:<BR>
<BLOCKQUOTE><A=20
=
href=3D" http://www.eclipse.org/search/search.cgi?cmd=3DSearch%21& ;amp;form=
=3Dextended&amp;wf=3D574a74&amp;ps=3D10&amp;m=3D all&amp;t=3D5&amp;ul=3D%2=
Fnewslists%2Fnews.eclipse.tools.emf&amp;wm=3Dwrd&amp ;t=3DNews&amp;t=3DMai=
l"> http://www.eclipse.org/search/search.cgi?cmd=3DSearch%21& ;amp;form=3Dex=
tended&amp;wf=3D574a74&amp;ps=3D10&amp;m=3Dall&a mp;amp;t=3D5&amp;ul=3D%2Fnews=
lists%2Fnews.eclipse.tools.emf&amp;wm=3Dwrd&amp;t=3D News&amp;t=3DMail </A>=
<BR></BLOCKQUOTE><BR>jc=20
wrote:=20
<BLOCKQUOTE cite=3Dmid:f3p8qm$nf$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi,

I would like to create an EObject with an attribute called allMyObjects.

This attribute would be used to store any type of objects i.e.: EObject, =

EList, String, Integer, Long, Date etc.

I thought of modeling this with a "to many" relation of EJavaObject but =
I've=20
found out that EJavaObject are not serialized by Resources.

What are the options when it comes to modeling a list of any type and =
have=20
this list saved and retrieved from at Resource?

Thanks
Jean-Claude





</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0071_01C7A44F.3BDC3F50--
Re: Serializing a list of any type [message #409770 is a reply to message #409769] Fri, 01 June 2007 13:49 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------010309020409010408050901
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

JC,

You'd need to load the XMLType.ecore model, which is in
org.eclipse.emf.ecore/model/XMLType.ecore, and that should make all of
it's classifiers available.


jc wrote:
> I've searched for the SimpleAnyType and that's what I would need.
>
> However I do I specify this in the Ecore Model Editor. Seems like a
> bit of a dumb question but the GUI that I have does not seem to have
> the SimpleAnyType option. I'm using EMF 2.1.
>
> "Ed Merks" <merks@ca.ibm.com <mailto:merks@ca.ibm.com>> wrote in
> message news:f3pbdj$lrr$1@build.eclipse.org...
> Jean-Claude,
>
> In EMF 2.3 we've made EJavaObject a serializeable EDataType, but
> it's implemented to use java.io.Serializeable, so the resulting
> serialization is not human readable and is extremely verbose. It
> might be better use an multi-valued EReference to EObject and then
> serialize EObjects that are instances of SimpleAnyType which is
> very similar to Java's wrapper types for primitives, i.e., an
> Integer is a java.lang.Object, but an int is not. This search
> page is a great place to look up previous answers related to this:
>
> http://www.eclipse.org/search/search.cgi?cmd=Search%21&f orm=extended&wf=574a74&ps=10&m=all&t=5&u l=%2Fnewslists%2Fnews.eclipse.tools.emf&wm=wrd&t=New s&t=Mail
> < http://www.eclipse.org/search/search.cgi?cmd=Search%21&f orm=extended&wf=574a74&ps=10&m=all&t=5&u l=%2Fnewslists%2Fnews.eclipse.tools.emf&wm=wrd&t=New s&t=Mail>
>
>
> jc wrote:
>> Hi,
>>
>> I would like to create an EObject with an attribute called allMyObjects.
>>
>> This attribute would be used to store any type of objects i.e.: EObject,
>> EList, String, Integer, Long, Date etc.
>>
>> I thought of modeling this with a "to many" relation of EJavaObject but I've
>> found out that EJavaObject are not serialized by Resources.
>>
>> What are the options when it comes to modeling a list of any type and have
>> this list saved and retrieved from at Resource?
>>
>> Thanks
>> Jean-Claude
>>
>>
>>
>>
>>
>>
>


--------------010309020409010408050901
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">
JC,<br>
<br>
You'd need to load the XMLType.ecore model, which is in
org.eclipse.emf.ecore/model/XMLType.ecore, and that should make all of
it's classifiers available.<br>
<br>
<br>
jc wrote:
<blockquote cite="mid:f3pkc3$h9c$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.3059" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">I've searched for the SimpleAnyType
and that's what I would need.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">However I do I specify this in the
Ecore Model Editor. Seems like a bit of a dumb question but the GUI
that I have does not seem to have the SimpleAnyType option. I'm using
EMF 2.1.</font></div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:merks@ca.ibm.com">merks@ca.ibm.com</a>&gt; wrote in
message <a moz-do-not-send="true"
href="news:f3pbdj$lrr$1@build.eclipse.org">news:f3pbdj$lrr$1@build.eclipse.org</a>...</div>
Jean-Claude,<br>
<br>
In EMF 2.3 we've made EJavaObject a serializeable EDataType, but it's
implemented to use java.io.Serializeable, so the resulting
serialization is not human readable and is extremely verbose.&nbsp; It might
be better use an multi-valued EReference to EObject and then serialize
EObjects that are instances of SimpleAnyType which is very similar to
Java's wrapper types for primitives, i.e., an Integer is a
java.lang.Object, but an int is not.&nbsp;&nbsp; This search page is a great
place to look up previous answers related to this:<br>
<blockquote><a moz-do-not-send="true"
href=" http://www.eclipse.org/search/search.cgi?cmd=Search%21&a mp ;form=extended&amp;wf=574a74&amp;ps=10&amp;m=all &amp;t=5&amp;ul=%2Fnewslists%2Fnews.eclipse.tools.em f&amp;wm=wrd&amp;t=News&amp;t=Mail "> http://www.eclipse.org/search/search.cgi?cmd=Search%21&a mp ;form=extended&amp;wf=574a74&amp;ps=10&amp;m=all &amp;t=5&amp;ul=%2Fnewslists%2Fnews.eclipse.tools.em f&amp;wm=wrd&amp;t=News&amp;t=Mail </a><br>
</blockquote>
<br>
jc wrote:
<blockquote cite="mid:f3p8qm$nf$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,

I would like to create an EObject with an attribute called allMyObjects.

This attribute would be used to store any type of objects i.e.: EObject,
EList, String, Integer, Long, Date etc.

I thought of modeling this with a "to many" relation of EJavaObject but I've
found out that EJavaObject are not serialized by Resources.

What are the options when it comes to modeling a list of any type and have
this list saved and retrieved from at Resource?

Thanks
Jean-Claude





</pre>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>

--------------010309020409010408050901--
Previous Topic:warning: "has the same namespace URI"
Next Topic:Merge one runtime datagraph with another to apply changes?
Goto Forum:
  


Current Time: Sun Oct 26 04:27:42 EDT 2025

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

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

Back to the top