org.apache.shale.test.el
Class MockVariableValueExpression

java.lang.Object
  extended by javax.el.Expression
      extended by javax.el.ValueExpression
          extended by org.apache.shale.test.el.MockVariableValueExpression
All Implemented Interfaces:
Serializable

public class MockVariableValueExpression
extends javax.el.ValueExpression

Mock implementation of ValueExpression that wraps a variable.

See Also:
Serialized Form

Constructor Summary
MockVariableValueExpression(Object instance, Class expectedType)
          Construct a new expression for the specified instance.
 
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

MockVariableValueExpression

public MockVariableValueExpression(Object instance,
                                   Class expectedType)

Construct a new expression for the specified instance.

Parameters:
instance - Variable instance to be wrapped
expectedType - Expected type of the result
Method Detail

equals

public boolean equals(Object obj)

Return true if this expression is equal to the specified expression.

Specified by:
equals in class javax.el.Expression
Parameters:
obj - Object to be compared

getExpressionString

public String getExpressionString()

Return the original String used to create this expression, unmodified.

Specified by:
getExpressionString in class javax.el.Expression

hashCode

public int hashCode()

Return the hash code for this expression.

Specified by:
hashCode in class javax.el.Expression

isLiteralText

public boolean isLiteralText()

Return true if the expression string for this expression contains only literal text.

Specified by:
isLiteralText in class javax.el.Expression

getExpectedType

public Class getExpectedType()

Return the type that the result of this expression will be coerced to.

Specified by:
getExpectedType in class javax.el.ValueExpression

getType

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.

Specified by:
getType in class javax.el.ValueExpression
Parameters:
context - ELContext for this evaluation

getValue

public Object getValue(javax.el.ELContext context)

Evaluate this expression relative to the specified context, and return the result.

Specified by:
getValue in class javax.el.ValueExpression
Parameters:
context - ELContext for this evaluation

isReadOnly

public 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.

Specified by:
isReadOnly in class javax.el.ValueExpression
Parameters:
context - ELContext for this evaluation

setValue

public void setValue(javax.el.ELContext context,
                     Object value)

Evaluate this expression relative to the specified context, and set the result to the specified value.

Specified by:
setValue in class javax.el.ValueExpression
Parameters:
context - ELContext for this evaluation
value - Value to which the result should be set


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.