XCore Annotation Support [message #1530522] |
Fri, 26 December 2014 18:44  |
Eclipse User |
|
|
|
Hi,
I will start with a question: is it possible to create/define my own Annotations model (like xcore lang) to define
annotations which can be used in an xcore file?
My idea is to somehow make it possible to specify JPA annotations directly in xcore.
I noticed that XCore has some way to declare an annotation. But I only see them in the form of:
annotation "http://namespace" as NameSpace
For Ecore and GenModel.
So it seems possible to define our own annotation. But how are these mapped to the EAnnotations? Do you have some more
examples? Also is it possible to define an annotation with number, boolean and string efeatures (and ereferences), so
more structured annotations?
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: XCore Annotation Support [message #1534860 is a reply to message #1530522] |
Mon, 29 December 2014 05:44  |
Eclipse User |
|
|
|
Martin,
Comments below.
On 27/12/2014 12:44 AM, Martin Taal wrote:
> Hi,
> I will start with a question: is it possible to create/define my own
> Annotations model (like xcore lang) to define annotations which can be
> used in an xcore file?
Yes. As you can see they're just declarations of a named namespace URI.
> My idea is to somehow make it possible to specify JPA annotations
> directly in xcore.
>
> I noticed that XCore has some way to declare an annotation. But I only
> see them in the form of:
> annotation "http://namespace" as NameSpace
Yes.
>
> For Ecore and GenModel.
Yes or for any namespace.
>
> So it seems possible to define our own annotation. But how are these
> mapped to the EAnnotations?
The namespace becomes the EAnnotation's source URI and they key/value
pairs become the details.
> Do you have some more examples?
It's pretty much trivial...
> Also is it possible to define an annotation with number, boolean and
> string efeatures (and ereferences), so more structured annotations?
No, just key-value pairs that mapping to the details of an EAnnotation.
|
|
|
Powered by
FUDForum. Page generated in 0.04514 seconds