Examples of StandardEvaluationContext


Examples of org.springframework.expression.spel.support.StandardEvaluationContext

    }

    //this method was roughly based on the implementation of:
    //org.springframework.cache.interceptor.LazyParamAwareEvaluationContext#loadArgsAsVariables(...)
    private EvaluationContext getEvaluationContext(Class<?> targetClass, Method method, Object[] args) {
        EvaluationContext context = new StandardEvaluationContext();
        if (ArrayUtils.isEmpty(args)) {
            return context;
        }

        Method targetMethod = getTargetMethod(targetClass, method);
        for (int i = 0; i < args.length; i++) {
            context.setVariable("p" + i, args[i]);
        }

        String[] parameterNames = paramNameDiscoverer.getParameterNames(targetMethod);
        if (parameterNames != null) {
            for (int i = 0; i < parameterNames.length; i++) {
                context.setVariable(parameterNames[i], args[i]);
            }
        }

        return context;
    }
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.