*
* @param exp the expression to evaluate and invoke the method on its result
* @param ognl methods to invoke on the evaluated expression in a simple OGNL syntax
*/
public static Expression ognlExpression(final Expression exp, final String ognl) {
return new ExpressionAdapter() {
public Object evaluate(Exchange exchange) {
Object value = exp.evaluate(exchange, Object.class);
if (value == null) {
return null;
}