Class ClassFinder.CachedClassFinder
- java.lang.Object
-
- com.vaadin.flow.server.frontend.scanner.ClassFinder.CachedClassFinder
-
- All Implemented Interfaces:
ClassFinder,Serializable
- Enclosing interface:
- ClassFinder
public static class ClassFinder.CachedClassFinder extends Object implements ClassFinder
Implementation that proxy and cache a realClassFinder.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.flow.server.frontend.scanner.ClassFinder
ClassFinder.CachedClassFinder, ClassFinder.DefaultClassFinder
-
-
Constructor Summary
Constructors Constructor Description CachedClassFinder(ClassFinder classFinder)It uses specified classFinder and caches scanned annotation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Class<?>>getAnnotatedClasses(Class<? extends Annotation> annotation)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.<T> Class<T>loadClass(String name)Load a class in the classloader.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.server.frontend.scanner.ClassFinder
getAnnotatedClasses, getSubTypesOf
-
-
-
-
Constructor Detail
-
CachedClassFinder
public CachedClassFinder(ClassFinder classFinder)
It uses specified classFinder and caches scanned annotation.- Parameters:
classFinder- A real classFinder.
-
-
Method Detail
-
getAnnotatedClasses
public Set<Class<?>> getAnnotatedClasses(Class<? extends Annotation> annotation)
Description copied from interface:ClassFinderGet annotated classes in the classloader.- Specified by:
getAnnotatedClassesin interfaceClassFinder- Parameters:
annotation- the annotation- Returns:
- a set with all classes that are annotated
-
getResource
public URL getResource(String name)
Description copied from interface:ClassFinderGet a resource from the classpath.- Specified by:
getResourcein interfaceClassFinder- Parameters:
name- class literal- Returns:
- the resource
-
loadClass
public <T> Class<T> loadClass(String name) throws ClassNotFoundException
Description copied from interface:ClassFinderLoad a class in the classloader.- Specified by:
loadClassin interfaceClassFinder- Parameters:
name- the class literal- Returns:
- the class
- Throws:
ClassNotFoundException- when the class is not in the classpath
-
getSubTypesOf
public <T> Set<Class<? extends T>> getSubTypesOf(Class<T> type)
Description copied from interface:ClassFinderGets all subtypes in hierarchy of a given type.- Specified by:
getSubTypesOfin interfaceClassFinder- Type Parameters:
T- the class of the type- Parameters:
type- the type to search for the subtypes for- Returns:
- set of the subtypes of the given class
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:ClassFinderGet class loader which is used to find classes.- Specified by:
getClassLoaderin interfaceClassFinder- Returns:
- the class loader which is used to find classes..
-
-