org.springframework.aop.target

Class EmptyTargetSource

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


    public final class EmptyTargetSource
    extends java.lang.Object
    implements TargetSource, java.io.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:
    Serialized Form
    • Method Detail

      • forClass

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

        public static EmptyTargetSource forClass(@Nullable
                                                 java.lang.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()
      • getTarget

        @Nullable
        public java.lang.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(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object