Is there Commons AnnotationUtils like library? (Java)

醉酒当歌 提交于 2019-12-08 22:08:29

问题


I can't find a general utilities (static methods) library for querying for annotations other than either using the annotations api directly and writing my own or using Springs:

  • Springs Annotation Utils

Normally I would not mind using Springs but its a rather big dependency just for dealing with annotations. Maybe Commons Lang will have AnnotationUtils some day.

What are people using to query for Annotations?


回答1:


With version 2.5.6 of Spring, it was possible to use spring.jar (2.8 MB) as dependency. With version 3, that's not possible. Instead you have to add dependency to the core, beans, context, asm and expression module as a minimum to start the container.

Since you only the AnnotationUtils class, it's sufficient with the core module. You can find the Ivy and Maven element together with a download link here:

http://www.springsource.com/repository/app/search?query=AnnotationUtils

Its size is 350 KB versus Apache Commons Lang 2.4 on 258 KB.



来源:https://stackoverflow.com/questions/3000480/is-there-commons-annotationutils-like-library-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!