2 Replies Latest reply on Mar 17, 2009 12:34 PM by nimo stephan

    Observer with Enum possible?

    nimo stephan Master

      This works:



      public class MyClass{
      
      public enum MyEnum{hello;}
      
      public static final String hello ="hello";
      
      @Observer(MyClass.hello)
      public void do()
      {
              ..
      }



      but this not:



      public class MyClass{
      
      public enum MyEnum{hello;}
      
      @Observer(MyClass.MyEnum.hello.name())
      public void do()
      {
              ..
      }
      }
      
      



      The error-message:




      The value for annotation attribute Observer.value must be a constant expression

      Why I cannot use enums in Observers? Enums are static strings, too.