-
-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum Value as annotation type value not possible #750
Comments
in method In this case, a workaround is to transform the last element and manually create a CtFieldRead that corresponds to ByteOrder.LittleEndian. It's cumbersome, I agree. We have to improve |
Thank you, I tried a CtVariableRead, but that did not work for me. It would be good to have an overview, which elements in the Java language actually correspond to which Ct element wrappers, I think. |
Thank you for the quick fix! |
I am trying to annotate a field via the annotation factory, and would like to set the value of an annotation element to an enum value, e.g.
annoFactory.annotate(field, BoundNumber.class, "byteOrder", ByteOrder.LittleEndian);
where ByteOrder.LittleEndian is the enum value. Running the annoation processor, I get the error message
In CtAnnotationImpl.java, starting at line 88, the annotation values passed in are converted to CtExpression values, but I can not find any clause that would match en enum value. What is the proper way to convert an enum value as shown above to the according CtExpression instance?
The text was updated successfully, but these errors were encountered: