Package step.core.scanner
Class CachedAnnotationScanner
- java.lang.Object
-
- step.core.scanner.CachedAnnotationScanner
-
public class CachedAnnotationScanner extends java.lang.Object
This classes provides a list of static methods delegating annotation scanning toAnnotationScanner
and caching its results. A cache entry for each combination of packagePrefix andClassLoader
will be created. Calling this class for non-bounded sets of combinations will cause memory issues. Please be therefore aware of what you're doing when using this class
-
-
Constructor Summary
Constructors Constructor Description CachedAnnotationScanner()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clearCache()
static java.util.Set<java.lang.Class<?>>
getClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
static java.util.Set<java.lang.Class<?>>
getClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
static java.util.Set<java.lang.Class<?>>
getClassesWithAnnotation(java.lang.String packagePrefix, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
static java.util.Set<java.lang.reflect.Method>
getMethodsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
static java.util.Set<java.lang.reflect.Method>
getMethodsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
static java.util.Set<java.lang.reflect.Method>
getMethodsWithAnnotation(java.lang.String packagePrefix, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
-
-
-
Method Detail
-
getClassesWithAnnotation
public static java.util.Set<java.lang.Class<?>> getClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Parameters:
annotationClass
-- Returns:
- a set of classes annotated by the provided annotation in the current context class loader. Warning: Results of this methods are cached. See Class comments for more details
-
getClassesWithAnnotation
public static java.util.Set<java.lang.Class<?>> getClassesWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
- Parameters:
annotationClass
-classloader
-- Returns:
- a set of classes annotated by the provided annotation in the provided class loader. Warning: Results of this methods are cached. See Class comments for more details
-
getClassesWithAnnotation
public static java.util.Set<java.lang.Class<?>> getClassesWithAnnotation(java.lang.String packagePrefix, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
- Parameters:
packagePrefix
-annotationClass
-classloader
-- Returns:
- a set of classes annotated by the provided annotation in the provided class loader and within the provided package. Warning: Results of this methods are cached. See Class comments for more details
-
getMethodsWithAnnotation
public static java.util.Set<java.lang.reflect.Method> getMethodsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Parameters:
annotationClass
-- Returns:
- a set of methods annotated by the provided annotation in the current context class loader. Warning: Results of this methods are cached. See Class comments for more details
-
getMethodsWithAnnotation
public static java.util.Set<java.lang.reflect.Method> getMethodsWithAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
- Parameters:
annotationClass
-classloader
-- Returns:
- a set of methods annotated by the provided annotation in the provided class loader. Warning: Results of this methods are cached. See Class comments for more details
-
getMethodsWithAnnotation
public static java.util.Set<java.lang.reflect.Method> getMethodsWithAnnotation(java.lang.String packagePrefix, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.ClassLoader classloader)
- Parameters:
packagePrefix
-annotationClass
-classloader
-- Returns:
- a set of classes annotated by the provided annotation in the provided class loader and within the provided package. Warning: Results of this methods are cached. See Class comments for more details
-
clearCache
public static void clearCache()
-
-