List of usage examples for org.apache.commons.ognl Ognl parseExpression
public static Object parseExpression(String expression) throws OgnlException
Ognl
static methods. From source file:it.d4nguard.rgrpg.util.dynacast.DynaManipulator.java
/** * Evaluates the given OGNL expression tree to extract a value from the * given root object.//w w w .j a v a 2 s .c o m * * @see Ognl#parseExpression(String) * @param exp * the OGNL expression to be parsed * @param root * the root object for the OGNL expression * @return * @throws DynaManipulatorException */ public static Object getValue(String exp, Object root) throws DynaManipulatorException { assert root != null; Object ret = root; try { Object expression = Ognl.parseExpression(exp); Map<String, Object> context = Ognl.createDefaultContext(root, null, new AdapterTypeConverter()); ret = Ognl.getValue(expression, context, root); } catch (Exception e) { throw new DynaManipulatorException(e); } return ret; }
From source file:pl.nask.hsn2.expressions.OgnlExpression.java
public OgnlExpression(String expressionString) throws OgnlException { super(); expression = Ognl.parseExpression(expressionString); }