Class Routes

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

    • Constructor Detail

      • Routes

        Routes(Set<Class<out Component>> routes, Set<Class<out HasErrorParameter<?>>> errorRoutes, Set<Class<out RouterLayout>> layouts, Boolean skipPwaInit)
    • Method Detail

      • autoDiscoverViews

        @JvmOverloads() final Routes autoDiscoverViews(String packageNames)

        Auto-discovers everything, registers it into this and returns this.

        • 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.
        Returns:

        this

      • autoDiscoverViews

        @JvmOverloads() final Routes autoDiscoverViews()

        Auto-discovers everything, registers it into this and returns this.

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

        Returns:

        this