Class RequestParameter
java.lang.Object
com.invirgance.convirgance.web.parameter.RequestParameter
- All Implemented Interfaces:
Parameter
Parameter implementation that extracts values from HTTP request parameters.
Provides access to URL query parameters or form field values from
HTTP requests. It supports default values when parameters are not present
and allows mapping between internal parameter names and request parameter names.
This is the most commonly used Parameter implementation, used to: - Extract query string values from GET requests - Access form field values from POST requests - Provide default values for optional parameters
- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the fallback value if the parameter has none.getName()
Gets the name of this parameter.Returns the parameter names.getValue
(HttpRequest request) Gets the value of aHttpRequest
parameter.void
setDefaultValue
(String defaultValue) Sets the fallback value when the parameter is null.void
Sets the name of the parameter to retrieve.void
setUrlParameterName
(String urlParamName) Sets the parameter name.
-
Constructor Details
-
RequestParameter
public RequestParameter()
-
-
Method Details
-
getName
Gets the name of this parameter. Returns the internal name if set, otherwise falls back to the request parameter name. -
setName
Sets the name of the parameter to retrieve.- Parameters:
name
- The name.
-
getUrlParameterName
Returns the parameter names.- Returns:
- The name.
-
setUrlParameterName
Sets the parameter name.- Parameters:
urlParamName
- The name.
-
getDefaultValue
Returns the fallback value if the parameter has none.- Returns:
- The default.
-
setDefaultValue
Sets the fallback value when the parameter is null.- Parameters:
defaultValue
- The fallback value.
-
getValue
Gets the value of aHttpRequest
parameter.
-