Package com.vaadin.copilot
Class UserApplicationComponentFinder
java.lang.Object
com.vaadin.copilot.UserApplicationComponentFinder
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDescribes a component class found by this finder.static final recordControls which classes are included in finder results. -
Constructor Summary
ConstructorsConstructorDescriptionUserApplicationComponentFinder(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. -
Method Summary
Modifier and TypeMethodDescriptiongetClassesImplementing(Class<?> interfaceClazz) Finds classes that implement the given interface.getSubClasses(Class<?> clazz) Finds subclasses of the given class.voidSets the options that control which scanned classes are returned.
-
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 packagevaadinSession- the Vaadin session for resolving server routes
-
-
Method Details
-
setOptions
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
Finds subclasses of the given class.- Parameters:
clazz- the class whose subclasses to find- Returns:
- matching class information after applying the configured options
-