Skip to main content



      Home
Home » Modeling » TMF (Xtext) » String Annotation Value that is a constant attribute(Generate String Annotation Value that is a constant attribute defined on a generated interface)
String Annotation Value that is a constant attribute [message #1758270] Sun, 26 March 2017 09:34 Go to next message
Eclipse UserFriend
Hello,

I am generating the following interface and class:

interface A {

public static final String SERVICE_NAME = "xxx.Service.A"
}

@Component(name = A.SERVICE_NAME)
class AImpl implements A {

}

In the annotation I can easily define:

@Component(name = "xxx.Service.A") by using a construct like this:

explicitValues += TypesFactory.eINSTANCE.createJvmStringAnnotationValue => [

operation = anno.members.filter(JvmOperation).findFirst[simpleName == 'name']
values += 'xxx.Service.A'
]

I am however struggling to figure out a way to generate the one above where the name is referencing a field like this:

@Component(name = A.SERVICE_NAME)

I would appreciate any help/pointers on how I can get this done.

Thank you!
Oleg



Re: String Annotation Value that is a constant attribute [message #1758271 is a reply to message #1758270] Sun, 26 March 2017 09:44 Go to previous messageGo to next message
Eclipse UserFriend
this sounds like https://bugs.eclipse.org/bugs/show_bug.cgi?id=460798 which states this as not possible yet
Re: String Annotation Value that is a constant attribute [message #1758272 is a reply to message #1758271] Sun, 26 March 2017 12:35 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for the info.
Re: String Annotation Value that is a constant attribute [message #1758319 is a reply to message #1758272] Mon, 27 March 2017 12:25 Go to previous messageGo to next message
Eclipse UserFriend
Out of curiosity, are there any plans to add this support in the future? Is there a way to help/contribute?

Thank you,
Oleg
Re: String Annotation Value that is a constant attribute [message #1758322 is a reply to message #1758319] Mon, 27 March 2017 12:38 Go to previous message
Eclipse UserFriend
of course contributions are welcome, unfortuneately i cannot give you any directions and the guys who can are currenlty way too busy.
Previous Topic:Using code generation with Xbase, instead of JVMinferrer
Next Topic:Missing auto complete and validation in 2.11
Goto Forum:
  


Current Time: Sun Aug 31 00:38:49 EDT 2025

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

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

Back to the top