Interface ViewContext

    • Method Detail

      • getRequestServerUrl

        @Nonnull
        String getRequestServerUrl()
        Returns the server URL the request was sent to. The URL contains the protocol, the domain and (optionally) the port.
        Returns:
        the server URL (e.g. "http://www.shredzone.de")
      • putTypedArgument

        <T> void putTypedArgument​(Class<T> type,
                                  @Nullable
                                  T value)
        Adds a typed argument to this context. Typed arguments are available to the view handler's parameter list.
        Parameters:
        type - Type this argument is to be registered with (may be the value's type or a supertype)
        value - the value to register, may be null
      • getValueOfType

        <T> T getValueOfType​(@Nullable
                             Class<T> type)
                      throws ViewContextException
        Gets a value that matches the requested type.
        Type Parameters:
        T - the requested type
        Parameters:
        type - type to get a value for
        Returns:
        a value for that type, may be null if the type's value was set to null.
        Throws:
        ViewContextException - if there was no data satisfying that type
      • setPathParts

        void setPathParts​(Map<String,​String> pathParts)
        Sets the path parts from resolving the view URL. Should only be invoked from the ViewService.
        Parameters:
        pathParts - Map of path parts
      • getParameter

        String getParameter​(String name)
        Gets a parameter from the request URL's search part.
        Parameters:
        name - the parameter name
        Returns:
        parameter value, or null if there is no such parameter
      • setQualifier

        void setQualifier​(@Nullable
                          String qualifier)
        Sets a View qualifier.
        Parameters:
        qualifier - qualifier to be used, or null for the standard qualifier
      • getQualifier

        String getQualifier()
        Gets a View qualifier.
        Returns:
        qualifier to be used, or null for the standard qualifier