Example usage for org.springframework.expression.spel.support StandardEvaluationContext addMethodResolver

List of usage examples for org.springframework.expression.spel.support StandardEvaluationContext addMethodResolver

Introduction

In this page you can find the example usage for org.springframework.expression.spel.support StandardEvaluationContext addMethodResolver.

Prototype

public void addMethodResolver(MethodResolver resolver) 

Source Link

Usage

From source file:com.creactiviti.piper.core.task.SpelTaskEvaluator.java

private StandardEvaluationContext createEvaluationContext(Context aContext) {
    StandardEvaluationContext context = new StandardEvaluationContext(aContext);
    context.addPropertyAccessor(new MapPropertyAccessor());
    context.addMethodResolver(methodResolver());
    return context;
}

From source file:com.googlecode.ehcache.annotations.key.SpELCacheKeyGenerator.java

/**
 * Get the {@link EvaluationContext} to use to evaluate the configured {@link Expression}
 *///from   w w w .  j  av a  2  s .  c  o m
protected EvaluationContext getEvaluationContext(MethodInvocation methodInvocation, Object... args) {
    final StandardEvaluationContext evaluationContext = new StandardEvaluationContext();
    evaluationContext.setBeanResolver(new BeanFactoryResolver(this.beanFactory));
    evaluationContext.setVariable("invocation", methodInvocation);
    evaluationContext.setVariable("args", args);
    evaluationContext.setVariable("key", keyCallbackObject);
    evaluationContext.addMethodResolver(this.methodResolver);
    return evaluationContext;
}