List of usage examples for org.springframework.data.util AnnotationDetectionMethodCallback hasFoundAnnotation
public boolean hasFoundAnnotation()
From source file:org.springframework.data.rest.core.projection.ProxyProjectionFactory.java
/** * Inspects the given target type for methods with {@link Value} annotations and caches the result. Will create a * {@link SpelEvaluatingMethodInterceptor} if an annotation was found or return the delegate as is if not. * /*w w w . j a va 2 s . co m*/ * @param source The backing source object. * @param projectionType the proxy target type. * @param delegate the root {@link MethodInterceptor}. * @return */ private MethodInterceptor getSpelMethodInterceptorIfNecessary(Object source, Class<?> projectionType, MethodInterceptor delegate) { if (!typeCache.containsKey(projectionType)) { AnnotationDetectionMethodCallback<Value> callback = new AnnotationDetectionMethodCallback<Value>( Value.class); ReflectionUtils.doWithMethods(projectionType, callback); typeCache.put(projectionType, callback.hasFoundAnnotation()); } return typeCache.get(projectionType) ? new SpelEvaluatingMethodInterceptor(delegate, source, beanFactory) : delegate; }