public class LiteralExpression extends Object implements Expression
Constructor and Description |
---|
LiteralExpression(String literal)
Create a literal expression for the given literal.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getExpressionString()
Returns the original string used to create this expression, unmodified.
|
Object |
getValue(Object context)
Evaluate this expression in the provided context and return the result of evaluation.
|
Class |
getValueType(Object context)
Returns the most general type that can be passed to the
Expression.setValue(Object, Object) method for the given
context. |
int |
hashCode() |
void |
setValue(Object context,
Object value)
Set this expression in the provided context to the value provided.
|
String |
toString() |
public LiteralExpression(String literal)
literal
- the literalpublic Object getValue(Object context) throws EvaluationException
Expression
getValue
in interface Expression
context
- the context to evaluate this expression inEvaluationException
- an exception occurred during expression evaluationpublic void setValue(Object context, Object value) throws EvaluationException
Expression
setValue
in interface Expression
context
- the context on which the new value should be setvalue
- the new value to setEvaluationException
- an exception occurred during expression evaluationpublic Class getValueType(Object context)
Expression
Expression.setValue(Object, Object)
method for the given
context.getValueType
in interface Expression
context
- the context to evaluatenull
if the type
information cannot be determinedpublic String getExpressionString()
Expression
getExpressionString
in interface Expression