Interface WebRequestContext

All Known Implementing Classes:
DefaultWebRequestContext

public interface WebRequestContext
Interface representing a context for handling web requests. It provides methods for accessing parameter values from various sources such as path, query, form, headers, and cookies.
  • Method Details

    • getParameter

      ParameterValue getParameter(String name, WebParameterSource... sources)
      Retrieves the value of a specified parameter from the given sources in a web request.
      Parameters:
      name - the name of the parameter to retrieve. Must not be null.
      sources - the sources to look for the parameter, such as PATH, QUERY, HEADER, COOKIE, or FORM. If no sources are provided, the method may default to a predefined set of sources.
      Returns:
      the ParameterValue associated with the specified parameter name and sources, or an empty ParameterValue if the parameter is not found.
    • getParameter

      default ParameterValue getParameter(String name)
      Retrieves the value of a parameter from the web request. This method searches for the specified parameter in the default parameter sources: path, query, and form data.
      Parameters:
      name - the name of the parameter to retrieve
      Returns:
      the value of the parameter, wrapped in a ParameterValue, or null if the parameter is not found
    • getPathParameter

      default ParameterValue getPathParameter(String name)
      Retrieves the value of a parameter from the path section of the web request.
      Parameters:
      name - the name of the parameter to retrieve from the path.
      Returns:
      the ParameterValue associated with the specified parameter name, or null if the parameter is not present in the path.
    • getQueryParameter

      default ParameterValue getQueryParameter(String name)
      Retrieves the value of a query parameter from the web request.
      Parameters:
      name - the name of the query parameter to retrieve
      Returns:
      the ParameterValue representing the value of the query parameter, or null if the parameter is not present
    • getHeaderParameter

      default ParameterValue getHeaderParameter(String name)
      Retrieves the value of a parameter from the HTTP request headers by its name.
      Parameters:
      name - the name of the parameter to retrieve from the header
      Returns:
      the value of the header parameter wrapped in a ParameterValue, or null if not found
    • getCookieParameter

      default ParameterValue getCookieParameter(String name)
      Retrieves a parameter value from the cookie source using the specified parameter name.
      Parameters:
      name - the name of the cookie parameter to retrieve
      Returns:
      the value of the specified cookie parameter wrapped in a ParameterValue object
    • getFormParameter

      default ParameterValue getFormParameter(String name)
      Retrieves the value of a form parameter from the web request context.
      Parameters:
      name - the name of the form parameter to retrieve.
      Returns:
      the value of the form parameter as a ParameterValue, or null if the parameter is not present in the form source.