CDI annotations - customize generated code [message #1626999] |
Sat, 21 February 2015 08:48 |
Anton Hughes Messages: 66 Registered: January 2013 |
Member |
|
|
Hi
I have searched this forum, many times, and googled - trying to find how to add annotations.
I have seen various posts saying how easy it is to customize the generated code using annotations - but cannot find any information on how to add annotations - as in, in the generated java.
For those of use who want to annotate our classes - say, for use in CDI, with scopes, qualifiers etc, how can we do this?
Thanks
[Updated on: Sat, 21 February 2015 10:21] Report message to a moderator
|
|
|
Re: CDI annotations - customize generated code [message #1627956 is a reply to message #1626999] |
Sat, 21 February 2015 21:50 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Anton,
Depending on which editor you use the process for creating annotations
is can be different. I assume you're referring to EAnnotations on your
Ecore model, right? In the Sample Ecore Editor, you can create an
EAnnotation from the context menu and details for that annotation also
via the context menu.
On 21.02.2015 09:48, Anton Hughes wrote:
> Hi
>
> I have searched this forum, many times, and googled - trying to find how
> to add annotations.
>
> I have seen various posts saying how easy it is to customize the
> generated code using annotations - but cannot find any information on
> adding annotations.
> For those of use who want to annotate our classes - say, for use in CDI,
> with scopes, qualifiers etc, how can we do this?
>
> Thanks
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: CDI annotations - customize generated code [message #1632069 is a reply to message #1628470] |
Tue, 24 February 2015 04:27 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Anton,
No, EAnnotations don't directly generate Java annotations. One would
need to specialize the templates for that. I'm not sure if there are
include points for annotations and I don't have a full development
environment available until next week to answer in more detail.
On 22.02.2015 05:48, Anton Hughes wrote:
> Thanks Ed
>
> So, it is possible to add annotations to classes and methods?
>
> For example
>
>
> @MyCustomAnnotation
> MyClass {
>
> @MyMethodAnnotation
> public void myMethod(){
> }
>
> }
>
>
> Can you confirm it is possible to do this using EAnnotations?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03098 seconds