I want to use annotation in compiled form.
To pass the value () to the annotation, I want to use a string representation of the enumeration.
Is there a way to use @A with a value from enum E?
public class T { public enum E { a,b; }
Update
I need a String type in @A.
What I can do is
@A("" + 1) void foo() { }
But here, the compiler claims that the value of the attribute must be constant. Is'nt Ea Permanent?
@A("" + Ea) void foo() { }
java annotations
PeterMmm
source share