org.omnaest.utils.proxy.handler
Class MethodCallCapture

java.lang.Object
  extended by org.omnaest.utils.proxy.handler.MethodCallCapture

public class MethodCallCapture
extends Object

Result of a captured method call.


Constructor Summary
MethodCallCapture(Object obj, Method method, Object[] args, net.sf.cglib.proxy.MethodProxy proxy)
           
 
Method Summary
<E> E
getArgumentCasted(int indexPosition)
          Returns the argument with the given index position.
 Object[] getArguments()
          Arguments of the method call
 Method getMethod()
          Intercepted method
 String getMethodName()
          Returns the name of the called Method.
 Object getObject()
           
 net.sf.cglib.proxy.MethodProxy getProxy()
          A secondary proxy used to invoke the non-intercepted method.
 boolean hasArguments()
          Returns true if the invocation has arguments
 boolean hasArguments(int count)
          Returns true if the invocation has the given count of arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodCallCapture

public MethodCallCapture(Object obj,
                         Method method,
                         Object[] args,
                         net.sf.cglib.proxy.MethodProxy proxy)
Method Detail

getObject

public Object getObject()
Returns:
the enhanced object / stub / proxy

getMethod

public Method getMethod()
Intercepted method

Returns:

getArguments

public Object[] getArguments()
Arguments of the method call

Returns:

getArgumentCasted

public <E> E getArgumentCasted(int indexPosition)
Returns the argument with the given index position. Catches ClassCastException and return null if cast is unsuccessful.

Parameters:
indexPosition -
Returns:

hasArguments

public boolean hasArguments()
Returns true if the invocation has arguments

Returns:

hasArguments

public boolean hasArguments(int count)
Returns true if the invocation has the given count of arguments

Returns:

getProxy

public net.sf.cglib.proxy.MethodProxy getProxy()
A secondary proxy used to invoke the non-intercepted method.

Returns:
See Also:
MethodProxy.invokeSuper(Object, Object[])

getMethodName

public String getMethodName()
Returns the name of the called Method.

Returns:
name of the method or null if no method has been resolved.
See Also:
Method.getName()


Copyright © 2013. All Rights Reserved.