com.vaadin.flow.server.

Class BootstrapHandler.BootstrapContext

  • Enclosing class:

    BootstrapHandler


    protected static class BootstrapHandler.BootstrapContext
    extends Object

    Provides context information for the bootstrap process.

    • Constructor Detail

      • BootstrapContext

        protected BootstrapContext(VaadinRequest request,
                                   VaadinResponse response,
                                   VaadinSession session,
                                   UI ui)

        Creates a new context instance using the given parameters.

        Parameters:

        request - the request object

        response - the response object

        session - the current session

        ui - the UI object

    • Method Detail

      • getResponse

        public VaadinResponse getResponse()

        Gets the Vaadin/HTTP response.

        Returns:

        the Vaadin/HTTP response

      • getRequest

        public VaadinRequest getRequest()

        Gets the Vaadin/HTTP request.

        Returns:

        the Vaadin/HTTP request

      • getSession

        public VaadinSession getSession()

        Gets the Vaadin session.

        Returns:

        the Vaadin session

      • getUI

        public UI getUI()

        Gets the UI.

        Returns:

        the UI

      • getPushMode

        public PushMode getPushMode()

        Gets the push mode to use.

        Returns:

        the desired push mode

      • getApplicationParameters

        public elemental.json.JsonObject getApplicationParameters()

        Gets the application parameters specified by the BootstrapHandler.

        Returns:

        the application parameters that will be written on the page

      • isProductionMode

        public boolean isProductionMode()

        Checks if the application is running in production mode.

        Returns:

        true if in production mode, false otherwise.

      • getPageConfigurationAnnotation

        public <T extends AnnotationOptional<T> getPageConfigurationAnnotation(Class<T> annotationType)

        Gets an annotation from the topmost class in the current navigation target hierarchy.

        Type Parameters:

        T - the type of the annotation

        Parameters:

        annotationType - the type of the annotation to get

        Returns:

        an annotation, or an empty optional if there is no current navigation target or if it doesn't have the annotation

      • getPageConfigurationAnnotations

        public <T extends AnnotationList<T> getPageConfigurationAnnotations(Class<T> annotationType)

        Gets a a list of annotations from the topmost class in the current navigation target hierarchy.

        Type Parameters:

        T - the type of the annotations

        Parameters:

        annotationType - the type of the annotation to get

        Returns:

        a list of annotation, or an empty list if there is no current navigation target or if it doesn't have the annotation