public class TokenFilter extends Object
Constructor and Description |
---|
TokenFilter() |
Modifier and Type | Method and Description |
---|---|
String |
filter(String input)
Filters the given string, replacing any tokens with their corresponding
values.
|
void |
filterValues(Map<?,String> map)
Given an arbitrary map containing String values, replace each non-null
value with the corresponding filtered value.
|
String |
getToken(String name)
Returns the value of the token with the given name, or null if no such
token has been set.
|
Map<String,String> |
getTokens()
Returns a map of all tokens, with each key being a token name, and each
value being the corresponding token value.
|
void |
setToken(String name,
String value)
Sets the token having the given name to the given value.
|
void |
setTokens(Map<String,String> tokens)
Replaces all current token values with the contents of the given map,
where each map key represents a token name, and each map value
represents a token value.
|
void |
unsetToken(String name)
Removes the value of the token with the given name.
|
public void setToken(String name, String value)
name
- The name of the token to set.value
- The value to set the token to.public String getToken(String name)
name
- The name of the token to return.public void unsetToken(String name)
name
- The name of the token whose value should be removed.public Map<String,String> getTokens()
public void setTokens(Map<String,String> tokens)
tokens
- A map containing the token names and corresponding values to
assign.public String filter(String input)
input
- The string to filter.Copyright © 2017. All rights reserved.