views:

130

answers:

1

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:

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?

+2  A: 

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.

Espen
This is infact what I did do. The only problem I had is getting Ivy to know that spring.jar includes spring-core.jar for projects that include my annotation project that already use spring.
Adam Gent