宣布 JBoss Annotations 1.0.0.Alpha1

发布者:    |      

我很高兴宣布 JBoss Annotations 1.0.0.Alpha1 的可用性。

JBoss Annotations 是一个项目,允许您对项目进行注解扫描并创建这些注解的存储库。此外,该项目还将提供各种工具,有助于注解解析阶段以及与其他 JBoss 项目的集成。

为什么?

那么,我们为什么选择启动另一个注解扫描项目呢?主要原因是

  • 一个专门的注解扫描 API
  • 一个易于查询的存储库
  • 与 JBoss 项目集成,例如 JBoss Microcontainer

最后一个要点很重要,因为它将使我们能够在运行例如 JBoss 应用服务器 时提供一个统一的注解平台。该项目可以在 JBoss 环境之外使用,因为它的依赖项是 Javassist 库和 JAXB。

用法

该库的用法非常简单:)

// Create an annotation scanner with the default annotation scanning strategy
AnnotationScanner as = AnnotationScannerFactory.getDefault();

// URLs to .class and .jar files
URL[] urls = ...;

AnnotationReposity ar = as.scan(urls);

if (ar.hasAnnotation(MyAnnotation.class))
{
   List<Annotation> l = ar.getAnnotation(MyAnnotation.class);
   for (Annotation annotation : l)
   {
      MyAnnotation myAnnotation = (MyAnnotation)annotation.getAnnotation();
      AnnotationType type = annotation.getType();
      if (AnnotationType.CLASS == type)
      {
        ...
   }
}

您可以在分发中的 JavaDoc、用户指南和开发者指南中了解更多有关 API 的信息。

状态

由于这是该项目的第一个开发者快照,还有很多工作要做。因此,如果您想帮忙或将自己的想法融入项目中,请随时与我们联系:)

我们计划定期发布开发者快照 - 主要是当实现了一些新的用例时。所以请关注更新!

对于即将大显身手的人,我们向您致敬!

[JIRA] [下载] [ViewVC]


回到顶部