@Test public void exchangeRequestHeader() throws ExpressionException { Exchange exchange = new Exchange(); exchange.request = new Request(); exchange.request.headers.putSingle("Host", "www.example.com"); Expression expr = new Expression("${exchange.request.headers['Host'][0]}"); String host = expr.eval(exchange, String.class); assertThat(host).isEqualTo("www.example.com"); }
public Object eval(Object scope) { try { return valueExpression.getValue(new XLContext(scope)); } catch (ELException ele) { return null; } }
Expression { public Object eval(Object scope) { try { return valueExpression.getValue(new XLContext(scope)); } catch (ELException ele) { return null; } } }
Expression { public Object eval(Object scope) { try { return valueExpression.getValue(new XLContext(scope)); } catch (ELException ele) { return null; } } Expression(String expression); }
Expression { public Object eval(Object scope) { try { return valueExpression.getValue(new XLContext(scope)); } catch (ELException ele) { return null; } } Expression(String expression); Object eval(Object scope); @SuppressWarnings("unchecked") T eval(Object scope, Class<T> type); void set(Object scope, Object value); }
Expression { public Object eval(Object scope) { try { return valueExpression.getValue(new XLContext(scope)); } catch (ELException ele) { return null; } } Expression(String expression); Object eval(Object scope); @SuppressWarnings("unchecked") T eval(Object scope, Class<T> type); void set(Object scope, Object value);  }