com.vaadin.flow.server.frontend.scanner.
Interface ClassFinder
- 
All Superinterfaces:
All Known Implementing Classes:
ClassFinder.CachedClassFinder, ClassFinder.DefaultClassFinder
public interface ClassFinder extends SerializableInterface for annotated and subclass class searches.
Since:
2.0
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static classClassFinder.CachedClassFinderImplementation that proxy and cache a real
ClassFinder.static classClassFinder.DefaultClassFinderImplementation that searches for annotated classes or subclasses in a list of classes.
 
- 
Method Summary
All Methods Modifier and Type Method and Description Set<Class<?>>getAnnotatedClasses(Class<? extends Annotation> clazz)Get annotated classes in the classloader.
default Set<Class<?>>getAnnotatedClasses(String className)Get annotated classes in the classloader.
ClassLoadergetClassLoader()Get class loader which is used to find classes.
URLgetResource(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.
default <T> Set<Class<? extends T>>getSubTypesOf(String name)Gets all subtypes in hierarchy of a given type, using FQN string.
<T> Class<T>loadClass(String name)Load a class in the classloader.
 
 - 
 
- 
- 
Method Detail
- 
getAnnotatedClasses
Set<Class<?>> getAnnotatedClasses(Class<? extends Annotation> clazz)Get annotated classes in the classloader.
Parameters:
clazz- the annotationReturns:
a set with all classes that are annotated
 
- 
getAnnotatedClasses
default Set<Class<?>> getAnnotatedClasses(String className) throws ClassNotFoundExceptionGet annotated classes in the classloader.
Parameters:
className- the annotation class nameReturns:
a set with all classes that are annotated
Throws:
ClassNotFoundException- when the class not found 
- 
getResource
URL getResource(String name)Get a resource from the classpath.
Parameters:
name- class literalReturns:
the resource
 
- 
loadClass
<T> Class<T> loadClass(String name) throws ClassNotFoundExceptionLoad a class in the classloader.
Parameters:
name- the class literalReturns:
the class
Throws:
ClassNotFoundException- when the class is not in the classpath 
- 
getSubTypesOf
<T> Set<Class<? extends T>> getSubTypesOf(Class<T> type)Gets all subtypes in hierarchy of a given type.
Type Parameters:
T- the class of the typeParameters:
type- the type to search for the subtypes forReturns:
set of the subtypes of the given class
 
- 
getClassLoader
ClassLoader getClassLoader()Get class loader which is used to find classes.
Returns:
the class loader which is used to find classes..
 
- 
getSubTypesOf
default <T> Set<Class<? extends T>> getSubTypesOf(String name) throws ClassNotFoundExceptionGets all subtypes in hierarchy of a given type, using FQN string.
Type Parameters:
T- the class of the typeParameters:
name- Fully qualified name of the type to search subtypes ofReturns:
set of the subtypes of the given class
Throws:
ClassNotFoundException- when the parent class is not in the classpath 
 - 
 
 -