public class MockVariableValueExpression
extends javax.el.ValueExpression
Mock implementation of ValueExpression
that wraps a variable.
Constructor and Description |
---|
MockVariableValueExpression(Object instance,
Class expectedType)
Construct a new expression for the specified instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Return
true if this expression is equal to the
specified expression. |
Class |
getExpectedType()
Return the type that the result of this expression will
be coerced to.
|
String |
getExpressionString()
Return the original String used to create this expression,
unmodified.
|
Class |
getType(javax.el.ELContext context)
Evaluate this expression relative to the specified context,
and return the most general type that is acceptable for the
value passed in a
setValue() call. |
Object |
getValue(javax.el.ELContext context)
Evaluate this expression relative to the specified context,
and return the result.
|
int |
hashCode()
Return the hash code for this expression.
|
boolean |
isLiteralText()
Return
true if the expression string for this expression
contains only literal text. |
boolean |
isReadOnly(javax.el.ELContext context)
Evaluate this expression relative to the specified context,
and return
true if a call to setValue()
will always fail. |
void |
setValue(javax.el.ELContext context,
Object value)
Evaluate this expression relative to the specified context,
and set the result to the specified value.
|
public boolean equals(Object obj)
Return true
if this expression is equal to the
specified expression.
equals
in class javax.el.Expression
obj
- Object to be comparedpublic String getExpressionString()
Return the original String used to create this expression, unmodified.
getExpressionString
in class javax.el.Expression
public int hashCode()
Return the hash code for this expression.
hashCode
in class javax.el.Expression
public boolean isLiteralText()
Return true
if the expression string for this expression
contains only literal text.
isLiteralText
in class javax.el.Expression
public Class getExpectedType()
Return the type that the result of this expression will be coerced to.
getExpectedType
in class javax.el.ValueExpression
public Class getType(javax.el.ELContext context)
Evaluate this expression relative to the specified context,
and return the most general type that is acceptable for the
value passed in a setValue()
call.
getType
in class javax.el.ValueExpression
context
- ELContext for this evaluationpublic Object getValue(javax.el.ELContext context)
Evaluate this expression relative to the specified context, and return the result.
getValue
in class javax.el.ValueExpression
context
- ELContext for this evaluationpublic boolean isReadOnly(javax.el.ELContext context)
Evaluate this expression relative to the specified context,
and return true
if a call to setValue()
will always fail.
isReadOnly
in class javax.el.ValueExpression
context
- ELContext for this evaluationpublic void setValue(javax.el.ELContext context, Object value)
Evaluate this expression relative to the specified context, and set the result to the specified value.
setValue
in class javax.el.ValueExpression
context
- ELContext for this evaluationvalue
- Value to which the result should be setCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.