public class RequestParamSubstitutionHandler extends Object implements SubstitutionHandler
SubstitutionHandler
makes the elements of RequestParameters
available as substitutions. The name
argument is used as the
RequestParameters
name.
ID: ESS_REQ_PARAM
SubstitutionHandler
Constructor and Description |
---|
RequestParamSubstitutionHandler(RequestParameters requestParams) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Used to release any resources the handler may have claimed, such as open
files or connections.
|
boolean |
containsKey(String name)
Reports whether the handler can return a value to substitute for
name . |
String |
get(String name)
Gets the value which will be used to replace the token.
|
String |
getId()
An identifier that can be used to request that a specific handler
(or set of handlers) should be used for a substitution.
|
public RequestParamSubstitutionHandler(RequestParameters requestParams)
public String getId()
SubstitutionHandler
The returned ID should adhere to basic identifier rules, e.g.,
it should consist of letters, numbers, and underscores only.
A null
, blank, or invalid ID may result in the handler
being skipped.
The method getId()
may be called at any time.
getId
in interface SubstitutionHandler
public boolean containsKey(String name)
SubstitutionHandler
name
. If containsKey
returns false
, then
this handler will not be used for substituting name
.containsKey
in interface SubstitutionHandler
name
- the key value being checkedtrue
if it can handle name
,
false
otherwisepublic String get(String name)
SubstitutionHandler
name
is not supported, then get()
should return
null
. Conversely, if the handler returns true
for
containsKey
, then get()
should return a
non-null String.get
in interface SubstitutionHandler
name
- The key value for the substitutionpublic void close()
SubstitutionHandler
close
in interface SubstitutionHandler