title: How to pass string variable to an annotated class where the String variable is present in a properties file
body: <p>How do I pass string variable to an annotated class, where the String variable is present in a properties file?</p>
  
  <p>I'm seeing the error message: <strong>The value for annotation attribute Example.localID must be a constant</strong> </p>
  
  <p>For Example consider below annoated interface </p>
  
  <pre><code>@Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.TYPE)
  public @interface Example {
  
    String localID() default "";
  }
  </code></pre>
  
  <p>I have created a class 'ExampleService' which is annotated with 'Example' interface as shown below</p>
  
  <p>I like to provides values for localID as  'localID=Messages.TITLE' as shown below.</p>
  
  <p>Currently this not possible to provides values like this because of compilation error, is there any way to solve this issue or alternative(I donot want to make final because values get changed depending on local) ? </p>
  
  <p>'Messages.TITLE' values comes from property file.</p>
  
  <pre><code>@Example(localID=Messages.TITLE)
  public class ExampleService {
  }
  </code></pre>
  
  <p><strong>class:Messages</strong> </p>
  
  <pre><code>public class Messages extends NLS {
  
      public static String        TITLE;
      private static final String BUNDLE_NAME = "xyz"; //$NON-NLS-1$
  
      static {
  
          NLS.initializeMessages(BUNDLE_NAME, Messages.class);
      }
  private Messages() {
  }
  </code></pre>