Class RequestArrayParameter

java.lang.Object
com.invirgance.convirgance.web.parameter.RequestArrayParameter
All Implemented Interfaces:
Parameter

@Wiring public class RequestArrayParameter extends Object implements Parameter
Allows returning the parameters values of a HttpRequest as an array.
 Use this parameter type when you need to:
 - Access multiple values for the same parameter name
 - Handle repeated query parameters
 - Process multi-select form fields
 
Author:
jbanes
  • Constructor Details

    • RequestArrayParameter

      public RequestArrayParameter()
  • Method Details

    • getName

      public String getName()
      Gets the name of this parameter. Returns the internal name if set, otherwise falls back to the request parameter name.
      Specified by:
      getName in interface Parameter
      Returns:
      The parameter name
    • setName

      public void setName(String name)
      Sets the name of the parameter to retrieve.
      Parameters:
      name - Parameter name.
    • getUrlParameterName

      public String getUrlParameterName()
      Returns the parameter name.
      Returns:
      The name.
    • setUrlParameterName

      public void setUrlParameterName(String urlParamName)
      Sets the URL parameter name to retrieve.
      Parameters:
      urlParamName - The name.
    • getValue

      public Object getValue(HttpRequest request)
      Gets the parameter's values as a JSONArray.
      Specified by:
      getValue in interface Parameter
      Parameters:
      request - The request to get the values from.
      Returns:
      An array containing the values.