public final class AnnotationHelper
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
AnnotationHelper()
AnnotationHelper is utility class and will be never instantiated.
|
Modifier and Type | Method and Description |
---|---|
static <A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.reflect.AnnotatedElement aElement,
Reads annotation from specified element or optionally from owner elements.
|
protected static <A extends java.lang.annotation.Annotation> |
getAnnotation0(java.lang.Class<?> aService,
Reads annotation from given service interface or implementation class.
|
protected static <A extends java.lang.annotation.Annotation> |
getAnnotation0(java.lang.reflect.Field aField,
Reads annotation from given field.
|
protected static <A extends java.lang.annotation.Annotation> |
getAnnotation0(java.lang.reflect.Method aMethod,
Reads annotation from given method.
|
protected static <A extends java.lang.annotation.Annotation> |
getAnnotation0(java.lang.Package aPackage,
Reads annotation from given package.
|
static <T> T |
getAnnotationAttributeValue(java.lang.annotation.Annotation annot, |
private static java.lang.reflect.Method |
getInterfaceMethod(java.lang.Class<?> aClass,
Finds specified method on some interface of given Class.
|
private static java.lang.Class<?> |
getOwnerClass(java.lang.Object aOwner)
Returns class of given owner object.
|
private static java.lang.Class<?> |
getServiceInterface(java.lang.Class<?> aServiceClass)
Returns interface of class.
|
private static boolean |
hasElementType(java.lang.Class<? extends java.lang.annotation.Annotation> aAnnotation,
Check if annotation has declared given element type.
|
A
- Annotation type.aElement
- Element (Method, Field, Class, Package) where to look for
annotationaOwner
- Owner (Service instance or class) of annotated element, used
for element type of Method or Field, may be nullaAnnotation
- Class of annotation we are looking foraTraverse
- FALSE to read annotation only from given element, TRUE
when traverse through next annotated elements.A
- Annotation type.aMethod
- Method where to look for annotationaOwner
- Owner (Service instance or class) of method, may be nullaAnnotation
- Class of annotation we are looking foraTraverse
- FALSE to read annotation only from given method, TRUE when
traverse through next annotated elements.A
- Annotation type.aField
- Field where to look for annotationaOwner
- Owner (Service instance or class) of field, may be nullaAnnotation
- Class of annotation we are looking foraTraverse
- FALSE to read annotation only from given field, TRUE when
traverse through next annotated elements.A
- Annotation type.aService
- Service class where to look for annotationaOwner
- This attribute is ignoredaAnnotation
- Class of annotation we are looking foraTraverse
- FALSE to read annotation only from given service class,
TRUE when traverse through next annotated elements.A
- Annotation type.aPackage
- Package where to look for annotationaOwner
- This attribute is ignoredaAnnotation
- Class of annotation we are looking foraTraverse
- FALSE to read annotation only from given package, TRUE
when traverse through parent packages.aOwner
- Owner object of annotated elementaAnnotation
- Annotation to be checkedaType
- Expected element typeaClass
- Class on which interface to look for methodaMethod
- Method to be foundaServiceClass
- Class which interface to return