Package com.indeed.proctor.common.el

Examples of com.indeed.proctor.common.el.MulticontextReadOnlyVariableMapper


        final int iterations = 100*1000;
        long elapsed = -System.currentTimeMillis();
        for (int i = 0; i < iterations; i++) {
            final Map<String, ValueExpression> localContext = ProctorUtils.convertToValueExpressionMap(expressionFactory, values);
            final VariableMapper variableMapper = new MulticontextReadOnlyVariableMapper(localContext);

            final ELContext elContext = new ELContext() {
                @Override
                public ELResolver getELResolver() {
                    return elResolver;
View Full Code Here


        if ("false".equalsIgnoreCase(bareRule)) {
            return false;
        }
        final Map<String, ValueExpression> localContext = ProctorUtils.convertToValueExpressionMap(expressionFactory, values);
        //noinspection unchecked
        final VariableMapper variableMapper = new MulticontextReadOnlyVariableMapper(testConstants, localContext);
        final ELContext elContext = createELContext(variableMapper);

        final ValueExpression ve = expressionFactory.createValueExpression(elContext, rule, Boolean.class);
        final Object result = ve.getValue(elContext);
        if (result instanceof Boolean) {
View Full Code Here

        ExpressionFactory expressionFactory = new ExpressionFactoryImpl();
        //verify test rule is valid EL
        final String testRule = testDefinition.getRule();

        final Map<String, ValueExpression> testConstants = ProctorUtils.convertToValueExpressionMap(expressionFactory, testDefinition.getConstants());
        final VariableMapper variableMapper = new MulticontextReadOnlyVariableMapper(testConstants, providedContext.getContext());
        final RuleEvaluator ruleEvaluator = new RuleEvaluator(expressionFactory, functionMapper, testDefinition.getConstants());
        final ELContext elContext = ruleEvaluator.createELContext(variableMapper);
        if(!isEmptyWhitespace(testRule)){
            try {
                final ValueExpression valueExpression = expressionFactory.createValueExpression(elContext, testRule, Boolean.class);
View Full Code Here

TOP

Related Classes of com.indeed.proctor.common.el.MulticontextReadOnlyVariableMapper

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.