I’m using ByteBuddy Agent to intercept a method and extract an annotation to extract strings. For example @Tag("string1")
. I was thinking of using a LOCAL_VARIABLE annotation to extract the value of a String variable i.e @Tag String s1 = "string1"
but Java doesn’t support the use of reflection to get annotations on local variables.
Is there a way to intercept a method and parse annotations to obtain strings defined in the instrumented method (either as annotation values or something else)?
Tried creating a LOCAL_VARIABLE annotation on a String variable and using java reflection to get the value of this variable.
Umar Yousafzai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.