Class UserApplicationComponentFinder

java.lang.Object
com.vaadin.copilot.UserApplicationComponentFinder

public class UserApplicationComponentFinder extends Object
Finds application and Vaadin component classes available to Copilot.

The finder scans Vaadin Flow packages and, when Spring is available, the application's base package. Scan results can be tailored with UserApplicationComponentFinder.Options, for example to omit route, abstract, interface, inner, or explicitly excluded classes.

  • Constructor Details

    • UserApplicationComponentFinder

      public UserApplicationComponentFinder(com.vaadin.flow.server.VaadinContext context, com.vaadin.flow.server.VaadinSession vaadinSession)
      Creates a finder that obtains application information from the given Vaadin context and routes from the given session.
      Parameters:
      context - the Vaadin context for resolving the application package
      vaadinSession - the Vaadin session for resolving server routes
  • Method Details

    • setOptions

      public void setOptions(UserApplicationComponentFinder.Options options)
      Sets the options that control which scanned classes are returned.
      Parameters:
      options - the filtering options to use
    • getClassesImplementing

      public List<UserApplicationComponentFinder.ClassNameInfo> getClassesImplementing(Class<?> interfaceClazz)
      Finds classes that implement the given interface.
      Parameters:
      interfaceClazz - the interface implemented by classes to find
      Returns:
      matching class information after applying the configured options
    • getSubClasses

      public List<UserApplicationComponentFinder.ClassNameInfo> getSubClasses(Class<?> clazz)
      Finds subclasses of the given class.
      Parameters:
      clazz - the class whose subclasses to find
      Returns:
      matching class information after applying the configured options