Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Generate Annotation with several parameters
Generate Annotation with several parameters [message #757690] Mon, 21 November 2011 04:21 Go to next message
Eclipse UserFriend
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 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

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

~Christian
Re: Generate Annotation with several parameters [message #757714 is a reply to message #757700] Mon, 21 November 2011 05:40 Go to previous message
Eclipse UserFriend
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: Thu Jul 10 00:40:29 EDT 2025

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

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

Back to the top