T - the type of value to expect.public abstract class Parameter<T>
extends java.lang.Object
HttpServletRequest
and document themselves as an xml description.| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<java.lang.String,java.lang.String> |
valueDescriptionsByName |
| Constructor and Description |
|---|
Parameter(java.lang.String name,
java.lang.String description,
T defaultValue,
java.lang.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.
|
java.lang.String |
getDescription()
Returns a short textual description of what this parameter does
|
java.lang.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.
|
java.lang.String |
getValueForDescription(T val) |
protected java.util.HashMap<java.lang.String,java.lang.String> valueDescriptionsByName
public Parameter(java.lang.String name,
java.lang.String description,
T defaultValue,
java.lang.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 java.lang.String getName()
public java.lang.String getDescription()
public T getDefaultValue()
public java.lang.String getValueForDescription(T val)
public abstract T getValue(javax.servlet.http.HttpServletRequest request) throws java.lang.IllegalArgumentException
request - the request made to the servicejava.lang.IllegalArgumentException - if the value specified in this request cannot be parsedCopyright © 2012 David Milne. All Rights Reserved.