有没有像库一样的 Commons AnnotationUtils?(爪哇) [英] Is there Commons AnnotationUtils like library? (Java)

查看:19
本文介绍了有没有像库一样的 Commons AnnotationUtils?(爪哇)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了直接使用注释 api 并编写自己的或使用 Springs 之外,我找不到用于查询注释的通用实用程序(静态方法)库:

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,但它是一个相当大的依赖项,仅用于处理注释.也许 Commons Lang 有一天会拥有 AnnotationUtils.

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?

推荐答案

在 Spring 2.5.6 版中,可以使用 spring.jar (2.8 MB) 作为依赖项.对于版本 3,这是不可能的.相反,您必须至少向核心、bean、上下文、asm 和表达式模块添加依赖项才能启动容器.

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.

因为您只有 AnnotationUtils 类,所以使用核心模块就足够了.您可以在此处找到 Ivy 和 Maven 元素以及下载链接:

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

它的大小为 350 KB,而 Apache Commons Lang 2.4 为 258 KB.

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

这篇关于有没有像库一样的 Commons AnnotationUtils?(爪哇)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆