com.holonplatform.vaadin.navigator

## Interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>

- All Known Subinterfaces:
    SpringViewNavigator.Builder, ViewNavigator.Builder
  Enclosing interface:
    ViewNavigator

      public static interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>

  Base `ViewNavigator` builder

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `addProvider(com.vaadin.navigator.ViewProvider provider)` Add a `ViewProvider` to navigator.
    `B` | `authenticationEnabled(boolean authenticationEnabled)` Set whether the support for `Authenticate` annotation on `View`s or `UI` is enabled.
    `B` | `defaultViewName(String defaultViewName)` Set the default view name.
    `B` | `defaultViewNavigationStrategy(DefaultViewNavigationStrategy defaultViewNavigationStrategy)` Set the strategy to use to navigate to the default view.
    `B` | `defaultViewWindowConfigurator(Consumer<ViewWindowConfigurator> configurator)` Set the default `ViewWindowConfigurator` consumer to used for all the view Windows created by this navigator.
    `B` | `errorView(com.vaadin.navigator.View errorView)` Set the view to be displayed when no other view matches the navigation state.
    `B` | `errorViewProvider(com.vaadin.navigator.ViewProvider errorViewProvider)` Registers a view provider that is queried for a view when no other view matches the navigation state.
    `B` | `maxNavigationHistorySize(int maxSize)` Set navigation history max size
    `B` | `navigateToDefaultViewWhenViewNotAvailable(boolean navigateToDefaultViewWhenViewNotAvailable)` Set whether to navigate to default view (if setted) when a view is not available from current navigation state
    `B` | `viewClassProvider(com.vaadin.navigator.ViewProvider provider, ViewClassProvider viewClassProvider)` Associate given `ViewClassProvider` to given `ViewProvider`.
    `B` | `withViewChangeListener(com.vaadin.navigator.ViewChangeListener viewChangeListener)` Add a `ViewChangeListener` to Navigator

- - ### Method Detail

    - #### maxNavigationHistorySize

          B maxNavigationHistorySize(int maxSize)

      Set navigation history max size
      Parameters:
        `maxSize` - Max size of retained navigation states
      Returns:
        this

    - #### addProvider

          B addProvider(com.vaadin.navigator.ViewProvider provider)

      Add a `ViewProvider` to navigator. Providers are called in order of registration until one that can handle the requested view name is found.
      Parameters:
        `provider` - View provider to add (not null)
      Returns:
        this

    - #### viewClassProvider

          B viewClassProvider(com.vaadin.navigator.ViewProvider provider,
                              ViewClassProvider viewClassProvider)

      Associate given `ViewClassProvider` to given `ViewProvider`.
      Parameters:
        `provider` - View provider (not null)
        `viewClassProvider` - View class provider bound to the given View provider
      Returns:
        this

    - #### defaultViewName

          B defaultViewName(String defaultViewName)

      Set the default view name. If a `View` with given `defaultViewName` is valid and provided by registered ViewProviders, it is used as target of `ViewNavigator.navigateToDefault()` method and as a fallback by `ViewNavigator.navigateBack()` method if no other View is available in history.
      Parameters:
        `defaultViewName` - the default view name to set
      Returns:
        this

    - #### defaultViewNavigationStrategy

          B defaultViewNavigationStrategy(DefaultViewNavigationStrategy defaultViewNavigationStrategy)

      Set the strategy to use to navigate to the default view. If a strategy is configured, the `defaultViewName(String)` is ignored.
      Parameters:
        `defaultViewNavigationStrategy` - The strategy to set
      Returns:
        this

    - #### navigateToDefaultViewWhenViewNotAvailable

          B navigateToDefaultViewWhenViewNotAvailable(boolean navigateToDefaultViewWhenViewNotAvailable)

      Set whether to navigate to default view (if setted) when a view is not available from current navigation state
      Parameters:
        `navigateToDefaultViewWhenViewNotAvailable` - `true` to navigate to default view (if setted) when a view is not available from current navigation state
      Returns:
        this

    - #### defaultViewWindowConfigurator

          B defaultViewWindowConfigurator(Consumer<ViewWindowConfigurator> configurator)

      Set the default `ViewWindowConfigurator` consumer to used for all the view Windows created by this navigator.
      Parameters:
        `configurator` - View window configurator
      Returns:
        this

    - #### errorView

          B errorView(com.vaadin.navigator.View errorView)

      Set the view to be displayed when no other view matches the navigation state.
      Parameters:
        `errorView` - Error view
      Returns:
        this

    - #### errorViewProvider

          B errorViewProvider(com.vaadin.navigator.ViewProvider errorViewProvider)

      Registers a view provider that is queried for a view when no other view matches the navigation state. An error view provider should match any navigation state, but could return different views for different states. Its `getViewName(String navigationState)` should return `navigationState`.
      Parameters:
        `errorViewProvider` - Error view provider
      Returns:
        this

    - #### withViewChangeListener

          B withViewChangeListener(com.vaadin.navigator.ViewChangeListener viewChangeListener)

      Add a `ViewChangeListener` to Navigator
      Parameters:
        `viewChangeListener` - ViewChangeListener to add
      Returns:
        this

    - #### authenticationEnabled

          B authenticationEnabled(boolean authenticationEnabled)

      Set whether the support for `Authenticate` annotation on `View`s or `UI` is enabled.

      If enabled, the navigator will check the `Authenticate` annotation on `View`s or `UI` during navigation, and if present, requires the presence of an authenticated `AuthContext` obtained through `AuthContext.getCurrent()`. If an `AuthContext` is present but not authenticated, try to perform authentication using current `VaadinRequest` and the optional authentication schemes specified using `Authenticate.schemes()`. If the authentication is not successfull and a valid redirect URI is provided through `Authenticate.redirectURI()`, the navigation is redirected to that URI. If the URI does not specify a scheme, or the scheme is equal to `view://`, the navigation is redirected to the navigation state following the `view://` scheme or to the navigation state equal to the `Authenticate.redirectURI()` attribute if a URI scheme is not specified.

      The authentication support is enabled by default.

      Parameters:
        `authenticationEnabled` - `true` to enable the `Authenticate` support, `false` to disable.
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.