Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generate Annotation with several parameters
Generate Annotation with several parameters [message #757690] Mon, 21 November 2011 09:21 Go to next message
rjarana Missing name is currently offline rjarana Missing nameFriend
Messages: 12
Registered: November 2011
Junior Member
Hi!

I'm trying to generate an Annotation in JVM infer. I see you can create an Annotation with "toAnnotation" extention, and add values using TypesFactory -> createJvmStringAnnotationValue or createJvmBooleanAnnotationValue, setting in this objects the values. But I don't know how to set the name of the parameter, so the generated code is:

@MyAnnon("param1", true)

When I wan't to generate

@MyAnnon(name="param1", required=true)

How can I do this?

Thanks!
Re: Generate Annotation with several parameters [message #757700 is a reply to message #757690] Mon, 21 November 2011 09:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13416
Registered: July 2009
Senior Member
Hi,

a JvmAnnotationValue has a ValueName, what about setting this one ?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generate Annotation with several parameters [message #757714 is a reply to message #757700] Mon, 21 November 2011 10:40 Go to previous message
rjarana Missing name is currently offline rjarana Missing nameFriend
Messages: 12
Registered: November 2011
Junior Member
JvmAnnotationValue only has a getter for ValueName. The only setter is "setOperation". I try to create a JvmOperation, but don't know exactly how
Previous Topic:warning: "using multiple alternatives: 1, 2 ..." in syntax for constant values
Next Topic:Problem with Terminal rule INT in generator
Goto Forum:
  


Current Time: Wed Apr 01 06:15:38 GMT 2020

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

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

Back to the top