Skip to content

How to get annotations of an annotation? #616

Closed Answered by JonasKlauke
evilpan asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah this works.
For example if au is your AnnotationUsage contained in the resulting list of cls.getAnnotations(Optional.of(view)); then you get the AnnotationType by calling au.getAnnotation(). The AnnotationType can be used to get the SootClass by view.getClass(au.getAnnotation()) and on this you can call getAnnotations() again view.getClass(au.getAnnotation()).ifPresent(javaSootClass -> javaSootClass.getAnnotations(Optional.of(view)));

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@JonasKlauke
Comment options

Answer selected by JonasKlauke
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants