Package org.apache.commons.jexl2

Examples of org.apache.commons.jexl2.JexlException$Property


    /**
     * {@inheritDoc }
     */
    public Object evaluate(Object context, String expression) {
        Expression jexlExpression = engine.createExpression(expression);
        JexlContext jexlContext = new ObjectContext(engine, context);
       
        return jexlExpression.evaluate(jexlContext);
    }
View Full Code Here


        log.debug("Evaluating expression: {}", expression);
       
        Expression expr = engine.createExpression(expression);

        JexlContext ctx = new MapContext(vars);

        Object result = expr.evaluate(ctx);
        log.debug("Result: {}", result);

        return result;
View Full Code Here

     * {@link FeatureState#DISABLED} otherwise.
     */
    @Override
    public FeatureState process(final ContextManager contextManager)
    {
        final JexlEngine jexlEngine = new JexlEngine();
        Expression jexlExpression;
        if (expression != null) {
            jexlExpression = jexlEngine.createExpression(expression);
        } else {
            jexlExpression = getOldExpression(jexlEngine);
        }
       
        final Map<String, Object> contextMap = contextManager.getContext(context);
View Full Code Here

    public JexlExpressionParser(final Map<String, Object> vars) {
        if (vars == null) {
            throw new IllegalArgumentException("vars");
        }
       
        engine = new JexlEngine();
        context = new MapContext(vars);
        variables = vars;
       
        log.trace("Using variables: {}", vars);
    }
View Full Code Here

        Map<String, Object> sysVars = new HashMap<String, Object>();
        for (Entry<Object,Object> entry : System.getProperties().entrySet()){
            sysVars.put((String)entry.getKey(), entry.getValue());
        }
       
        engine = new JexlEngine();
        context = new MapContext(sysVars);
        variables = sysVars;
       
        log.trace("Using variables: {}", sysVars);
    }
View Full Code Here

    public JexlConditionParser(final Map<String, Object> vars) {
        if (vars == null) {
            throw new IllegalArgumentException("vars");
        }
        this.vars = vars;
        engine = new JexlEngine();
    }
View Full Code Here

    public JexlConditionParser() {
        // Setup the default vars
        vars = new HashMap<String, Object>();
        ParserUtils.addDefaultVariables(vars);
       
        engine = new JexlEngine();
    }
View Full Code Here

            AbstractExecutor.Method it = getMethodExecutor(obj, "iterator", null);
            if (it != null && Iterator.class.isAssignableFrom(it.getReturnType())) {
                return (Iterator<Object>) it.execute(obj, null);
            }
        } catch(Exception xany) {
            throw new JexlException(info, "unable to generate iterator()", xany);
        }
        return null;
    }
View Full Code Here

            AbstractExecutor.Method it = getMethodExecutor(obj, "iterator", null);
            if (it != null && Iterator.class.isAssignableFrom(it.getReturnType())) {
                return (Iterator<Object>) it.execute(obj, null);
            }
        } catch (Exception xany) {
            throw new JexlException(info, "unable to generate iterator()", xany);
        }
        return null;
    }
View Full Code Here

        return null;
    }
   
    /** {@inheritDoc} */
    public String debugString() {
        JexlInfo info = getInfo();
        return info != null? info.debugString() : "";
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.jexl2.JexlException$Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.