接口 CacheAnnotationParser

所有已知实现类:
DefaultCacheAnnotationParser

public interface CacheAnnotationParser
Strategy interface for parsing known caching annotation types. AnnotationCacheOperationSource delegates to such parsers for supporting specific annotation types such as Framework's own Cacheable, CachePut andCacheEvict.
从以下版本开始:
4.0
作者:
Costin Leau, Stephane Nicoll, Juergen Hoeller
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    default boolean
    isCandidateClass(Class<?> targetClass)
    Determine whether the given class is a candidate for cache operations in the annotation format of this CacheAnnotationParser.
    Parse the cache definition for the given class, based on an annotation type understood by this parser.
    Parse the cache definition for the given method, based on an annotation type understood by this parser.
  • 方法详细资料

    • isCandidateClass

      default boolean isCandidateClass(Class<?> targetClass)
      Determine whether the given class is a candidate for cache operations in the annotation format of this CacheAnnotationParser.

      If this method returns false, the methods on the given class will not get traversed for #parseCacheAnnotations introspection. Returning false is therefore an optimization for non-affected classes, whereas true simply means that the class needs to get fully introspected for each method on the given class individually.

      参数:
      targetClass - the class to introspect
      返回:
      false if the class is known to have no cache operation annotations at class or method level; true otherwise. The default implementation returns true, leading to regular introspection.
      从以下版本开始:
      4.0
    • parseCacheAnnotations

      @Nullable Collection<CacheOperation> parseCacheAnnotations(Class<?> type)
      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 Framework's metadata attribute class. Returns null if the class is not cacheable.

      参数:
      type - the annotated class
      返回:
      the configured caching operation, or null if none found
      另请参阅:
    • parseCacheAnnotations

      @Nullable Collection<CacheOperation> parseCacheAnnotations(Method method)
      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 Framework's metadata attribute class. Returns null if the method is not cacheable.

      参数:
      method - the annotated method
      返回:
      the configured caching operation, or null if none found
      另请参阅: