public static class ClassFinder.CachedClassFinder extends Object implements ClassFinder
ClassFinder
.ClassFinder.CachedClassFinder, ClassFinder.DefaultClassFinder
Constructor and Description |
---|
CachedClassFinder(ClassFinder classFinder)
It uses specified classFinder and caches scanned annotation.
|
Modifier and Type | Method and Description |
---|---|
Set<Class<?>> |
getAnnotatedClasses(Class<? extends Annotation> annotation)
Get annotated classes in the classloader.
|
URL |
getResource(String name)
Get a resource from the classpath.
|
<T> Set<Class<? extends T>> |
getSubTypesOf(Class<T> type)
Gets all subtypes in hierarchy of a given type.
|
<T> Class<T> |
loadClass(String name)
Load a class in the classloader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnnotatedClasses, getSubTypesOf
public CachedClassFinder(ClassFinder classFinder)
classFinder
- A real classFinder.public Set<Class<?>> getAnnotatedClasses(Class<? extends Annotation> annotation)
ClassFinder
getAnnotatedClasses
in interface ClassFinder
annotation
- the annotationpublic URL getResource(String name)
ClassFinder
getResource
in interface ClassFinder
name
- class literalpublic <T> Class<T> loadClass(String name) throws ClassNotFoundException
ClassFinder
loadClass
in interface ClassFinder
name
- the class literalClassNotFoundException
- when the class is not in the classpathpublic <T> Set<Class<? extends T>> getSubTypesOf(Class<T> type)
ClassFinder
getSubTypesOf
in interface ClassFinder
T
- the class of the typetype
- the type to search for the subtypes forCopyright © 2023. All rights reserved.