java.lang.Object
org.omnifaces.utils.annotation.Annotations
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
AcreateAnnotationInstance
(Class<A> type) Create an instance of the specified annotation type with default attributes.static <A extends Annotation>
AcreateAnnotationInstance
(Class<A> type, Map<String, Object> attributes) Create an instance of the specified annotation type with given attributes.static <A extends Annotation>
A[]createAnnotationInstances
(Class<A>... types) Create an array of instances of the specified annotation types with default attributes.
-
Method Details
-
createAnnotationInstance
Create an instance of the specified annotation type with default attributes.- Type Parameters:
A
- The generic annotation type.- Parameters:
type
- The annotation type.- Returns:
- An annotation instance of the specified annotation type with default attributes.
-
createAnnotationInstances
Create an array of instances of the specified annotation types with default attributes. Useful for varargs calls such asCDI.current().select(type, createAnnotationInstances(Qualifier1.class, Qualifier2.class))
.- Type Parameters:
A
- The generic annotation type.- Parameters:
types
- The annotation types.- Returns:
- An array of instances of the specified annotation types with default attributes.
-
createAnnotationInstance
public static <A extends Annotation> A createAnnotationInstance(Class<A> type, Map<String, Object> attributes) Create an instance of the specified annotation type with given attributes.- Type Parameters:
A
- The generic annotation type.- Parameters:
type
- The annotation type.attributes
- The annotation attributes. May be a partial attribute map or even an empty map.- Returns:
- An annotation instance of the specified annotation type with given attributes.
-