Package org.omnifaces.utils.annotation
Class Annotations
- java.lang.Object
-
- org.omnifaces.utils.annotation.Annotations
-
public final class Annotations extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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 Detail
-
createAnnotationInstance
public static <A extends Annotation> A createAnnotationInstance(Class<A> type)
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
@SafeVarargs public static <A extends Annotation> A[] createAnnotationInstances(Class<A>... types)
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.
-
-