Polishing
This commit is contained in:
@@ -24,41 +24,40 @@ import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Strategy interface for parsing known caching annotation types.
|
||||
* {@link AnnotationCacheOperationSource} delegates to such
|
||||
* parsers for supporting specific annotation types such as Spring's own
|
||||
* {@link Cacheable}, {@link CachePut} or {@link CacheEvict}.
|
||||
* {@link AnnotationCacheOperationSource} delegates to such parsers
|
||||
* for supporting specific annotation types such as Spring's own
|
||||
* {@link Cacheable}, {@link CachePut} and{@link CacheEvict}.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see AnnotationCacheOperationSource
|
||||
* @see SpringCacheAnnotationParser
|
||||
*/
|
||||
public interface CacheAnnotationParser {
|
||||
|
||||
/**
|
||||
* Parses the cache definition for the given class,
|
||||
* based on a known annotation type.
|
||||
* <p>This essentially parses a known cache annotation into Spring's
|
||||
* metadata attribute class. Returns {@code null} if the class
|
||||
* is not cacheable.
|
||||
* Parse the cache definition for the given class,
|
||||
* based on an annotation type understood by this parser.
|
||||
* <p>This essentially parses a known cache annotation into Spring's metadata
|
||||
* attribute class. Returns {@code null} if the class is not cacheable.
|
||||
* @param type the annotated class
|
||||
* @return the configured caching operation,
|
||||
* or {@code null} if none was found
|
||||
* @return the configured caching operation, or {@code null} if none found
|
||||
* @see AnnotationCacheOperationSource#findCacheOperations(Class)
|
||||
*/
|
||||
@Nullable
|
||||
Collection<CacheOperation> parseCacheAnnotations(Class<?> type);
|
||||
|
||||
/**
|
||||
* Parses the cache definition for the given method,
|
||||
* based on a known annotation type.
|
||||
* <p>This essentially parses a known cache annotation into Spring's
|
||||
* metadata attribute class. Returns {@code null} if the method
|
||||
* is not cacheable.
|
||||
* Parse the cache definition for the given method,
|
||||
* based on an annotation type understood by this parser.
|
||||
* <p>This essentially parses a known cache annotation into Spring's metadata
|
||||
* attribute class. Returns {@code null} if the method is not cacheable.
|
||||
* @param method the annotated method
|
||||
* @return the configured caching operation,
|
||||
* or {@code null} if none was found
|
||||
* @return the configured caching operation, or {@code null} if none found
|
||||
* @see AnnotationCacheOperationSource#findCacheOperations(Method)
|
||||
*/
|
||||
@Nullable
|
||||
Collection<CacheOperation> parseCacheAnnotations(Method method);
|
||||
|
||||
}
|
||||
|
||||
@@ -163,25 +163,23 @@ public abstract class AbstractFallbackCacheOperationSource implements CacheOpera
|
||||
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute
|
||||
* for the given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all caching attribute associated with this method
|
||||
* (or {@code null} if none)
|
||||
*/
|
||||
@Nullable
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Method method);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute
|
||||
* for the given class, if any.
|
||||
* Subclasses need to implement this to return the caching attribute for the
|
||||
* given class, if any.
|
||||
* @param clazz the class to retrieve the attribute for
|
||||
* @return all caching attribute associated with this class
|
||||
* (or {@code null} if none)
|
||||
* @return all caching attribute associated with this class, or {@code null} if none
|
||||
*/
|
||||
@Nullable
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Class<?> clazz);
|
||||
|
||||
/**
|
||||
* Subclasses need to implement this to return the caching attribute for the
|
||||
* given method, if any.
|
||||
* @param method the method to retrieve the attribute for
|
||||
* @return all caching attribute associated with this method, or {@code null} if none
|
||||
*/
|
||||
@Nullable
|
||||
protected abstract Collection<CacheOperation> findCacheOperations(Method method);
|
||||
|
||||
/**
|
||||
* Should only public methods be allowed to have caching semantics?
|
||||
* <p>The default implementation returns {@code false}.
|
||||
|
||||
Reference in New Issue
Block a user