|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.el.Expression javax.el.ValueExpression org.apache.shale.test.el.MockValueExpression
public class MockValueExpression
Mock implementation of ValueExpression
.
This implementation supports a limited subset of overall expression functionality:
Constructor Summary | |
---|---|
MockValueExpression(String expression,
Class expectedType)
Construct a new expression for the specified expression string. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockValueExpression(String expression, Class expectedType)
Construct a new expression for the specified expression string.
expression
- Expression string to be evaluatedexpectedType
- Expected type of the resultMethod Detail |
---|
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 set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |