程序包 infra.aop.target

类 EmptyTargetSource

java.lang.Object
infra.aop.target.EmptyTargetSource
所有已实现的接口:
TargetClassAware, TargetSource, Serializable

public final class EmptyTargetSource extends Object implements TargetSource, Serializable
Canonical TargetSource when there is no target (or just the target class known), and behavior is supplied by interfaces and advisors only.
作者:
Rod Johnson, Juergen Hoeller, TODAY 2021/2/1 20:25
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • targetClass

      private final Class<?> targetClass
    • isStatic

      private final boolean isStatic
    • INSTANCE

      public static final EmptyTargetSource INSTANCE
      The canonical (Singleton) instance of this EmptyTargetSource.
  • 构造器详细资料

    • EmptyTargetSource

      private EmptyTargetSource(Class<?> targetClass, boolean isStatic)
      Create a new instance of the EmptyTargetSource class.

      This constructor is private to enforce the Singleton pattern / factory method pattern.

      参数:
      targetClass - the target class to expose (may be null)
      isStatic - whether the TargetSource is marked as static
  • 方法详细资料

    • getTargetClass

      public Class<?> getTargetClass()
      Always returns the specified target Class, or null if none.
      指定者:
      getTargetClass 在接口中 TargetClassAware
      指定者:
      getTargetClass 在接口中 TargetSource
      返回:
      the type of targets returned by this TargetSource
    • isStatic

      public boolean isStatic()
      Always returns true.
      指定者:
      isStatic 在接口中 TargetSource
      返回:
      true if the target is immutable
      另请参阅:
    • getTarget

      public Object getTarget()
      Always returns null.
      指定者:
      getTarget 在接口中 TargetSource
      返回:
      the target object which contains the join-point, or null if there is no actual target instance
    • readResolve

      private Object readResolve()
      Returns the canonical instance on deserialization in case of no target class, thus protecting the Singleton pattern.
    • equals

      public boolean equals(Object other)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • forClass

      public static EmptyTargetSource forClass(Class<?> targetClass)
      Return an EmptyTargetSource for the given target Class.
      参数:
      targetClass - the target Class (may be null)
      另请参阅:
    • forClass

      public static EmptyTargetSource forClass(Class<?> targetClass, boolean isStatic)
      Return an EmptyTargetSource for the given target Class.
      参数:
      targetClass - the target Class (may be null)
      isStatic - whether the TargetSource should be marked as static
      另请参阅: