org.apache.camel.language.bean
Class BeanExpression

java.lang.Object
  extended by org.apache.camel.language.bean.BeanExpression
All Implemented Interfaces:
Expression, Predicate

public class BeanExpression
extends Object
implements Expression, Predicate

Evaluates an expression using a bean method invocation

Version:
$Revision: 769448 $

Constructor Summary
BeanExpression(Object bean, String method)
           
BeanExpression(String beanName, String method)
           
 
Method Summary
protected  String assertionFailureMessage(Exchange exchange)
           
 void assertMatches(String text, Exchange exchange)
           
 Object evaluate(Exchange exchange)
           
<T> T
evaluate(Exchange exchange, Class<T> type)
          Returns the value of the expression on the given exchange
 boolean matches(Exchange exchange)
          Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanExpression

public BeanExpression(Object bean,
                      String method)

BeanExpression

public BeanExpression(String beanName,
                      String method)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

assertionFailureMessage

protected String assertionFailureMessage(Exchange exchange)

evaluate

public Object evaluate(Exchange exchange)

evaluate

public <T> T evaluate(Exchange exchange,
                      Class<T> type)
Description copied from interface: Expression
Returns the value of the expression on the given exchange

Specified by:
evaluate in interface Expression
Parameters:
exchange - the message exchange on which to evaluate the expression
type - the expected type of the evaluation result
Returns:
the value of the expression

matches

public boolean matches(Exchange exchange)
Description copied from interface: Predicate
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate

Specified by:
matches in interface Predicate
Parameters:
exchange - the message exchange
Returns:
true if the predicate matches

assertMatches

public void assertMatches(String text,
                          Exchange exchange)
                   throws AssertionError
Throws:
AssertionError


Apache CAMEL