public class SpringCacheAnnotationParser extends java.lang.Object implements CacheAnnotationParser, java.io.Serializable
Caching
, Cacheable
,
CacheEvict
, and CachePut
annotations.Modifier and Type | Class and Description |
---|---|
(package private) static class |
SpringCacheAnnotationParser.DefaultCacheConfig
Provides default settings for a given set of cache operations.
|
Constructor and Description |
---|
SpringCacheAnnotationParser() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
(package private) SpringCacheAnnotationParser.DefaultCacheConfig |
getDefaultCacheConfig(java.lang.Class<?> target)
Provides the
SpringCacheAnnotationParser.DefaultCacheConfig instance for the specified Class . |
int |
hashCode() |
private <T extends java.lang.annotation.Annotation> |
lazyInit(java.util.Collection<CacheOperation> ops) |
(package private) CacheableOperation |
parseCacheableAnnotation(java.lang.reflect.AnnotatedElement ae,
SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig,
Cacheable cacheable) |
java.util.Collection<CacheOperation> |
parseCacheAnnotations(java.lang.Class<?> type)
Parses the cache definition for the given class,
based on a known annotation type.
|
java.util.Collection<CacheOperation> |
parseCacheAnnotations(java.lang.reflect.Method method)
Parses the cache definition for the given method,
based on a known annotation type.
|
protected java.util.Collection<CacheOperation> |
parseCacheAnnotations(SpringCacheAnnotationParser.DefaultCacheConfig cachingConfig,
java.lang.reflect.AnnotatedElement ae) |
(package private) java.util.Collection<CacheOperation> |
parseCachingAnnotation(java.lang.reflect.AnnotatedElement ae,
SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig,
Caching caching) |
(package private) CacheEvictOperation |
parseEvictAnnotation(java.lang.reflect.AnnotatedElement ae,
SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig,
CacheEvict cacheEvict) |
(package private) CacheOperation |
parsePutAnnotation(java.lang.reflect.AnnotatedElement ae,
SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig,
CachePut cachePut) |
private void |
validateCacheOperation(java.lang.reflect.AnnotatedElement ae,
CacheOperation operation)
Validates the specified
CacheOperation . |
public java.util.Collection<CacheOperation> parseCacheAnnotations(java.lang.Class<?> type)
CacheAnnotationParser
This essentially parses a known cache annotation into Spring's
metadata attribute class. Returns null
if the class
is not cacheable.
parseCacheAnnotations
in interface CacheAnnotationParser
type
- the annotated classnull
if none was foundAnnotationCacheOperationSource.findCacheOperations(Class)
public java.util.Collection<CacheOperation> parseCacheAnnotations(java.lang.reflect.Method method)
CacheAnnotationParser
This essentially parses a known cache annotation into Spring's
metadata attribute class. Returns null
if the method
is not cacheable.
parseCacheAnnotations
in interface CacheAnnotationParser
method
- the annotated methodnull
if none was foundAnnotationCacheOperationSource.findCacheOperations(Method)
protected java.util.Collection<CacheOperation> parseCacheAnnotations(SpringCacheAnnotationParser.DefaultCacheConfig cachingConfig, java.lang.reflect.AnnotatedElement ae)
private <T extends java.lang.annotation.Annotation> java.util.Collection<CacheOperation> lazyInit(java.util.Collection<CacheOperation> ops)
CacheableOperation parseCacheableAnnotation(java.lang.reflect.AnnotatedElement ae, SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig, Cacheable cacheable)
CacheEvictOperation parseEvictAnnotation(java.lang.reflect.AnnotatedElement ae, SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig, CacheEvict cacheEvict)
CacheOperation parsePutAnnotation(java.lang.reflect.AnnotatedElement ae, SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig, CachePut cachePut)
java.util.Collection<CacheOperation> parseCachingAnnotation(java.lang.reflect.AnnotatedElement ae, SpringCacheAnnotationParser.DefaultCacheConfig defaultConfig, Caching caching)
SpringCacheAnnotationParser.DefaultCacheConfig getDefaultCacheConfig(java.lang.Class<?> target)
SpringCacheAnnotationParser.DefaultCacheConfig
instance for the specified Class
.target
- the class-level to handlenull
)private void validateCacheOperation(java.lang.reflect.AnnotatedElement ae, CacheOperation operation)
CacheOperation
.
Throws an IllegalStateException
if the state of the operation is
invalid. As there might be multiple sources for default values, this ensure
that the operation is in a proper state before being returned.
ae
- the annotated element of the cache operationoperation
- the CacheOperation
to validatepublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object