|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.reflect.AbstractInvocationHandler
@Beta public abstract class AbstractInvocationHandler
Abstract implementation of InvocationHandler
that handles Object.equals(java.lang.Object)
,
Object.hashCode()
and Object.toString()
.
Constructor Summary | |
---|---|
AbstractInvocationHandler()
|
Method Summary | |
---|---|
protected abstract Object |
handleInvocation(Object proxy,
Method method,
Object[] args)
invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) delegates to this method upon any method invocation on the proxy instance,
except Object.equals(java.lang.Object) , Object.hashCode() and Object.toString() . |
Object |
invoke(Object proxy,
Method method,
Object[] args)
|
String |
toString()
The dynamic proxies' Object.toString() will delegate to this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractInvocationHandler()
Method Detail |
---|
public final Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable
Object.equals(java.lang.Object)
, Object.hashCode()
are implemented according to referential
equality (the default behavior of Object
). Object.toString()
delegates to
toString()
that can be overridden by subclasses.
invoke
in interface InvocationHandler
Throwable
protected abstract Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable
invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
delegates to this method upon any method invocation on the proxy instance,
except Object.equals(java.lang.Object)
, Object.hashCode()
and Object.toString()
. The result
will be returned as the proxied method's return value.
Unlike invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
, args
will never be null. When the method has no parameter,
an empty array is passed in.
Throwable
public String toString()
Object.toString()
will delegate to this method. Subclasses can
override this to provide custom string representation of the proxies.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |