Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » annotationRef with String attribute as a static filed(annotationRef with String attribute as a static filed)
annotationRef with String attribute as a static filed [message #1799075] Thu, 29 November 2018 14:20 Go to next message
Oleg Cohen is currently offline Oleg CohenFriend
Messages: 34
Registered: August 2016
Member
Greetings,

I am generating code for an annotation on a class.

This form works for me

@Component(name = "ServiceX")
public class ServiceXImpl implements ServiceX {
...
}

Instead of the "ServiceX" string I would like to use a public static final String field defined on the ServiceX inteface

public interface ServiceX {
public static final String SERVICE_NAME = "ServiceX";
}

and

@Component(name = ServiceX.SERVICE_NAME)
public class ServiceXImpl implements ServiceX {
...
}

Is there a way to create a Jvm annotation for the latter option?

Thank you!
Oleg
Re: annotationRef with String attribute as a static filed [message #1799085 is a reply to message #1799075] Thu, 29 November 2018 15:55 Go to previous message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 14666
Registered: July 2009
Senior Member
no this currently no possible. feel free to file a enhancement request at github.com/eclipse/xtext-extras

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Saving Multiple Xtext Resources with Cyclic Cross References
Next Topic:Force incremental build
Goto Forum:
  


Current Time: Fri Apr 26 16:30:06 GMT 2024

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

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

Back to the top