The Spring Framework

org.springframework.aop.target
Class EmptyTargetSource

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

public 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:
Serialized Form

Field Summary
static EmptyTargetSource INSTANCE
          The canonical (Singleton) instance of this EmptyTargetSource.
 
Method Summary
 boolean equals(Object other)
           
static EmptyTargetSource forClass(Class targetClass)
          Return an EmptyTargetSource for the given target Class.
static EmptyTargetSource forClass(Class targetClass, boolean isStatic)
          Return an EmptyTargetSource for the given target Class.
 Object getTarget()
          Always returns null.
 Class getTargetClass()
          Always returns the specified target Class, or null if none.
 int hashCode()
           
 boolean isStatic()
          Always returns true.
 void releaseTarget(Object target)
          Nothing to release.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final EmptyTargetSource INSTANCE
The canonical (Singleton) instance of this EmptyTargetSource.

Method Detail

forClass

public static EmptyTargetSource forClass(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(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()

getTargetClass

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 target Class, or null if not known

isStatic

public boolean isStatic()
Always returns true.

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

getTarget

public Object getTarget()
Always returns null.

Specified by:
getTarget in interface TargetSource
Returns:
the target object, which contains the joinpoint

releaseTarget

public void releaseTarget(Object target)
Nothing to release.

Specified by:
releaseTarget in interface TargetSource
Parameters:
target - object obtained from a call to TargetSource.getTarget()

equals

public boolean equals(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

The Spring Framework

Copyright © 2002-2007 The Spring Framework.