public final class AnnotationUtil extends Object
Annotation operations.| Modifier and Type | Field and Description |
|---|---|
static Annotation[] |
EMPTY_ANNOTATION_ARRAY |
static Object[] |
EMPTY_OBJECT_ARRAY |
| Modifier and Type | Method and Description |
|---|---|
static <X,T extends Annotation> |
getAnnotatedMethodFirstParameterAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod,
Class<T> clazz) |
static <X> Type |
getAnnotatedMethodFirstParameterWithAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod,
Class<? extends Annotation> clazz) |
static <T extends Annotation> |
getAnnotation(Annotation[] anns,
Class<T> annotation)
get the annotation of the given type from the array.
|
static <T extends Annotation> |
getAnnotation(Set<Annotation> annotations,
Class<T> annotationClass)
Search in the given Set of Annotations for the one with the given AnnotationClass.
|
static Annotation[] |
getAnnotationsFromSet(Set<Annotation> set) |
static Annotation[] |
getMetaAnnotations(Annotation[] anns,
Class<? extends Annotation> metaAnnotation)
Returns a subset of annotations that are annotated with the specified meta-annotation
|
static <T extends Annotation> |
getMethodFirstParameterAnnotation(Method method,
Class<T> clazz)
Gets the method first found parameter annotation with given type.
|
static Type |
getMethodFirstParameterWithAnnotation(Method method,
Class<? extends Annotation> clazz)
Gets the method first found parameter type that is annotated with the
given annotation.
|
static Method[] |
getMethodsWithParameterAnnotation(Class<?> clazz,
Class<? extends Annotation> annotation)
Gets array of methods that has parameter with given annotation type.
|
static Type |
getTypeOfParameterWithGivenAnnotation(Method method,
Class<? extends Annotation> clazz)
Get the Type of the method parameter which has the given annotation
|
static <X> boolean |
hasAnnotatedMethodMultipleParameterAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod,
Class<? extends Annotation> clazz) |
static <X> boolean |
hasAnnotatedMethodParameterAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod,
Class<? extends Annotation> clazz) |
static boolean |
hasAnnotation(Annotation[] anns,
Class<? extends Annotation> annotation) |
static boolean |
hasAnyQualifier(javax.enterprise.inject.spi.Bean<?> bean)
Returns true if any binding exist
|
static boolean |
hasClassAnnotation(Class<?> clazz,
Class<? extends Annotation> annotation)
Check whether or not class contains the given annotation.
|
static boolean |
hasMetaAnnotation(Annotation[] anns,
Class<? extends Annotation> metaAnnotation) |
static boolean |
hasMethodAnnotation(Method method,
Class<? extends Annotation> clazz)
Check given annotation exist on the method.
|
static boolean |
hasMethodMultipleParameterAnnotation(Method method,
Class<? extends Annotation> clazz)
Check given annotation exist in the multiple parameter of the given
method.
|
static boolean |
hasMethodParameterAnnotation(Method method,
Class<? extends Annotation> clazz)
Check given annotation exist in the any parameter of the given method.
|
static Annotation |
hasOwbInjectableResource(Annotation[] annotations) |
static boolean |
isQualifierEqual(Annotation qualifier1,
Annotation qualifier2)
Checks if the given qualifiers are equal.
|
public static final Annotation[] EMPTY_ANNOTATION_ARRAY
public static final Object[] EMPTY_OBJECT_ARRAY
public static boolean hasMethodAnnotation(Method method, Class<? extends Annotation> clazz)
method - methodclazz - annotation classpublic static boolean hasMethodParameterAnnotation(Method method, Class<? extends Annotation> clazz)
method - methodclazz - checking annotationpublic static <X> boolean hasAnnotatedMethodParameterAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod,
Class<? extends Annotation> clazz)
public static boolean hasMethodMultipleParameterAnnotation(Method method, Class<? extends Annotation> clazz)
method - methodclazz - checking annotationpublic static <X> boolean hasAnnotatedMethodMultipleParameterAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod,
Class<? extends Annotation> clazz)
public static Type getMethodFirstParameterWithAnnotation(Method method, Class<? extends Annotation> clazz)
method - methodclazz - checking annotationpublic static <X> Type getAnnotatedMethodFirstParameterWithAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod, Class<? extends Annotation> clazz)
public static Type getTypeOfParameterWithGivenAnnotation(Method method, Class<? extends Annotation> clazz)
method - which need to be scannedclazz - the annotation to scan the method parameters fornull if not found.public static <T extends Annotation> T getMethodFirstParameterAnnotation(Method method, Class<T> clazz)
method - methodclazz - checking annotationpublic static <X,T extends Annotation> T getAnnotatedMethodFirstParameterAnnotation(javax.enterprise.inject.spi.AnnotatedMethod<X> annotatedMethod, Class<T> clazz)
public static boolean isQualifierEqual(Annotation qualifier1, Annotation qualifier2)
qualifier1 - qualifier2 - public static Method[] getMethodsWithParameterAnnotation(Class<?> clazz, Class<? extends Annotation> annotation)
clazz - class for checkannotation - for checkpublic static boolean hasClassAnnotation(Class<?> clazz, Class<? extends Annotation> annotation)
clazz - class instanceannotation - annotation classpublic static boolean hasMetaAnnotation(Annotation[] anns, Class<? extends Annotation> metaAnnotation)
public static boolean hasAnnotation(Annotation[] anns, Class<? extends Annotation> annotation)
public static <T extends Annotation> T getAnnotation(Annotation[] anns, Class<T> annotation)
anns - annotation - null if no such found.public static Annotation[] getMetaAnnotations(Annotation[] anns, Class<? extends Annotation> metaAnnotation)
anns - metaAnnotation - public static boolean hasAnyQualifier(javax.enterprise.inject.spi.Bean<?> bean)
bean - beanpublic static <T extends Annotation> T getAnnotation(Set<Annotation> annotations, Class<T> annotationClass)
annotations - to scanannotationClass - to search fornull if not found.public static Annotation hasOwbInjectableResource(Annotation[] annotations)
public static Annotation[] getAnnotationsFromSet(Set<Annotation> set)
Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.