invoke "values" coming from getAllEnums #609
Unanswered
FranGomezVenegas
asked this question in
Q&A
Replies: 2 comments
-
See #608 (dup) |
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems my topic was posted twice! sorry |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm refactoring my code in the way to not have to add to my 'declared enums documentation' method the enums one by one any time my code requires one new enum.
The idea is to get them by reflection and it works fine by using getAllEnums therefore I can document all enum names.
My problem comes when I need to get all enum entries, what I'm trying to do is to call the enum 'values' method due to I need to document the enum names and its entries.
I tried by this way. method=getMine.getClass().getMethod(methName, paramTypes), but it raises one Exception.
Then found this alternative way, Field f = getMine.getClass().getDeclaredField("$VALUES"), but did not works, it seems to not be compatible with the ClassInfo object in some way.
Anybody tried to do something similar? How to apply reflection for both, get the enum names (this works for me) and its entries (this is where I'm stuck).
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions