org.codehaus.waffle.registrar
Class RequestParameterReference
java.lang.Object
org.codehaus.waffle.registrar.AbstractReference
org.codehaus.waffle.registrar.RequestParameterReference
- All Implemented Interfaces:
- Reference
public class RequestParameterReference
- extends AbstractReference
Allows for a component dependency to be resolved from a ServletRequest
parameter
NOTE: This should only be utilized from Registrar.request()
.
- Author:
- Michael Ward
Method Summary |
java.lang.Object |
getDefaultValue()
|
static RequestParameterReference |
requestParameter(java.lang.String key)
This method can be statically imported into an Application's Registrar allowing
for a more fluent interface to define components and their dependencies |
static RequestParameterReference |
requestParameter(java.lang.String key,
java.lang.Object defaultValue)
This method can be statically imported into an Application's Registrar allowing
for a more fluent interface to define components and their dependencies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RequestParameterReference
public RequestParameterReference(java.lang.String key)
- Parameters:
key
- is the String
specifying the name of the request parameter.
RequestParameterReference
public RequestParameterReference(java.lang.String key,
java.lang.Object defaultValue)
- Parameters:
key
- is the String
specifying the name of the request parameter.defaultValue
- the default value to use if the parameter is not found, primitives types should NOT set a
default value since the standard default value will be returned (e.g. int => 0, double => 0.0)
getDefaultValue
public java.lang.Object getDefaultValue()
- Returns:
- the default value to use if the parameter is not found, primitives types should NOT set a
default value since the standard default value will be returned (e.g. int => 0, double => 0.0)
requestParameter
public static RequestParameterReference requestParameter(java.lang.String key)
- This method can be statically imported into an Application's Registrar allowing
for a more fluent interface to define components and their dependencies
- Parameters:
key
- is the String
specifying the name of the request parameter.
requestParameter
public static RequestParameterReference requestParameter(java.lang.String key,
java.lang.Object defaultValue)
- This method can be statically imported into an Application's Registrar allowing
for a more fluent interface to define components and their dependencies
- Parameters:
key
- is the String
specifying the name of the request parameter.defaultValue
- the default value to use if the parameter is not found, primitives types should NOT set a
default value since the standard default value will be returned (e.g. int => 0, double => 0.0)
Copyright © 2008. All Rights Reserved.