Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XCore Annotation Support
XCore Annotation Support [message #1530522] Fri, 26 December 2014 23:44 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
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 10:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30141
Registered: July 2009
Senior Member
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.
Previous Topic:[CDO] Customizing Repository Cloning
Next Topic:EMap performance compared to HashMap?
Goto Forum:
  


Current Time: Sun May 26 21:06:31 GMT 2019

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

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

Back to the top