net.vidageek.mirror.invoke
Class MethodHandlerByMethod

java.lang.Object
  extended by net.vidageek.mirror.invoke.MethodHandlerByMethod
All Implemented Interfaces:
MethodHandler

public final class MethodHandlerByMethod
extends java.lang.Object
implements MethodHandler

This class is responsible for invoking a method using its instance.

Author:
jonasabreu

Constructor Summary
MethodHandlerByMethod(ReflectionProvider provider, java.lang.Object target, java.lang.Class<?> clazz, java.lang.reflect.Method method)
           
 
Method Summary
 java.lang.Object withArgs(java.lang.Object... args)
          Invoke a method using arguments args.
 java.lang.Object withoutArgs()
          Invoke a method without arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodHandlerByMethod

public MethodHandlerByMethod(ReflectionProvider provider,
                             java.lang.Object target,
                             java.lang.Class<?> clazz,
                             java.lang.reflect.Method method)
Method Detail

withArgs

public java.lang.Object withArgs(java.lang.Object... args)
Description copied from interface: MethodHandler
Invoke a method using arguments args.

Specified by:
withArgs in interface MethodHandler
Parameters:
args - arguments to be used to invoke method.
Returns:
The value returned by the method or null if the method was void.

withoutArgs

public java.lang.Object withoutArgs()
Description copied from interface: MethodHandler
Invoke a method without arguments.

Specified by:
withoutArgs in interface MethodHandler
Returns:
The value returned by the method or null if the method was void.


Copyright © 2009 VidaGeek.net. All Rights Reserved.