public class EmptyTargetSource extends java.lang.Object implements TargetSource, java.io.Serializable
TargetSource
when there is no target
(or just the target class known), and behavior is supplied
by interfaces and advisors only.Modifier and Type | Field and Description |
---|---|
static EmptyTargetSource |
INSTANCE
The canonical (Singleton) instance of this
EmptyTargetSource . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
static EmptyTargetSource |
forClass(java.lang.Class<?> targetClass)
Return an EmptyTargetSource for the given target Class.
|
static EmptyTargetSource |
forClass(java.lang.Class<?> targetClass,
boolean isStatic)
Return an EmptyTargetSource for the given target Class.
|
java.lang.Object |
getTarget()
Always returns
null . |
java.lang.Class<?> |
getTargetClass()
Always returns the specified target Class, or
null if none. |
int |
hashCode() |
boolean |
isStatic()
Always returns
true . |
void |
releaseTarget(java.lang.Object target)
Nothing to release.
|
java.lang.String |
toString() |
public static final EmptyTargetSource INSTANCE
EmptyTargetSource
.public static EmptyTargetSource forClass(java.lang.Class<?> targetClass)
targetClass
- the target Class (may be null
)getTargetClass()
public static EmptyTargetSource forClass(java.lang.Class<?> targetClass, boolean isStatic)
targetClass
- the target Class (may be null
)isStatic
- whether the TargetSource should be marked as staticgetTargetClass()
public java.lang.Class<?> getTargetClass()
null
if none.getTargetClass
in interface TargetClassAware
getTargetClass
in interface TargetSource
TargetSource
public boolean isStatic()
true
.isStatic
in interface TargetSource
true
if the target is immutableTargetSource.getTarget()
public java.lang.Object getTarget()
null
.getTarget
in interface TargetSource
public void releaseTarget(java.lang.Object target)
releaseTarget
in interface TargetSource
target
- object obtained from a call to TargetSource.getTarget()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object