类 MethodProxy
java.lang.Object
cn.taketoday.bytecode.proxy.MethodProxy
Classes generated by
Enhancer pass this object to the registered
MethodInterceptor objects when an intercepted method is invoked. It
can be used to either invoke the original method, or call the same method on
a different object of the same type.- 作者:
- TODAY
2019-10-21 23:49
-
方法概要
修饰符和类型方法说明static MethodProxyFor internal use byEnhanceronly; see theMethodAccessclass for similar functionality.static MethodProxyfind(Class type, MethodSignature sig) Return theMethodProxyused when intercepting the method matching the given signature.Return the signature of the proxied method.intReturn theMethodAccessmethod index for the method used byinvokeSuper(java.lang.Object, java.lang.Object[]).Return the name of the synthetic method created by CGLIB which is used byinvokeSuper(java.lang.Object, java.lang.Object[])to invoke the superclass (non-intercepted) method implementation.Invoke the original method, on a different object of the same type.invokeSuper(Object obj, Object[] args) Invoke the original (super) method on the specified object.
-
方法详细资料
-
create
For internal use byEnhanceronly; see theMethodAccessclass for similar functionality. -
getSignature
Return the signature of the proxied method. -
getSuperName
Return the name of the synthetic method created by CGLIB which is used byinvokeSuper(java.lang.Object, java.lang.Object[])to invoke the superclass (non-intercepted) method implementation. The parameter types are the same as the proxied method. -
getSuperIndex
public int getSuperIndex()Return theMethodAccessmethod index for the method used byinvokeSuper(java.lang.Object, java.lang.Object[]). This index uniquely identifies the method within the generated proxy, and therefore can be useful to reference external metadata.- 另请参阅:
-
find
Return theMethodProxyused when intercepting the method matching the given signature.- 参数:
type- the class generated by Enhancersig- the signature to match- 返回:
- the MethodProxy instance, or null if no applicable matching method is found
- 抛出:
IllegalArgumentException- if the Class was not created by Enhancer or does not use a MethodInterceptor
-
invoke
Invoke the original method, on a different object of the same type.- 参数:
obj- the compatible object; recursion will result if you use the object passed as the first argument to the MethodInterceptor (usually not what you want)args- the arguments passed to the intercepted method; you may substitute a different argument array as long as the types are compatible- 抛出:
Throwable- the bare exceptions thrown by the called method are passed through without wrapping in anInvocationTargetException- 另请参阅:
-
invokeSuper
Invoke the original (super) method on the specified object.- 参数:
obj- the enhanced object, must be the object passed as the first argument to the MethodInterceptorargs- the arguments passed to the intercepted method; you may substitute a different argument array as long as the types are compatible- 抛出:
Throwable- the bare exceptions thrown by the called method are passed through without wrapping in anInvocationTargetException- 另请参阅:
-