Example usage for org.apache.commons.ognl Ognl compileExpression

List of usage examples for org.apache.commons.ognl Ognl compileExpression

Introduction

In this page you can find the example usage for org.apache.commons.ognl Ognl compileExpression.

Prototype

public static Node compileExpression(OgnlContext context, Object root, String expression) throws Exception 

Source Link

Document

Parses and compiles the given expression using the org.apache.commons.ognl.enhance.OgnlExpressionCompiler returned from org.apache.commons.ognl.OgnlRuntime#getCompiler(OgnlContext) .

Usage

From source file:pl.nask.hsn2.ognl.OgnlPocTest.java

@Test
public void testCollectionSelectorCompiled() throws Exception {
    Node expr = Ognl.compileExpression(context, rootObject, "findByName('url').{^ #this.id == 1}");
    System.out.println(expr.getValue(context, rootObject));
}