Example usage for org.apache.commons.ognl OgnlContext OgnlContext

List of usage examples for org.apache.commons.ognl OgnlContext OgnlContext

Introduction

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

Prototype

public OgnlContext() 

Source Link

Document

Constructs a new OgnlContext with the default class resolver, type converter and member access.

Usage

From source file:interactivespaces.bridge.message.ros.OgnlRosMessageBridgeSpecification.java

/**
 * Create a new context for the expression evaluation.
 *
 * @return
 */
protected OgnlContext newContext() {
    return new OgnlContext();
}

From source file:io.smartspaces.messaging.bridge.ros.OgnlRosMessageBridgeSpecification.java

/**
 * Create a new context for the expression evaluation.
 *
 * @return the context
 */
private OgnlContext newContext() {
    return new OgnlContext();
}

From source file:pl.nask.hsn2.expressions.OgnlExpressionEvaluation.java

public Object eval() throws EvaluationException {
    if (expression == null)
        return null;
    try {/*  w w w.j  a  v a2  s .c om*/
        LOG.debug("About to evaluate expression. Object Id={}, expression : {}", objectDataId, expression);
        OgnlContext ctx = new OgnlContext();
        CachingObjectStoreImpl cachingObjectStore = new CachingObjectStoreImpl(connector, jobId);
        OSObject root = new OSObject(cachingObjectStore, objectDataId);
        ctx.put("current", root);
        OgnlExpression expr = new OgnlExpression(expression);

        Object value = expr.evaluate(ctx, root);
        LOG.debug("Expression evaluated to value = {} ", value);

        return value;
    } catch (OgnlException e) {
        throw new EvaluationException("Error evaluating expression", e);
    }
}

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

@BeforeMethod
public void beforeMethod() {
    context = new OgnlContext();
    rootObject(1);
}

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

@BeforeMethod
public void beforeMethod() {
    expr = null;/*w ww.  j av  a 2s.  c  om*/
    rootObject = new OSObject(os, 1);
    context = new OgnlContext();
    context.put("current", rootObject);
}

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

@BeforeMethod
public void beforeMethod() {
    os = new MockedObjectStore();
    context = new OgnlContext();
    rootObject(2);
}