public static class ClassFinder.DefaultClassFinder extends Object implements ClassFinder
ClassFinder.CachedClassFinder, ClassFinder.DefaultClassFinder| Constructor and Description |
|---|
DefaultClassFinder(ClassLoader classLoader,
Class<?>... classes)
ClassFinder using a specified
ClassLoader to load
classes and a list of classes where to look for annotations or
subclasses. |
DefaultClassFinder(Set<Class<?>> classes)
It uses current classloader for getting resources or loading classes.
|
| Modifier and Type | Method and Description |
|---|---|
Set<Class<?>> |
getAnnotatedClasses(Class<? extends Annotation> annotation)
Get annotated classes in the classloader.
|
ClassLoader |
getClassLoader()
Get class loader which is used to find classes.
|
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, waitgetAnnotatedClasses, getSubTypesOfpublic DefaultClassFinder(Set<Class<?>> classes)
classes - The classes.public DefaultClassFinder(ClassLoader classLoader, Class<?>... classes)
ClassLoader to load
classes and a list of classes where to look for annotations or
subclasses.classLoader - classloader for getting resources or loading classes.classes - classes where to look for annotations or subclasses.public Set<Class<?>> getAnnotatedClasses(Class<? extends Annotation> annotation)
ClassFindergetAnnotatedClasses in interface ClassFinderannotation - the annotationpublic URL getResource(String name)
ClassFindergetResource in interface ClassFindername - class literalpublic <T> Class<T> loadClass(String name) throws ClassNotFoundException
ClassFinderloadClass in interface ClassFindername - the class literalClassNotFoundException - when the class is not in the classpathpublic <T> Set<Class<? extends T>> getSubTypesOf(Class<T> type)
ClassFindergetSubTypesOf in interface ClassFinderT - the class of the typetype - the type to search for the subtypes forpublic ClassLoader getClassLoader()
ClassFindergetClassLoader in interface ClassFinderCopyright © 2000–2020 Vaadin Ltd. All rights reserved.