|
||||||||||
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.PropertyVariableInterpolator
public class PropertyVariableInterpolator
Interpolates values into String
s that are produced by interpreting property
expressions against a beans model.
The interpolate(String string, Object model)
method takes a string such as "
My name is ${name}
" and a beans model such as a Person
, and reflects on
the object using any property expressions found inside ${}
markers in the
String
. In this case, if the Person
model has a getName()
method. The results of calling that method would be substituted for ${name}
. If
getName()
returned "Jonathan"
, then interpolate()
would
return "My name is Jonathan"
.
"$" is the escape char. Thus "$${text}" can be used to escape it (ignore interpretation). If '$3.24' is needed then '$$${amount}' should be used. The first $ sign escapes the second, and the third is used to interpolate the variable.
Field Summary |
---|
Fields inherited from class org.apache.wicket.util.string.interpolator.VariableInterpolator |
---|
string |
Constructor Summary | |
---|---|
PropertyVariableInterpolator(String string,
Object model)
Constructor. |
Method Summary | |
---|---|
protected String |
getValue(String variableName)
Retrieves a value for a variable name during interpolation. |
static String |
interpolate(String string,
Object object)
Deprecated. |
protected String |
toString(Object value)
Convert the given value to a string for interpolation. |
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 PropertyVariableInterpolator(String string, Object model)
string
- a String
to interpolate intomodel
- the model to apply property expressions toMethod Detail |
---|
@Deprecated public static String interpolate(String string, Object object)
String
, substituting values for property expressions.
string
- a String
containing property expressions like ${xyz}
object
- the Object
to reflect on
String
protected String getValue(String variableName)
getValue
in class VariableInterpolator
variableName
- the variable name
protected String toString(Object value)
This default implementation delegates to Strings.toString(Object)
.
value
- the value, never null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |