java.lang.Object
iu.type.AnnotationBridge
Bridge utility for adapting annotations defined in one module to a different
module with an isolated and potentially different version of the same
annotation library.
-
Method Summary
Modifier and TypeMethodDescription(package private) static <A extends Annotation>
AgetAnnotation
(Class<A> annotationType, AnnotatedElement annotatedElement) Gets an equivalent annotation if present on a potentially remote target.(package private) static Iterable
<? extends Annotation> getAnnotations
(AnnotatedElement annotatedElement) Gets all annotations for an potentially remote element.(package private) static Class
<?> getPotentiallyRemoteClass
(AnnotatedElement annotatedElement, Class<?> localClass) Gets an equivalent, potentially remote, class.(package private) static boolean
isAnnotationPresent
(Class<? extends Annotation> annotationType, AnnotatedElement annotatedElement) Determines if an equivalent annotation is present on a potentially remote target element.
-
Method Details
-
getPotentiallyRemoteClass
static Class<?> getPotentiallyRemoteClass(AnnotatedElement annotatedElement, Class<?> localClass) throws ClassNotFoundException Gets an equivalent, potentially remote, class.- Parameters:
annotatedElement
-AnnotatedElement
context targetlocalClass
- local class- Returns:
- remote class; may be same as local class
- Throws:
ClassNotFoundException
- if an equivalent remote type cannot be found
-
isAnnotationPresent
static boolean isAnnotationPresent(Class<? extends Annotation> annotationType, AnnotatedElement annotatedElement) Determines if an equivalent annotation is present on a potentially remote target element.- Parameters:
annotationType
- local annotation typeannotatedElement
-AnnotatedElement
context target- Returns:
- true if an equivalent annotation is present on the potentially remote target element; else false
-
getAnnotation
static <A extends Annotation> A getAnnotation(Class<A> annotationType, AnnotatedElement annotatedElement) Gets an equivalent annotation if present on a potentially remote target.- Type Parameters:
A
- local annotation type- Parameters:
annotationType
- local annotation typeannotatedElement
-AnnotatedElement
context target- Returns:
- equivalent annotation; else false
-
getAnnotations
Gets all annotations for an potentially remote element.- Parameters:
annotatedElement
-AnnotatedElement
context target- Returns:
- local equivalents to all adaptable remote annotations
-