Interface AnnotationManager

All Known Implementing Classes:
DefaultAnnotationManager, InternalAnnotationScanAnnotationManager

public interface AnnotationManager
The AnnotationManager API.
Author:
Manfred Riem ([email protected]), Arjan Tijms
  • Method Details

    • addAnnotation

      void addAnnotation(AnnotationInfo<?> annotationInfo)
      Add the annotation.
      Parameters:
      annotationInfo - the annotation info.
    • addInstance

      void addInstance(Class<?> instanceClass, Class<?> implementingClass)
      Add an instance.
      Parameters:
      instanceClass - the instance class.
      implementingClass - the implementing class.
    • getAnnotations

      <T> List<AnnotationInfo<T>> getAnnotations(Class<T> annotationClass)
      Get the annotations.
      Type Parameters:
      T - the type.
      Parameters:
      annotationClass - the annotation class.
      Returns:
      the typed list of annotations.
    • getAnnotations

      List<AnnotationInfo<?>> getAnnotations(Class<?>... annotationClasses)
      Get the annotations.
      Parameters:
      annotationClasses - the annotation classes.
      Returns:
      the list of annotations.
    • getInstances

      <T> List<Class<T>> getInstances(Class<T> instanceClass)
      Get the instances.
      Type Parameters:
      T - the type.
      Parameters:
      instanceClass - the instance class.
      Returns:
      the typed list of instances.
    • getInstances

      List<Class<?>> getInstances(Class<?>... instanceClasses)
      Get the instances.
      Parameters:
      instanceClasses - the instance classes.
      Returns:
      the list of instances.
    • getAnnotationsByTarget

      <T> List<AnnotationInfo<T>> getAnnotationsByTarget(Class<T> annotationClass, AnnotatedElement type)
      Get the annotation for the annotation class and annotated element type.
      Type Parameters:
      T - the type.
      Parameters:
      annotationClass - the annotation class.
      type - the annotated element type.
      Returns:
      the list of annotations.
    • addAnnotatedClass

      void addAnnotatedClass(Class<? extends Annotation> annotationClass, Class<?> clazz)
      Add an annotated class.
      Parameters:
      annotationClass - the annotation class on the annotated class.
      clazz - the annotated class.
    • getAnnotatedClass

      Set<Class<?>> getAnnotatedClass(Class<? extends Annotation> annotationClass)
      Get the annotated classes.
      Parameters:
      annotationClass - the annotation to inspect for.
      Returns:
      the classes annotated with the given annotation (if any).
    • getAnnotatedClasses

      Set<Class<?>> getAnnotatedClasses(Class<?>[] annotationClasses)
      Get annotated classes.
      Parameters:
      annotationClasses - the annotation classes to inspect for.
      Returns:
      the classes annotated with the given annotations (if any).