Example usage for org.springframework.expression EvaluationContext getMethodResolvers

List of usage examples for org.springframework.expression EvaluationContext getMethodResolvers

Introduction

In this page you can find the example usage for org.springframework.expression EvaluationContext getMethodResolvers.

Prototype

List<MethodResolver> getMethodResolvers();

Source Link

Document

Return a list of resolvers that will be asked in turn to locate a method.

Usage

From source file:net.abhinavsarkar.spelhelper.ImplicitPropertyAccessor.java

@Override
public boolean canRead(final EvaluationContext context, final Object target, final String name)
        throws AccessException {
    Assert.notNull(target, "target is null");
    String cacheKey = target.getClass().getName() + "." + name;
    if (CACHE.containsKey(cacheKey)) {
        return CACHE.get(cacheKey) != NULL_ME;
    }//from   w w  w  . j a v  a  2s . c o  m

    for (MethodResolver mr : context.getMethodResolvers()) {
        MethodExecutor me = mr.resolve(context, target, name, Collections.<TypeDescriptor>emptyList());
        if (me != null) {
            CACHE.putIfAbsent(cacheKey, me);
            return true;
        }
    }

    CACHE.putIfAbsent(cacheKey, NULL_ME);
    return false;
}