## 类的使用
org.springframework.cache.interceptor.CacheOperation

- 使用CacheOperation的程序包
  程序包 | 说明
  --- | ---
  org.springframework.cache.annotation | Annotations and supporting classes for declarative cache management.
  org.springframework.cache.interceptor | AOP-based solution for declarative caching demarcation.

- - ### org.springframework.cache.annotation中CacheOperation的使用

    返回变量类型为CacheOperation的类型的org.springframework.cache.annotation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Collection<CacheOperation>` | AnnotationCacheOperationSource.`determineCacheOperations(AnnotationCacheOperationSource.CacheOperationProvider provider)` Determine the cache operation(s) for the given `AnnotationCacheOperationSource.CacheOperationProvider`.
    `protected Collection<CacheOperation>` | AnnotationCacheOperationSource.`findCacheOperations(Class<?> clazz)`
    `protected Collection<CacheOperation>` | AnnotationCacheOperationSource.`findCacheOperations(Method method)`
    `Collection<CacheOperation>` | AnnotationCacheOperationSource.CacheOperationProvider.`getCacheOperations(CacheAnnotationParser parser)` Return the `CacheOperation` instance(s) provided by the specified parser.
    `Collection<CacheOperation>` | CacheAnnotationParser.`parseCacheAnnotations(Class<?> type)` Parse the cache definition for the given class, based on an annotation type understood by this parser.
    `Collection<CacheOperation>` | SpringCacheAnnotationParser.`parseCacheAnnotations(Class<?> type)`
    `Collection<CacheOperation>` | CacheAnnotationParser.`parseCacheAnnotations(Method method)` Parse the cache definition for the given method, based on an annotation type understood by this parser.
    `Collection<CacheOperation>` | SpringCacheAnnotationParser.`parseCacheAnnotations(Method method)`

  - ### org.springframework.cache.interceptor中CacheOperation的使用

    org.springframework.cache.interceptor中CacheOperation的子类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `CacheableOperation` Class describing a cache 'cacheable' operation.
    `class` | `CacheEvictOperation` Class describing a cache 'evict' operation.
    `class` | `CachePutOperation` Class describing a cache 'put' operation.

    返回CacheOperation的org.springframework.cache.interceptor中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `abstract CacheOperation` | CacheOperation.Builder.`build()`
    `CacheOperation` | CacheAspectSupport.CacheOperationContext.`getOperation()`

    返回变量类型为CacheOperation的类型的org.springframework.cache.interceptor中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected abstract Collection<CacheOperation>` | AbstractFallbackCacheOperationSource.`findCacheOperations(Class<?> clazz)` Subclasses need to implement this to return the caching attribute for the given class, if any.
    `protected abstract Collection<CacheOperation>` | AbstractFallbackCacheOperationSource.`findCacheOperations(Method method)` Subclasses need to implement this to return the caching attribute for the given method, if any.
    `Collection<CacheOperation>` | AbstractFallbackCacheOperationSource.`getCacheOperations(Method method, Class<?> targetClass)` Determine the caching attribute for this method invocation.
    `Collection<CacheOperation>` | CacheOperationSource.`getCacheOperations(Method method, Class<?> targetClass)` Return the collection of cache operations for this method, or `null` if the method contains no cacheable annotations.
    `Collection<CacheOperation>` | CompositeCacheOperationSource.`getCacheOperations(Method method, Class<?> targetClass)`
    `Collection<CacheOperation>` | NameMatchCacheOperationSource.`getCacheOperations(Method method, Class<?> targetClass)`

    参数类型为CacheOperation的org.springframework.cache.interceptor中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected CacheAspectSupport.CacheOperationMetadata` | CacheAspectSupport.`getCacheOperationMetadata(CacheOperation operation, Method method, Class<?> targetClass)` Return the `CacheAspectSupport.CacheOperationMetadata` for the specified operation.
    `protected CacheAspectSupport.CacheOperationContext` | CacheAspectSupport.`getOperationContext(CacheOperation operation, Method method, Object[] args, Object target, Class<?> targetClass)`

    类型变量类型为CacheOperation的org.springframework.cache.interceptor中的方法参数
    限定符和类型 | 方法和说明
    --- | ---
    `void` | NameMatchCacheOperationSource.`addCacheMethod(String methodName, Collection<CacheOperation> ops)` Add an attribute for a cacheable method.
    `protected Collection<? extends Cache>` | CacheAspectSupport.`getCaches(CacheOperationInvocationContext<CacheOperation> context, CacheResolver cacheResolver)`
    `void` | NameMatchCacheOperationSource.`setNameMap(Map<String,Collection<CacheOperation>> nameMap)` Set a name/attribute map, consisting of method names (e.g.

    参数类型为CacheOperation的org.springframework.cache.interceptor中的构造器
    构造器和说明
    `CacheOperationMetadata(CacheOperation operation, Method method, Class<?> targetClass, KeyGenerator keyGenerator, CacheResolver cacheResolver)`