Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » static definitions in interface(is there any way to preserve static fields from annotated interface)
static definitions in interface [message #530199] Wed, 28 April 2010 19:19 Go to next message
Alexey  is currently offline Alexey Friend
Messages: 36
Registered: March 2010
Member
Suppose the code I want to generate should contain something like

static private String MY_NOTE = "keep it save"; (or even with final)

Is there any way to put that static def. in annotated java, or/and in eCore module, and after code generated to have it in interface? I know we can live without it. Just looking how to keep more in model, less in manually enhanced code.

Another question: when generate java code, you can adjust the "Base Package" field in genmodel package ok. But EMF still attaches the eCore package name after that when generates package names for your code artifacts. You can't change eCore package names in genmodel . When you go from annotated java, it means you need to update ecore model and then to re-generate genmodel. Is there any way to disable this "sticking" the eCore' package name in code generation?

Thanks
Alexey
Re: static definitions in interface [message #530308 is a reply to message #530199] Thu, 29 April 2010 10:00 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Alexey,

Comments below.

Alexey wrote:
> Suppose the code I want to generate should contain something like
>
> static private String MY_NOTE = "keep it save"; (or even with final)
>
> Is there any way to put that static def. in annotated java, or/and in
> eCore module, and after code generated to have it in interface? I know
> we can live without it. Just looking how to keep more in model, less
> in manually enhanced code.
No, Ecore isn't Java so will never support the full expressive power of
Java.
>
> Another question: when generate java code, you can adjust the "Base
> Package" field in genmodel package ok. But EMF still attaches the
> eCore package name after that when generates package names for your
> code artifacts. You can't change eCore package names in genmodel .
> When you go from annotated java, it means you need to update ecore
> model and then to re-generate genmodel. Is there any way to disable
> this "sticking" the eCore' package name in code generation?
No. I'm confused though. If you use annotated Java, you end up with
exactly the package you've specified in the annotated Java. If you
wanted to change it, you could change the Ecore model and then
regenerate to a different package...
>
> Thanks
> Alexey
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Why EMF clears external projects from build path
Next Topic:[CDO] Teneo Hibernate lazy fetching
Goto Forum:
  


Current Time: Fri Apr 19 03:58:05 GMT 2024

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

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

Back to the top