Package org.opencastproject.graphql.util
Class AnnotationScanner
java.lang.Object
org.opencastproject.graphql.util.AnnotationScanner
This is a utility class that provides methods for scanning annotations in classes.
It provides a public method to find and return a collection of classes that are annotated with a specific annotation.
It also provides private methods to recursively scan a given path in a bundle for class files
and to load a class given its fully qualified name and a class loader.*
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Class<?>> findAnnotatedClasses(Class<?> context, Class<? extends Annotation> annotation) Finds and returns a collection of classes that are annotated with a specific annotation.
-
Method Details
-
findAnnotatedClasses
public static Collection<Class<?>> findAnnotatedClasses(Class<?> context, Class<? extends Annotation> annotation) Finds and returns a collection of classes that are annotated with a specific annotation.- Parameters:
context- The class from which the context class loader is derived. This is typically the class in which you are working.annotation- The annotation that the classes must have to be included in the returned collection.- Returns:
- A collection of classes that are annotated with the specified annotation.
-