Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Prevent generation of DocumentRoot Java class(Generating both XSD and Java classes and don't need the DocumentRoot class)
Prevent generation of DocumentRoot Java class [message #1228136] Mon, 06 January 2014 13:52 Go to next message
Jorge Soria is currently offline Jorge SoriaFriend
Messages: 4
Registered: February 2013
Junior Member
I have defined an UML model and both generate Java classes and XSDs. In order to have a <xsd:element> as the root in the XSDs, I have defined a DocumentRoot class for each XSD I generate. I followed the documentation in "EMF, Eclipse Modeling Framework Second Edition". That works fine.

But when I generate the Java classes, a set of DocumentRoot classes follow with them; I don't need them. How can I prevent their generation?

About the environment: The model is being used as the canonical model in a high performance integration layer, so we decided to remove all EMF dependencies in the Java code, something I am managing by editing the *.javajet classes.

Thanks.
jorge
Re: Prevent generation of DocumentRoot Java class [message #1228160 is a reply to message #1228136] Mon, 06 January 2014 14:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Jorge,

Comments below.

On 06/01/2014 2:52 PM, Jorge Soria wrote:
> I have defined an UML model and both generate Java classes and XSDs.
> In order to have a <xsd:element> as the root in the XSDs, I have
> defined a DocumentRoot class for each XSD I generate. I followed the
> documentation in "EMF, Eclipse Modeling Framework Second Edition".
> That works fine.
> But when I generate the Java classes, a set of DocumentRoot classes
> follow with them; I don't need them. How can I prevent their generation?
You do need them if you want to serialize instances that conform to the
schema.
>
> About the environment: The model is being used as the canonical model
> in a high performance integration layer, so we decided to remove all
> EMF dependencies in the Java code, something I am managing by editing
> the *.javajet classes.
What are you doing about other things like the package and factory class
that are generated?
>
> Thanks.
> jorge


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Prevent generation of DocumentRoot Java class [message #1228173 is a reply to message #1228160] Mon, 06 January 2014 15:25 Go to previous messageGo to next message
Jorge Soria is currently offline Jorge SoriaFriend
Messages: 4
Registered: February 2013
Junior Member
Thanks for quick reply Ed, and happy new year.

On the serialization: The model's Java classes are used deep in the integration layer by specialized conversion tools while the XSDs are used in the interfaces: so I never serialize the java objects.

On the package and factory classes: I am evaluating to remove them with a maven ant-task right after generation.

Regards.
jorge
Re: Prevent generation of DocumentRoot Java class [message #1228184 is a reply to message #1228173] Mon, 06 January 2014 15:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Jorge,

I suppose then you can use such a task to delete other unwanted things
too...


On 06/01/2014 4:25 PM, Jorge Soria wrote:
> Thanks for quick reply Ed, and happy new year.
>
> On the serialization: The model's Java classes are used deep in the
> integration layer by specialized conversion tools while the XSDs are
> used in the interfaces: so I never serialize the java objects.
>
> On the package and factory classes: I am evaluating to remove them
> with a maven ant-task right after generation.
> Regards.
> jorge
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Prevent generation of DocumentRoot Java class [message #1228489 is a reply to message #1228184] Tue, 07 January 2014 10:38 Go to previous message
Jorge Soria is currently offline Jorge SoriaFriend
Messages: 4
Registered: February 2013
Junior Member
Yes, you are right, I can. Thanks anyway.
jorge
Previous Topic:Intermittent NoSuchElementException
Next Topic:Custom Property dialog
Goto Forum:
  


Current Time: Thu Apr 18 01:48:19 GMT 2024

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

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

Back to the top