org.springframework.cache.annotation
Class SpringCacheAnnotationParser

java.lang.Object
  extended by org.springframework.cache.annotation.SpringCacheAnnotationParser
All Implemented Interfaces:
java.io.Serializable, CacheAnnotationParser

public class SpringCacheAnnotationParser
extends java.lang.Object
implements CacheAnnotationParser, java.io.Serializable

Strategy implementation for parsing Spring's Caching, Cacheable, CacheEvict and CachePut annotations.

Since:
3.1
Author:
Costin Leau, Juergen Hoeller, Chris Beams
See Also:
Serialized Form

Constructor Summary
SpringCacheAnnotationParser()
           
 
Method Summary
private  java.util.Collection<CacheOperation> lazyInit(java.util.Collection<CacheOperation> ops)
           
(package private)  CacheableOperation parseCacheableAnnotation(java.lang.reflect.AnnotatedElement ae, Cacheable caching)
           
 java.util.Collection<CacheOperation> parseCacheAnnotations(java.lang.reflect.AnnotatedElement ae)
          Parses the cache definition for the given method or class, based on a known annotation type.
(package private)  java.util.Collection<CacheOperation> parseCachingAnnotation(java.lang.reflect.AnnotatedElement ae, Caching caching)
           
(package private)  CacheEvictOperation parseEvictAnnotation(java.lang.reflect.AnnotatedElement ae, CacheEvict caching)
           
(package private)  CacheOperation parseUpdateAnnotation(java.lang.reflect.AnnotatedElement ae, CachePut caching)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringCacheAnnotationParser

public SpringCacheAnnotationParser()
Method Detail

parseCacheAnnotations

public java.util.Collection<CacheOperation> parseCacheAnnotations(java.lang.reflect.AnnotatedElement ae)
Description copied from interface: CacheAnnotationParser
Parses the cache definition for the given method or class, based on a known annotation type.

This essentially parses a known cache annotation into Spring's metadata attribute class. Returns null if the method/class is not cacheable.

Specified by:
parseCacheAnnotations in interface CacheAnnotationParser
Parameters:
ae - the annotated method or class
Returns:
CacheOperation the configured caching operation, or null if none was found
See Also:
AnnotationCacheOperationSource#determineCacheOperation

lazyInit

private java.util.Collection<CacheOperation> lazyInit(java.util.Collection<CacheOperation> ops)

parseCacheableAnnotation

CacheableOperation parseCacheableAnnotation(java.lang.reflect.AnnotatedElement ae,
                                            Cacheable caching)

parseEvictAnnotation

CacheEvictOperation parseEvictAnnotation(java.lang.reflect.AnnotatedElement ae,
                                         CacheEvict caching)

parseUpdateAnnotation

CacheOperation parseUpdateAnnotation(java.lang.reflect.AnnotatedElement ae,
                                     CachePut caching)

parseCachingAnnotation

java.util.Collection<CacheOperation> parseCachingAnnotation(java.lang.reflect.AnnotatedElement ae,
                                                            Caching caching)