org.apache.myfaces.test.el
Class MockCompositeValueExpression

java.lang.Object
  extended by javax.el.Expression
      extended by javax.el.ValueExpression
          extended by org.apache.myfaces.test.el.MockValueExpression
              extended by org.apache.myfaces.test.el.MockCompositeValueExpression
All Implemented Interfaces:
Serializable

public class MockCompositeValueExpression
extends MockValueExpression

A value expression implementation that is capable of handling composite expressions. It handles composites expressions but creating a list of 'simple' expressions which are 'pure', only literal text or only references like #{}

Since:
1.0.0
Author:
Rudy De Busscher
See Also:
Serialized Form

Constructor Summary
MockCompositeValueExpression(String expression, Class expectedType)
           
 
Method Summary
 String getExpressionString()
          Return the original String used to create this expression, unmodified.
static int getStartPositionOfReference(StringBuilder expressionPart)
           
 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.
 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 org.apache.myfaces.test.el.MockValueExpression
equals, getExpectedType, hashCode, isLiteralText
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockCompositeValueExpression

public MockCompositeValueExpression(String expression,
                                    Class expectedType)
Method Detail

getType

public Class getType(javax.el.ELContext context)
Description copied from class: MockValueExpression

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.

Overrides:
getType in class MockValueExpression
Parameters:
context - ELContext for this evaluation

getValue

public Object getValue(javax.el.ELContext context)
Description copied from class: MockValueExpression

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

Overrides:
getValue in class MockValueExpression
Parameters:
context - ELContext for this evaluation

setValue

public void setValue(javax.el.ELContext context,
                     Object value)
Description copied from class: MockValueExpression

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

Overrides:
setValue in class MockValueExpression
Parameters:
context - ELContext for this evaluation
value - Value to which the result should be set

getExpressionString

public String getExpressionString()
Description copied from class: MockValueExpression

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

Overrides:
getExpressionString in class MockValueExpression

isReadOnly

public boolean isReadOnly(javax.el.ELContext context)
Description copied from class: MockValueExpression

Evaluate this expression relative to the specified context, and return true if a call to setValue() will always fail.

Overrides:
isReadOnly in class MockValueExpression
Parameters:
context - ELContext for this evaluation

getStartPositionOfReference

public static int getStartPositionOfReference(StringBuilder expressionPart)


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.