Class DefaultAnnotationManager

java.lang.Object
cloud.piranha.core.impl.DefaultAnnotationManager
All Implemented Interfaces:
AnnotationManager

public class DefaultAnnotationManager extends Object implements AnnotationManager
The default AnnotationManager.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • DefaultAnnotationManager

      public DefaultAnnotationManager()
  • Method Details

    • addAnnotation

      public void addAnnotation(AnnotationInfo<?> annotationInfo)
      Description copied from interface: AnnotationManager
      Add the annotation.
      Specified by:
      addAnnotation in interface AnnotationManager
      Parameters:
      annotationInfo - the annotation info.
    • addInstance

      public void addInstance(Class<?> instanceClass, Class<?> implementingClass)
      Description copied from interface: AnnotationManager
      Add an instance.
      Specified by:
      addInstance in interface AnnotationManager
      Parameters:
      instanceClass - the instance class.
      implementingClass - the implementing class.
    • getAnnotations

      public <T> List<AnnotationInfo<T>> getAnnotations(Class<T> annotationClass)
      Description copied from interface: AnnotationManager
      Get the annotations.
      Specified by:
      getAnnotations in interface AnnotationManager
      Type Parameters:
      T - the type.
      Parameters:
      annotationClass - the annotation class.
      Returns:
      the typed list of annotations.
    • getAnnotations

      public List<AnnotationInfo<?>> getAnnotations(Class<?>... annotationClasses)
      Description copied from interface: AnnotationManager
      Get the annotations.
      Specified by:
      getAnnotations in interface AnnotationManager
      Parameters:
      annotationClasses - the annotation classes.
      Returns:
      the list of annotations.
    • getInstances

      public <T> List<Class<T>> getInstances(Class<T> instanceClass)
      Description copied from interface: AnnotationManager
      Get the instances.
      Specified by:
      getInstances in interface AnnotationManager
      Type Parameters:
      T - the type.
      Parameters:
      instanceClass - the instance class.
      Returns:
      the typed list of instances.
    • getInstances

      public List<Class<?>> getInstances(Class<?>... instanceClasses)
      Description copied from interface: AnnotationManager
      Get the instances.
      Specified by:
      getInstances in interface AnnotationManager
      Parameters:
      instanceClasses - the instance classes.
      Returns:
      the list of instances.
    • getAnnotationsByTarget

      public <T> List<AnnotationInfo<T>> getAnnotationsByTarget(Class<T> annotationClass, AnnotatedElement type)
      Description copied from interface: AnnotationManager
      Get the annotation for the annotation class and annotated element type.
      Specified by:
      getAnnotationsByTarget in interface AnnotationManager
      Type Parameters:
      T - the type.
      Parameters:
      annotationClass - the annotation class.
      type - the annotated element type.
      Returns:
      the list of annotations.
    • addAnnotatedClass

      public void addAnnotatedClass(Class<? extends Annotation> annotationClass, Class<?> clazz)
      Description copied from interface: AnnotationManager
      Add an annotated class.
      Specified by:
      addAnnotatedClass in interface AnnotationManager
      Parameters:
      annotationClass - the annotation class on the annotated class.
      clazz - the annotated class.
    • getAnnotatedClass

      public Set<Class<?>> getAnnotatedClass(Class<? extends Annotation> annotationClass)
      Description copied from interface: AnnotationManager
      Get the annotated classes.
      Specified by:
      getAnnotatedClass in interface AnnotationManager
      Parameters:
      annotationClass - the annotation to inspect for.
      Returns:
      the classes annotated with the given annotation (if any).
    • getAnnotatedClasses

      public Set<Class<?>> getAnnotatedClasses(Class<?>[] annotationClasses)
      Description copied from interface: AnnotationManager
      Get annotated classes.
      Specified by:
      getAnnotatedClasses in interface AnnotationManager
      Parameters:
      annotationClasses - the annotation classes to inspect for.
      Returns:
      the classes annotated with the given annotations (if any).