CDI annotations - customize generated code [message #1626999] |
Sat, 21 February 2015 03:48  |
Eclipse User |
|
|
|
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 05:21] by Moderator
|
|
|
Re: CDI annotations - customize generated code [message #1627956 is a reply to message #1626999] |
Sat, 21 February 2015 16:50   |
Eclipse User |
|
|
|
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
|
|
|
|
Re: CDI annotations - customize generated code [message #1632069 is a reply to message #1628470] |
Mon, 23 February 2015 23:27  |
Eclipse User |
|
|
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.04356 seconds