|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.clearsilver.jsilver.values.Value
com.google.clearsilver.jsilver.values.VariableValue
public class VariableValue
A value linked to a variable reference. When this value is evaluated in an expression a Data
object will be fetched from the provided DataContext and and its value returned or null
if there is no Data object associated with the given name.
Value
,
Data
Constructor Summary | |
---|---|
VariableValue(String name,
DataContext dataContext)
|
Method Summary | |
---|---|
boolean |
asBoolean()
Fetch value as boolean. |
int |
asNumber()
Fetch value as number. |
String |
asString()
Fetch value as string. |
boolean |
exists()
Whether this value exists. |
EscapeMode |
getEscapeMode()
Indicates the escaping that was applied to the expression represented by this value. |
String |
getName()
|
Data |
getReference()
|
boolean |
isEmpty()
|
String |
toString()
|
protected String |
value()
|
Methods inherited from class com.google.clearsilver.jsilver.values.Value |
---|
equals, hashCode, isPartiallyEscaped, literalConstant, literalConstant, literalConstant, literalValue, literalValue, literalValue, variableValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VariableValue(String name, DataContext dataContext)
Method Detail |
---|
public String getName()
public Data getReference()
protected String value()
public boolean exists()
Value
exists
in class Value
public String toString()
toString
in class Value
public EscapeMode getEscapeMode()
Value
May be checked by the JSilver code before applying autoescaping. It differs from isEscaped
, which is true iff any part of the variable expression contains an escaping
function, even if the entire expression has not been escaped. Both methods are required,
isEscaped
to determine whether <?cs escape > commands should be applied, and
getEscapeMode
for autoescaping. This is done to maintain compatibility with
ClearSilver's behaviour.
getEscapeMode
in class Value
EscapeMode.ESCAPE_IS_CONSTANT
if the value represents a constant string
literal. Or the appropriate EscapeMode
if the value is the output of an
escaping function.EscapeMode
public boolean asBoolean()
Value
asBoolean
in class Value
public String asString()
Value
asString
in class Value
public int asNumber()
Value
asNumber
in class Value
public boolean isEmpty()
isEmpty
in class Value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |