@Nullable private MethodExecutor getCachedExecutor(EvaluationContext evaluationContext, Object value, @Nullable TypeDescriptor target, List<TypeDescriptor> argumentTypes) { List<MethodResolver> methodResolvers = evaluationContext.getMethodResolvers(); if (methodResolvers.size() != 1 || !(methodResolvers.get(0) instanceof ReflectiveMethodResolver)) { // Not a default ReflectiveMethodResolver - don't know whether caching is valid return null; } CachedMethodExecutor executorToCheck = this.cachedExecutor; if (executorToCheck != null && executorToCheck.isSuitable(value, target, argumentTypes)) { return executorToCheck.get(); } this.cachedExecutor = null; return null; }
@Nullable private MethodExecutor getCachedExecutor(EvaluationContext evaluationContext, Object value, @Nullable TypeDescriptor target, List<TypeDescriptor> argumentTypes) { List<MethodResolver> methodResolvers = evaluationContext.getMethodResolvers(); if (methodResolvers.size() != 1 || !(methodResolvers.get(0) instanceof ReflectiveMethodResolver)) { // Not a default ReflectiveMethodResolver - don't know whether caching is valid return null; } CachedMethodExecutor executorToCheck = this.cachedExecutor; if (executorToCheck != null && executorToCheck.isSuitable(value, target, argumentTypes)) { return executorToCheck.get(); } this.cachedExecutor = null; return null; }
private MethodExecutor findAccessorForMethod(List<TypeDescriptor> argumentTypes, Object targetObject, EvaluationContext evaluationContext) throws SpelEvaluationException { AccessException accessException = null; List<MethodResolver> methodResolvers = evaluationContext.getMethodResolvers(); for (MethodResolver methodResolver : methodResolvers) { try { MethodExecutor methodExecutor = methodResolver.resolve( evaluationContext, targetObject, this.name, argumentTypes); if (methodExecutor != null) { return methodExecutor; } } catch (AccessException ex) { accessException = ex; break; } } String method = FormatHelper.formatMethodForMessage(this.name, argumentTypes); String className = FormatHelper.formatClassNameForMessage( targetObject instanceof Class ? ((Class<?>) targetObject) : targetObject.getClass()); if (accessException != null) { throw new SpelEvaluationException( getStartPosition(), accessException, SpelMessage.PROBLEM_LOCATING_METHOD, method, className); } else { throw new SpelEvaluationException(getStartPosition(), SpelMessage.METHOD_NOT_FOUND, method, className); } }
private MethodExecutor findAccessorForMethod(List<TypeDescriptor> argumentTypes, Object targetObject, EvaluationContext evaluationContext) throws SpelEvaluationException { AccessException accessException = null; List<MethodResolver> methodResolvers = evaluationContext.getMethodResolvers(); for (MethodResolver methodResolver : methodResolvers) { try { MethodExecutor methodExecutor = methodResolver.resolve( evaluationContext, targetObject, this.name, argumentTypes); if (methodExecutor != null) { return methodExecutor; } } catch (AccessException ex) { accessException = ex; break; } } String method = FormatHelper.formatMethodForMessage(this.name, argumentTypes); String className = FormatHelper.formatClassNameForMessage( targetObject instanceof Class ? ((Class<?>) targetObject) : targetObject.getClass()); if (accessException != null) { throw new SpelEvaluationException( getStartPosition(), accessException, SpelMessage.PROBLEM_LOCATING_METHOD, method, className); } else { throw new SpelEvaluationException(getStartPosition(), SpelMessage.METHOD_NOT_FOUND, method, className); } }
public List<MethodResolver> getMethodResolvers() { return this.delegate.getMethodResolvers(); }
public List<MethodResolver> getMethodResolvers() { return this.delegate.getMethodResolvers(); }
public List<MethodResolver> getMethodResolvers() { return this.delegate.getMethodResolvers(); }
public List<MethodResolver> getMethodResolvers() { return this.delegate.getMethodResolvers(); }
@Override public List<MethodResolver> getMethodResolvers() { return this.delegate.getMethodResolvers(); }
public List<MethodResolver> getMethodResolvers() { return delegate.getMethodResolvers(); }
public List<MethodResolver> getMethodResolvers() { return delegate.getMethodResolvers(); }
public List<MethodResolver> getMethodResolvers() { return this.delegate.getMethodResolvers(); }
@Nullable private MethodExecutor getCachedExecutor(EvaluationContext evaluationContext, Object value, @Nullable TypeDescriptor target, List<TypeDescriptor> argumentTypes) { List<MethodResolver> methodResolvers = evaluationContext.getMethodResolvers(); if (methodResolvers.size() != 1 || !(methodResolvers.get(0) instanceof ReflectiveMethodResolver)) { // Not a default ReflectiveMethodResolver - don't know whether caching is valid return null; } CachedMethodExecutor executorToCheck = this.cachedExecutor; if (executorToCheck != null && executorToCheck.isSuitable(value, target, argumentTypes)) { return executorToCheck.get(); } this.cachedExecutor = null; return null; }
private MethodExecutor findAccessorForMethod(List<TypeDescriptor> argumentTypes, Object targetObject, EvaluationContext evaluationContext) throws SpelEvaluationException { AccessException accessException = null; List<MethodResolver> methodResolvers = evaluationContext.getMethodResolvers(); for (MethodResolver methodResolver : methodResolvers) { try { MethodExecutor methodExecutor = methodResolver.resolve( evaluationContext, targetObject, this.name, argumentTypes); if (methodExecutor != null) { return methodExecutor; } } catch (AccessException ex) { accessException = ex; break; } } String method = FormatHelper.formatMethodForMessage(this.name, argumentTypes); String className = FormatHelper.formatClassNameForMessage( targetObject instanceof Class ? ((Class<?>) targetObject) : targetObject.getClass()); if (accessException != null) { throw new SpelEvaluationException( getStartPosition(), accessException, SpelMessage.PROBLEM_LOCATING_METHOD, method, className); } else { throw new SpelEvaluationException(getStartPosition(), SpelMessage.METHOD_NOT_FOUND, method, className); } }