Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Where to find the available key list of EAnnotation's details
Where to find the available key list of EAnnotation's details [message #1248542] Mon, 17 February 2014 11:28 Go to next message
Xi Lin is currently offline Xi LinFriend
Messages: 21
Registered: January 2014
Junior Member
I've learned to add methods to generated EClasses through post processing as follow:

val operation = EcoreFactory::eINSTANCE.createEOperation
operation.name = name
operation.EType = type
operation.upperBound = upperBound      
val body = EcoreFactory::eINSTANCE.createEAnnotation
body.source = GenModelPackage::eNS_URI
val map = EcoreFactory::eINSTANCE.create(EcorePackage::eINSTANCE.getEStringToStringMapEntry()) as BasicEMap.Entry<String,String>
map.key = "body"
map.value = bodyString
body.details.add(map)
operation.EAnnotations += body     
c.EOperations += operation


And i'm trying to override the toString method of EClasses.

Is there any way to generated a @override annotation for this EAnnotation?
And as we've used the "body" key for EAnnotation map, where can i find all the available key list? I cannot find that through google.

Thanks.
Re: Where to find the available key list of EAnnotation's details [message #1248593 is a reply to message #1248542] Mon, 17 February 2014 12:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Comments below.

On 17/02/2014 12:28 PM, Xi Lin wrote:
> I've learned to add methods to generated EClasses through post
> processing as follow:
>
>
> val operation = EcoreFactory::eINSTANCE.createEOperation
> operation.name = name
> operation.EType = type
> operation.upperBound = upperBound val body =
> EcoreFactory::eINSTANCE.createEAnnotation
> body.source = GenModelPackage::eNS_URI
> val map =
> EcoreFactory::eINSTANCE.create(EcorePackage::eINSTANCE.getEStringToStringMapEntry())
> as BasicEMap.Entry<String,String>
> map.key = "body"
> map.value = bodyString
> body.details.add(map)
> operation.EAnnotations += body c.EOperations += operation
>
>
> And i'm trying to override the toString method of EClasses.
Be careful that your code doesn't cause proxy resolution...
>
> Is there any way to generated a @override annotation for this
> EAnnotation?
We probably should detect this case when generating the toString()
operation...
> And as we've used the "body" key for EAnnotation map, where can i find
> all the available key list? I cannot find that through google.
Sorry, there isn't an index of available annotations...
>
> Thanks.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Where to find the available key list of EAnnotation's details [message #1249248 is a reply to message #1248593] Tue, 18 February 2014 04:17 Go to previous message
Xi Lin is currently offline Xi LinFriend
Messages: 21
Registered: January 2014
Junior Member
Thanks for the reply.

> Be careful that your code doesn't cause proxy resolution...

Can you explain how to deal with the proxy resolution problem? I'm not quite understand about the proxy things.

> We probably should detect this case when generating the toString()
> operation...
> Sorry, there isn't an index of available annotations...

Got it.
Previous Topic:Indent Based DSL with Xtext
Next Topic: Ant Script to Create Xtext Project as Plugin
Goto Forum:
  


Current Time: Fri Apr 19 10:31:47 GMT 2024

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

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

Back to the top