Class EmptyTargetSource

java.lang.Object
org.springframework.aop.target.EmptyTargetSource
All Implemented Interfaces:
Serializable, TargetClassAware, TargetSource

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.
Author:
Rod Johnson, Juergen Hoeller
See Also:
  • Field Details

  • Method Details

    • forClass

      public static EmptyTargetSource forClass(@Nullable Class<?> targetClass)
      Return an EmptyTargetSource for the given target Class.
      Parameters:
      targetClass - the target Class (may be null)
      See Also:
    • forClass

      public static EmptyTargetSource forClass(@Nullable Class<?> targetClass, boolean isStatic)
      Return an EmptyTargetSource for the given target Class.
      Parameters:
      targetClass - the target Class (may be null)
      isStatic - whether the TargetSource should be marked as static
      See Also:
    • getTargetClass

      @Nullable public Class<?> getTargetClass()
      Always returns the specified target Class, or null if none.
      Specified by:
      getTargetClass in interface TargetClassAware
      Specified by:
      getTargetClass in interface TargetSource
      Returns:
      the type of targets returned by this TargetSource
    • isStatic

      public boolean isStatic()
      Always returns true.
      Specified by:
      isStatic in interface TargetSource
      Returns:
      true if the target is immutable
      See Also:
    • getTarget

      @Nullable public Object getTarget()
      Always returns null.
      Specified by:
      getTarget in interface TargetSource
      Returns:
      the target object which contains the joinpoint, or null if there is no actual target instance
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object