Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » code samples
code samples [message #380514] Thu, 26 April 2007 02:31 Go to next message
adam berk is currently offline adam berkFriend
Messages: 2
Registered: July 2009
Junior Member
I am working in the RAD6 environment and attempting to learn EMF as a way
of doing some basic Java / XML binding tasks. Can someone tell me if EMF
supports the functions listed below and if so, where I might find both the
api documentation and some key code samples to get started. I am really
struggling to find code samples and documentation. I have been bouncing
all over following leads but to no avail. I've looked at xmlbeans and
Castor and found ample examples and clear documentation. Probably my fault
but nonetheless, I need some help.
Thanks.

I need to be able to do the following:
1. Unmarshal an xml document from either a file stream or a String, into
the java classes represented in the genmodel.
2. Call a validate method to make sure that the document is in fact well
formed and valid according to the schema.
3. Construct the java object representing a document then call a validate
method to ensure that the object would yield a valid document.
4. Unmarshal the object into a valid XML document.
Re: code samples [message #380519 is a reply to message #380514] Thu, 26 April 2007 03:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010609070402020303040509
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Adam,

This is more a question for the EMF newsgroup.

Links to various EMF documents are mostly on this page:

http://www.eclipse.org/modeling/emf/docs/

You'll likely find this article useful:

http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava

If you follow this tutorial

http://dev.eclipse.org/viewcvs/indextools.cgi/*checkout*/org .eclipse.emf/doc/org.eclipse.emf.doc/tutorials/xlibmod/xlibm od.html

and invoke "Generate Test Code" you'll generate a working example (e.g.,
LibraryExample.java) that shows how to create a document and serialize
it as well as how to load a document and validate it. You can follow
the same steps, but for your own schema.

We spend more time providing rich function than we do providing copious
documentation, but as a developer, I'm sure you can relate to that
dilemma. On the plus side, the second edition of the EMF book should be
ready to send to the publishers really soon...


adam berk wrote:
> I am working in the RAD6 environment and attempting to learn EMF as a
> way of doing some basic Java / XML binding tasks. Can someone tell me
> if EMF supports the functions listed below and if so, where I might
> find both the api documentation and some key code samples to get
> started. I am really struggling to find code samples and
> documentation. I have been bouncing all over following leads but to no
> avail. I've looked at xmlbeans and Castor and found ample examples
> and clear documentation. Probably my fault but nonetheless, I need
> some help.
> Thanks.
> I need to be able to do the following:
> 1. Unmarshal an xml document from either a file stream or a String,
> into the java classes represented in the genmodel.
> 2. Call a validate method to make sure that the document is in fact
> well formed and valid according to the schema.
> 3. Construct the java object representing a document then call a
> validate method to ensure that the object would yield a valid document.
> 4. Unmarshal the object into a valid XML document.
>
>


--------------010609070402020303040509
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">
Adam,<br>
<br>
This is more a question for the EMF newsgroup.
Re: code samples [message #592395 is a reply to message #380514] Thu, 26 April 2007 03:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010609070402020303040509
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Adam,

This is more a question for the EMF newsgroup.

Links to various EMF documents are mostly on this page:

http://www.eclipse.org/modeling/emf/docs/

You'll likely find this article useful:

http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava

If you follow this tutorial

http://dev.eclipse.org/viewcvs/indextools.cgi/*checkout*/org .eclipse.emf/doc/org.eclipse.emf.doc/tutorials/xlibmod/xlibm od.html

and invoke "Generate Test Code" you'll generate a working example (e.g.,
LibraryExample.java) that shows how to create a document and serialize
it as well as how to load a document and validate it. You can follow
the same steps, but for your own schema.

We spend more time providing rich function than we do providing copious
documentation, but as a developer, I'm sure you can relate to that
dilemma. On the plus side, the second edition of the EMF book should be
ready to send to the publishers really soon...


adam berk wrote:
> I am working in the RAD6 environment and attempting to learn EMF as a
> way of doing some basic Java / XML binding tasks. Can someone tell me
> if EMF supports the functions listed below and if so, where I might
> find both the api documentation and some key code samples to get
> started. I am really struggling to find code samples and
> documentation. I have been bouncing all over following leads but to no
> avail. I've looked at xmlbeans and Castor and found ample examples
> and clear documentation. Probably my fault but nonetheless, I need
> some help.
> Thanks.
> I need to be able to do the following:
> 1. Unmarshal an xml document from either a file stream or a String,
> into the java classes represented in the genmodel.
> 2. Call a validate method to make sure that the document is in fact
> well formed and valid according to the schema.
> 3. Construct the java object representing a document then call a
> validate method to ensure that the object would yield a valid document.
> 4. Unmarshal the object into a valid XML document.
>
>


--------------010609070402020303040509
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">
Adam,<br>
<br>
This is more a question for the EMF newsgroup.
Previous Topic:code samples
Next Topic:Class Resolving when editting XMI attribute with EJavaClass type
Goto Forum:
  


Current Time: Thu Dec 18 21:13:58 GMT 2014

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

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