|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.string.interpolator.VariableInterpolator org.apache.wicket.util.string.interpolator.MapVariableInterpolator
public class MapVariableInterpolator
Interpolates variables into a String
from a Map
.
Field Summary |
---|
Fields inherited from class org.apache.wicket.util.string.interpolator.VariableInterpolator |
---|
string |
Constructor Summary | |
---|---|
MapVariableInterpolator(java.lang.String string,
java.util.Map variables)
Constructor. |
|
MapVariableInterpolator(java.lang.String string,
java.util.Map variables,
boolean exceptionOnNullVarValue)
Constructor. |
Method Summary | |
---|---|
protected java.lang.String |
getValue(java.lang.String variableName)
Retrieves a value for a variable name during interpolation. |
static java.lang.String |
interpolate(java.lang.String string,
java.util.Map variables)
Interpolates a String with the arguments defined in the given Map . |
void |
setVariables(java.util.Map variables)
Sets the Map of variables. |
Methods inherited from class org.apache.wicket.util.string.interpolator.VariableInterpolator |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MapVariableInterpolator(java.lang.String string, java.util.Map variables)
string
- a String
to interpolate intovariables
- the variables to substitutepublic MapVariableInterpolator(java.lang.String string, java.util.Map variables, boolean exceptionOnNullVarValue)
string
- a String
to interpolate intovariables
- the variables to substituteexceptionOnNullVarValue
- if true
an IllegalStateException
will be thrown if
getValue(String)
returns null
, otherwise the
${varname}
string will be left in the String
so that
multiple interpolators can be chainedMethod Detail |
---|
public final void setVariables(java.util.Map variables)
Map
of variables.
variables
- the Map
of variablesprotected final java.lang.String getValue(java.lang.String variableName)
getValue
in class VariableInterpolator
variableName
- the variable name
public static java.lang.String interpolate(java.lang.String string, java.util.Map variables)
String
with the arguments defined in the given Map
.
string
- a String
to interpolate intovariables
- the variables to substitute
String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |