-
- All Implemented Interfaces:
-
java.io.Serializable
public final class Routes implements Serializable
A configuration object of all routes and error routes in the application. Simply use autoDiscoverViews to discover everything.
To speed up the tests, you can create one instance of this class only, then reuse that instance in every call to MockVaadin.setup.
-
-
Field Summary
Fields Modifier and Type Field Description private final Set<Class<out Component>>routesprivate final Set<Class<out HasErrorParameter<?>>>errorRoutesprivate BooleanskipPwaInit
-
Method Summary
Modifier and Type Method Description final Set<Class<out Component>>getRoutes()final Set<Class<out HasErrorParameter<?>>>getErrorRoutes()final BooleangetSkipPwaInit()final UnitsetSkipPwaInit(Boolean skipPwaInit)final Unitregister(VaadinContext sc)Registers all routes to Vaadin 15 registry. final RoutesautoDiscoverViews(String packageNames)Auto-discovers everything, registers it into thisand returnsthis.final RoutesautoDiscoverViews()Auto-discovers everything, registers it into thisand returnsthis.final Routesmerge(Routes other)StringtoString()-
-
Method Detail
-
getErrorRoutes
final Set<Class<out HasErrorParameter<?>>> getErrorRoutes()
-
getSkipPwaInit
final Boolean getSkipPwaInit()
-
setSkipPwaInit
final Unit setSkipPwaInit(Boolean skipPwaInit)
-
register
final Unit register(VaadinContext sc)
Registers all routes to Vaadin 15 registry. Automatically called from MockVaadin.setup.
-
autoDiscoverViews
@JvmOverloads() final Routes autoDiscoverViews(String packageNames)
Auto-discovers everything, registers it into
thisand returnsthis.Route-annotated views go into routes
HasErrorParameter error views go into errorRoutes After this function finishes, you can still modify the routes and errorRoutes sets, for example you can clear the errorRoutes if there is some kind of misdetection.
- Parameters:
packageNames- set the package name for the detector to be faster; or provide null to scan the whole classpath, but this is quite slow.
-
autoDiscoverViews
@JvmOverloads() final Routes autoDiscoverViews()
Auto-discovers everything, registers it into
thisand returnsthis.Route-annotated views go into routes
HasErrorParameter error views go into errorRoutes After this function finishes, you can still modify the routes and errorRoutes sets, for example you can clear the errorRoutes if there is some kind of misdetection.
-
-
-
-