Class SpringCacheAnnotationParser
- java.lang.Object
- org.springframework.cache.annotation.SpringCacheAnnotationParser
- All Implemented Interfaces:
Serializable
,CacheAnnotationParser
public class SpringCacheAnnotationParser extends Object implements CacheAnnotationParser, Serializable
Strategy implementation for parsing Spring'sCaching
,Cacheable
,CacheEvict
, andCachePut
annotations.- Since:
- 3.1
- Author:
- Costin Leau, Juergen Hoeller, Chris Beams, Phillip Webb, Stephane Nicoll, Sam Brannen
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description SpringCacheAnnotationParser()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
int
hashCode()
Collection<CacheOperation>
parseCacheAnnotations(Class<?> type)
Parse the cache definition for the given class, based on an annotation type understood by this parser.Collection<CacheOperation>
parseCacheAnnotations(Method method)
Parse the cache definition for the given method, based on an annotation type understood by this parser.
Constructor Detail
SpringCacheAnnotationParser
public SpringCacheAnnotationParser()
Method Detail
parseCacheAnnotations
public Collection<CacheOperation> parseCacheAnnotations(Class<?> type)
Description copied from interface:CacheAnnotationParser
Parse the cache definition for the given class, based on an annotation type understood by this parser.This essentially parses a known cache annotation into Spring's metadata attribute class. Returns
null
if the class is not cacheable.- Specified by:
parseCacheAnnotations
in interfaceCacheAnnotationParser
- Parameters:
type
- the annotated class- Returns:
- the configured caching operation, or
null
if none found - See Also:
AnnotationCacheOperationSource.findCacheOperations(Class)
parseCacheAnnotations
public Collection<CacheOperation> parseCacheAnnotations(Method method)
Description copied from interface:CacheAnnotationParser
Parse the cache definition for the given method, based on an annotation type understood by this parser.This essentially parses a known cache annotation into Spring's metadata attribute class. Returns
null
if the method is not cacheable.- Specified by:
parseCacheAnnotations
in interfaceCacheAnnotationParser
- Parameters:
method
- the annotated method- Returns:
- the configured caching operation, or
null
if none found - See Also:
AnnotationCacheOperationSource.findCacheOperations(Method)