Package org.mvel2

Examples of org.mvel2.ParserContext.addVariable()


            ParserConfiguration config = new ParserConfiguration();
            config.setClassLoader(cl);
            ParserContext ctx = new ParserContext(config);
            if (parameters != null) {
                for (Map.Entry<String, Object> entry : parameters.entrySet()) {
                    ctx.addVariable(entry.getKey(), entry.getValue().getClass());
                }
            }

            Object compiledExpression = MVEL.compileExpression(type, ctx);
            return (T)MVELSafeHelper.getEvaluator().executeExpression( compiledExpression, parameters );
View Full Code Here


            ParserConfiguration config = new ParserConfiguration();
            config.setClassLoader(cl);
            ParserContext ctx = new ParserContext(config);
            if (parameters != null) {
                for (Map.Entry<String, Object> entry : parameters.entrySet()) {
                    ctx.addVariable(entry.getKey(), entry.getValue().getClass());
                }
            }

            Object compiledExpression = MVEL.compileExpression(type, ctx);
            return (T)MVELSafeHelper.getEvaluator().executeExpression( compiledExpression, parameters );
View Full Code Here

    /**
     * To prevent the function parameters from being counted as
     * external inputs, we must add them explicitly here.
     */
    for (String s : this.parameters) {
      ctx.addVariable(s, Object.class);
      ctx.addIndexedInput(s);
    }

    /**
     * Compile the expression so we can determine the input-output delta.
View Full Code Here

    /**
     * To prevent the function parameters from being counted as
     * external inputs, we must add them explicitly here.
     */
    for (String s : this.parameters) {
      ctx.addVariable(s, Object.class);
      ctx.addIndexedInput(s);
    }

    /**
     * Compile the expression so we can determine the input-output delta.
View Full Code Here

            ParserConfiguration config = new ParserConfiguration();
            config.setClassLoader(cl);
            ParserContext ctx = new ParserContext(config);
            if (parameters != null) {
                for (Map.Entry<String, Object> entry : parameters.entrySet()) {
                    ctx.addVariable(entry.getKey(), entry.getValue().getClass());
                }
            }

            Object compiledExpression = MVEL.compileExpression(type, ctx);
            return (T)MVELSafeHelper.getEvaluator().executeExpression( compiledExpression, parameters );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.