Package org.springframework.aop.target
Class EmptyTargetSource
- java.lang.Object
- org.springframework.aop.target.EmptyTargetSource
- All Implemented Interfaces:
Serializable,TargetClassAware,TargetSource
public class EmptyTargetSource extends Object implements TargetSource, Serializable
CanonicalTargetSourcewhen 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
Fields Modifier and Type Field Description static EmptyTargetSourceINSTANCEThe canonical (Singleton) instance of thisEmptyTargetSource.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)static EmptyTargetSourceforClass(Class<?> targetClass)Return an EmptyTargetSource for the given target Class.static EmptyTargetSourceforClass(Class<?> targetClass, boolean isStatic)Return an EmptyTargetSource for the given target Class.ObjectgetTarget()Always returnsnull.Class<?>getTargetClass()Always returns the specified target Class, ornullif none.inthashCode()booleanisStatic()Always returnstrue.voidreleaseTarget(Object target)Nothing to release.StringtoString()
Field Detail
INSTANCE
public static final EmptyTargetSource INSTANCE
The canonical (Singleton) instance of thisEmptyTargetSource.
Method Detail
forClass
public static EmptyTargetSource forClass(Class<?> targetClass)
Return an EmptyTargetSource for the given target Class.- Parameters:
targetClass- the target Class (may benull)- 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 benull)isStatic- whether the TargetSource should be marked as static- See Also:
getTargetClass()
getTargetClass
public Class<?> getTargetClass()
Always returns the specified target Class, ornullif none.- Specified by:
getTargetClassin interfaceTargetClassAware- Specified by:
getTargetClassin interfaceTargetSource- Returns:
- the type of targets returned by this
TargetSource
isStatic
public boolean isStatic()
Always returnstrue.- Specified by:
isStaticin interfaceTargetSource- Returns:
trueif the target is immutable- See Also:
TargetSource.getTarget()
getTarget
public Object getTarget()
Always returnsnull.- Specified by:
getTargetin interfaceTargetSource- Returns:
- the target object which contains the joinpoint, or
nullif there is no actual target instance
releaseTarget
public void releaseTarget(Object target)
Nothing to release.- Specified by:
releaseTargetin interfaceTargetSource- Parameters:
target- object obtained from a call toTargetSource.getTarget()