SeamFramework.orgCommunity Documentation

Chapter 5. Annotation Literals

Solder provides a complete set of AnnotationLiteral classes corresponding to the annotation types defined in the CDI (JSR-299) and Injection (JSR-330) specifications. These literals are located in the org.jboss.solder.literal package.

For any annotation that does not define an attribute, its corresponding AnnotationLiteral contains a static INSTANCE member. You should use this static member whenever you need a reference to an annotation instance rather than creating a new instance explicitly.

new AnnotatedTypeBuilder<X>().readFromType(type).addToClass(NamedLiteral.INSTANCE);

Literals are provided for the following annotations from Context and Dependency Injection (including annotations from Dependency Injection for Java):

Literals are also provided for the following annotations from Solder:

For more information about these annotations, consult the corresponding API documentation.