You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.server.frontend.scanner.

Class ClassFinder.DefaultClassFinder

  • java.lang.Object
    • com.vaadin.flow.server.frontend.scanner.ClassFinder.DefaultClassFinder
    • Constructor Detail

      • DefaultClassFinder

        public DefaultClassFinder​(Set<Class<?>> classes)

        It uses current classloader for getting resources or loading classes.

        Parameters:

        classes - The classes.

      • DefaultClassFinder

        public 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.

        Parameters:

        classLoader - classloader for getting resources or loading classes.

        classes - classes where to look for annotations or subclasses.

    • Method Detail

      • getAnnotatedClasses

        public Set<Class<?>> getAnnotatedClasses​(Class<? extends Annotation> annotation)

        Description copied from interface: ClassFinder

        Get annotated classes in the classloader.

        Specified by:

        getAnnotatedClasses in interface ClassFinder

        Parameters:

        annotation - the annotation

        Returns:

        a set with all classes that are annotated

      • getResource

        public URL getResource​(String name)

        Description copied from interface: ClassFinder

        Get a resource from the classpath.

        Specified by:

        getResource in interface ClassFinder

        Parameters:

        name - class literal

        Returns:

        the resource

      • getSubTypesOf

        public <T> Set<Class<? extends T>> getSubTypesOf​(Class<T> type)

        Description copied from interface: ClassFinder

        Gets all subtypes in hierarchy of a given type.

        Specified by:

        getSubTypesOf in interface ClassFinder

        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: ClassFinder

        Get class loader which is used to find classes.

        Specified by:

        getClassLoader in interface ClassFinder

        Returns:

        the class loader which is used to find classes..