T - the type of value to expect.public abstract class Parameter<T> extends Object
HttpServletRequest
and document themselves as an xml description.| Modifier and Type | Field and Description |
|---|---|
protected HashMap<String,String> |
valueDescriptionsByName |
| Constructor and Description |
|---|
Parameter(String name,
String description,
T defaultValue,
String dataTypeName)
Initialises a new parameter
|
| Modifier and Type | Method and Description |
|---|---|
T |
getDefaultValue()
Returns the value to be used if no value is manually specified in the service request.
|
String |
getDescription()
Returns a short textual description of what this parameter does
|
String |
getName()
Returns the name of the parameter
|
abstract T |
getValue(javax.servlet.http.HttpServletRequest request)
Returns the value of this parameter, as specified in the given request.
|
String |
getValueForDescription(T val) |
public Parameter(String name, String description, T defaultValue, String dataTypeName)
name - the name of the parameterdescription - a short description of what this parameter doesdefaultValue - the value to use when requests do not specify a value for this parameter (may be null)public String getName()
public String getDescription()
public T getDefaultValue()
public abstract T getValue(javax.servlet.http.HttpServletRequest request) throws IllegalArgumentException
request - the request made to the serviceIllegalArgumentException - if the value specified in this request cannot be parsedCopyright © 2012 David Milne. All Rights Reserved.