public class EmptyTargetSource extends Object implements TargetSource, Serializable
TargetSource when there is no target
(or just the target class known), and behavior is supplied
by interfaces and advisors only.| 限定符和类型 | 字段和说明 |
|---|---|
static EmptyTargetSource |
INSTANCE
The canonical (Singleton) instance of this
EmptyTargetSource. |
| 限定符和类型 | 方法和说明 |
|---|---|
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() |
public static final EmptyTargetSource INSTANCE
EmptyTargetSource.public static EmptyTargetSource forClass(@Nullable Class<?> targetClass)
targetClass - the target Class (may be null)getTargetClass()public static EmptyTargetSource forClass(@Nullable Class<?> targetClass, boolean isStatic)
targetClass - the target Class (may be null)isStatic - whether the TargetSource should be marked as staticgetTargetClass()@Nullable public Class<?> getTargetClass()
null if none.getTargetClass 在接口中 TargetClassAwaregetTargetClass 在接口中 TargetSourceTargetSourcepublic boolean isStatic()
true.isStatic 在接口中 TargetSourcetrue if the target is immutableTargetSource.getTarget()@Nullable public Object getTarget()
null.getTarget 在接口中 TargetSourcenull if there is no actual target instancepublic void releaseTarget(Object target)
releaseTarget 在接口中 TargetSourcetarget - object obtained from a call to TargetSource.getTarget()