Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there Commons AnnotationUtils like library? (Java)

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?

like image 499
Adam Gent Avatar asked Jun 08 '10 19:06

Adam Gent


1 Answers

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.

like image 94
Espen Avatar answered Oct 06 '22 17:10

Espen