Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313494 - Add JAXB annotations model to Texo with JAXB annotator
Summary: Add JAXB annotations model to Texo with JAXB annotator
Status: CLOSED DUPLICATE of bug 453338
Alias: None
Product: EMFT
Classification: Modeling
Component: Texo (show other bugs)
Version: Future   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 05:40 EDT by Martin Taal CLA
Modified: 2015-01-18 11:31 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Taal CLA 2010-05-19 05:40:19 EDT
This feature request is to track addition of jaxb as an annotation model to Texo. This feature can be implemented in multiple ways:
1- add a jaxb annotation model and translating it to java annotations
2- generate jaxb annotations in the model based on the XML schema information present in the ecore model (or from a plain ecore model)

The second step takes probably more time.
Comment 1 Martin Taal CLA 2010-05-22 03:21:41 EDT
Short update:
- the jaxb annotation model has been done
- it is possible to manually define jaxb annotations
- the code to generate java annotations from these jaxb model annotations has been mostly done
- I started to write some code to generate jaxb annotations. This is in its initial phase.

I will continue to work on this from monday evening/tuesday as this is a holiday weekend here in The Netherlands.

gr. Martin
Comment 2 Martin Taal CLA 2010-06-15 16:51:21 EDT
I am getting into some trouble with supporting jaxb annotations because EMF handles global elements quite differently from jaxb. EMF creates a so-called DocumentRoot eclass which, as efeatures, has all the global elements. If a complexType is re-used across several global elements then this results in several efeatures refering to the same eclass. 

Jaxb on the other hand seems to use an ObjectFactory to handle this specific case. See here:
http://weblogs.java.net/blog/2006/03/03/why-does-jaxb-put-xmlrootelement-sometimes-not-always

So this won't be supported by Texo. I am wondering how big of a disadvantage this is? It seems quite blocking...

Another not-supported-by-emf things is the difference between xs:all and xs:sequence. This information is not stored in the ecore model, this because for EMF there is no difference between the two.

gr. Martin
Comment 3 Martin Taal CLA 2015-01-18 07:57:08 EST

*** This bug has been marked as a duplicate of bug 453338 ***
Comment 4 Mike Cooper CLA 2015-01-18 11:31:29 EST
It would be useful to try to address the general use case and filter out/warn about unsupported elements (e.g. cross referrals).  In my own XML encoder I ran into similar issues.  What I found was I generally only needed to use XML on some of my model classes and those where fairly straight-forward.