Class HeaderParameter
java.lang.Object
com.invirgance.convirgance.web.parameter.HeaderParameter
- All Implemented Interfaces:
Parameter
Retrieve the value of an HTTP Header. The returned key defaults to the same
name as the header if
headerName is not set, but can be overridden
by setting the name parameter.- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe value to return if the header is not foundThe header to retrieve from the HTTP requestgetName()Name of the parameter.getValue(HttpRequest request) Extracts a value from the HTTP request.voidsetDefaultValue(String defaultValue) Set the value to return if the header is not foundvoidsetHeaderName(String headerName) Set the header to retrieve from the HTTP requestvoidSets the name of the parameter.
-
Constructor Details
-
HeaderParameter
public HeaderParameter()
-
-
Method Details
-
getName
Name of the parameter. Defaults toheaderNameif not set. -
setName
Sets the name of the parameter. Also setsheaderNameif not set.- Parameters:
name- name of the parameter
-
getHeaderName
The header to retrieve from the HTTP request- Returns:
- name of the header
-
setHeaderName
Set the header to retrieve from the HTTP request- Parameters:
headerName- name of the header
-
getDefaultValue
The value to return if the header is not found- Returns:
- default value to return
-
setDefaultValue
Set the value to return if the header is not found- Parameters:
defaultValue- default value to return
-
getValue
Description copied from interface:ParameterExtracts a value from the HTTP request.
-