Well-known JSR-269 ("Pluging Annotation Processing API") other than JPA 2.0?

JSR 269 - "Pluging Annotation Processing API" - released in 2006. Since then, the only known use of this API has been the generation of the JPA 2.0 metamodel ( JSR 317 , 2009).

What other standardized or at least well-known frameworks use this API?

+8
java annotations
source share
7 answers

The Lombok project is "well known," I suppose. Although this does not seem to be a pure implementation of JSR-269, see this thread .

+5
source share

Dagger , in their own words, is a fast dependency injector for Android and Java. The dagger includes an annotation handler that checks modules and injections. This processor is strict and will cause a compiler error if any bindings are incorrect or incomplete.

+5
source share

GWT 2.4 introduced the RequestFactory and provided the JSR-269 Annotation Processor to test projects that use RequestFactory , see this page .

+3
source share

Blaze CBAV (independent evaluation of constraint-based annotations) is still under development, but is already capable of some fake compile-time checking. Basically, you can use this library to add meta information to your annotations to generate compiler errors based on your own conditions.

There are several useful predefined default constraints, but you can also define your own by implementing a validator and linking it using the constraint annotation to your own constraint. The implementation of the validators must be present in compiled form inside your classpath if you want to use your own constraint, so you might want to pack it separately. Try and explore the possibilities;)

For example, you can verify that a given annotation value occurs only once within a class:

 public @interface MyAnnotation{ @UniqueValueConstraint(scope=ConstraintScope.CLASS, errorMessage="This value must be unique within class level!") String value(); } public class MyClass{ @MyAnnotation("test") void test1(){} @MyAnnotation("test") void test2(){} // Compiler error with your message ;) } 

You can find the project on Github: https://github.com/Blazebit/blaze-cbav

+1
source share

The HexaBinding library uses JSR 269 to automatically create subclasses of POJOs that integrate with the binding system to free the developer from writing too much boiler table code.

You can find it here: https://github.com/ltearno/hexa.tools/blob/master/hexa.binding/README.md

And there is also an Immutables library that uses annotation processing to generate immutable object objects.

+1
source share

MapStruct is a JSR 269-based code generator for bean to bean mappings.

+1
source share

The Google Auto project uses JSR-269 to generate immutable value types, among other things. They also provide a library that makes it easy to create custom annotation processors.

0
source share

All Articles