## 接口的使用
org.springframework.cache.interceptor.KeyGenerator

- 使用KeyGenerator的程序包
  程序包 | 说明
  --- | ---
  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中KeyGenerator的使用

    声明为KeyGenerator的org.springframework.cache.annotation中的字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected KeyGenerator` | AbstractCachingConfiguration.`keyGenerator`

    返回KeyGenerator的org.springframework.cache.annotation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `KeyGenerator` | CachingConfigurer.`keyGenerator()` Return the key generator bean to use for annotation-driven cache management.
    `KeyGenerator` | CachingConfigurerSupport.`keyGenerator()`

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

    实现KeyGenerator的org.springframework.cache.interceptor中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `SimpleKeyGenerator` Simple key generator.

    返回KeyGenerator的org.springframework.cache.interceptor中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `KeyGenerator` | CacheAspectSupport.`getKeyGenerator()` Return the default `KeyGenerator` that this cache aspect delegates to.

    参数类型为KeyGenerator的org.springframework.cache.interceptor中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | CacheAspectSupport.`setKeyGenerator(KeyGenerator keyGenerator)` Set the default `KeyGenerator` that this cache aspect should delegate to if no specific key generator has been set for the operation.
    `void` | CacheProxyFactoryBean.`setKeyGenerator(KeyGenerator keyGenerator)` Set the default `KeyGenerator` that this cache aspect should delegate to if no specific key generator has been set for the operation.

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