Java custom annotation and dynamic loading

前端 未结 1 743
抹茶落季
抹茶落季 2021-01-03 01:39

I\'m trying to develop ORM for database synchronisation and decided to give Java reflection a go. I have a library that defines Synchronised annotation like this

<         


        
相关标签:
1条回答
  • 2021-01-03 01:49

    Get just annotation that you are interested in:

    Annotation<Synchronised> annotation = entryClass.getAnnotation(Synchronised.class);
    

    Update:

    The problem is that DexFile.getClass() apparently returns a proxy. OP has found the anser and updated the question with a solution.

    0 讨论(0)
提交回复
热议问题