Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:34 Go to next message
Oleg Cohen is currently offline Oleg CohenFriend
Messages: 36
Registered: August 2016
Member
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 13:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
this sounds like https://bugs.eclipse.org/bugs/show_bug.cgi?id=460798 which states this as not possible yet

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: String Annotation Value that is a constant attribute [message #1758272 is a reply to message #1758271] Sun, 26 March 2017 16:35 Go to previous messageGo to next message
Oleg Cohen is currently offline Oleg CohenFriend
Messages: 36
Registered: August 2016
Member
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 16:25 Go to previous messageGo to next message
Oleg Cohen is currently offline Oleg CohenFriend
Messages: 36
Registered: August 2016
Member
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 16:38 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
of course contributions are welcome, unfortuneately i cannot give you any directions and the guys who can are currenlty way too busy.

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Previous Topic:Using code generation with Xbase, instead of JVMinferrer
Next Topic:Missing auto complete and validation in 2.11
Goto Forum:
  


Current Time: Sat Dec 07 03:37:51 GMT 2024

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

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

Back to the top