Class InternalAnnotationScanAnnotationManager
java.lang.Object
cloud.piranha.extension.annotationscan.internal.InternalAnnotationScanAnnotationManager
- All Implemented Interfaces:
AnnotationManager
The standard annotation scan AnnotationManager.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<Class<?>,
List<AnnotationInfo<?>>> Stores the annotations.Stores the instances. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotatedClass
(Class<? extends Annotation> annotationClass, Class<?> clazz) Add an annotated class.void
addAnnotation
(AnnotationInfo<?> annotationInfo) Add the annotation.void
addInstance
(Class<?> instanceClass, Class<?> implementingClass) Add an instance.getAnnotatedClass
(Class<? extends Annotation> annotationClass) Get the annotated classes.getAnnotatedClasses
(Class<?>[] annotationClasses) Get annotated classes.List<AnnotationInfo<?>>
getAnnotations
(Class<?>... annotationClasses) Get the annotations.<T> List<AnnotationInfo<T>>
getAnnotations
(Class<T> annotationClass) Get the annotations.<T> List<AnnotationInfo<T>>
getAnnotationsByTarget
(Class<T> annotationClass, AnnotatedElement type) Get the annotation for the annotation class and annotated element type.getInstances
(Class<?>... instanceClasses) Get the instances.getInstances
(Class<T> instanceClass) Get the instances.
-
Field Details
-
annotations
Stores the annotations. -
instances
Stores the instances.
-
-
Constructor Details
-
InternalAnnotationScanAnnotationManager
public InternalAnnotationScanAnnotationManager()
-
-
Method Details
-
addAnnotation
Description copied from interface:AnnotationManager
Add the annotation.- Specified by:
addAnnotation
in interfaceAnnotationManager
- Parameters:
annotationInfo
- the annotation info.
-
addInstance
Add an instance.- Specified by:
addInstance
in interfaceAnnotationManager
- Parameters:
instanceClass
- the instance class.implementingClass
- the implementing class.
-
getAnnotations
Description copied from interface:AnnotationManager
Get the annotations.- Specified by:
getAnnotations
in interfaceAnnotationManager
- Parameters:
annotationClasses
- the annotation classes.- Returns:
- the list of annotations.
-
getAnnotations
Description copied from interface:AnnotationManager
Get the annotations.- Specified by:
getAnnotations
in interfaceAnnotationManager
- Type Parameters:
T
- the type.- Parameters:
annotationClass
- the annotation class.- Returns:
- the typed list of annotations.
-
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 interfaceAnnotationManager
- Type Parameters:
T
- the type.- Parameters:
annotationClass
- the annotation class.type
- the annotated element type.- Returns:
- the list of annotations.
-
getInstances
Description copied from interface:AnnotationManager
Get the instances.- Specified by:
getInstances
in interfaceAnnotationManager
- Parameters:
instanceClasses
- the instance classes.- Returns:
- the list of instances.
-
getInstances
Description copied from interface:AnnotationManager
Get the instances.- Specified by:
getInstances
in interfaceAnnotationManager
- Type Parameters:
T
- the type.- Parameters:
instanceClass
- the instance class.- Returns:
- the typed list of instances.
-
addAnnotatedClass
Description copied from interface:AnnotationManager
Add an annotated class.- Specified by:
addAnnotatedClass
in interfaceAnnotationManager
- Parameters:
annotationClass
- the annotation class on the annotated class.clazz
- the annotated class.
-
getAnnotatedClass
Description copied from interface:AnnotationManager
Get the annotated classes.- Specified by:
getAnnotatedClass
in interfaceAnnotationManager
- Parameters:
annotationClass
- the annotation to inspect for.- Returns:
- the classes annotated with the given annotation (if any).
-
getAnnotatedClasses
Description copied from interface:AnnotationManager
Get annotated classes.- Specified by:
getAnnotatedClasses
in interfaceAnnotationManager
- Parameters:
annotationClasses
- the annotation classes to inspect for.- Returns:
- the classes annotated with the given annotations (if any).
-