Package iu.type

Class AnnotationBridge

java.lang.Object
iu.type.AnnotationBridge

final class AnnotationBridge extends Object
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 Details

    • getPotentiallyRemoteClass

      static Class<?> getPotentiallyRemoteClass(AnnotatedElement annotatedElement, Class<?> localClass) throws ClassNotFoundException
      Gets an equivalent, potentially remote, class.
      Parameters:
      annotatedElement - AnnotatedElement context target
      localClass - 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 type
      annotatedElement - 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 type
      annotatedElement - AnnotatedElement context target
      Returns:
      equivalent annotation; else false
    • getAnnotations

      static Iterable<? extends Annotation> getAnnotations(AnnotatedElement annotatedElement)
      Gets all annotations for an potentially remote element.
      Parameters:
      annotatedElement - AnnotatedElement context target
      Returns:
      local equivalents to all adaptable remote annotations