net.sf.jagg
Class MethodCall

java.lang.Object
  extended by net.sf.jagg.MethodCall
Direct Known Subclasses:
SelfMethodCall

public class MethodCall
extends java.lang.Object

A MethodCall bundles a Method object and an array of parameter values together so they can go together into a Map as the value. This class existed as a private inner class of MethodCache prior to version 0.5.0, but for 0.5.0, it was pulled out and made public.

Since:
0.5.0
Author:
Randy Gettman

Constructor Summary
MethodCall(java.lang.reflect.Method method, java.lang.Object[] parameters)
          Constructs a MethodCall.
 
Method Summary
 java.lang.Class<?> getReturnType()
          Returns the return type of the MethodCall.
 java.lang.Object invoke(java.lang.Object object)
          Invokes the internal Method using the internal parameters, and returns the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodCall

public MethodCall(java.lang.reflect.Method method,
                  java.lang.Object[] parameters)
Constructs a MethodCall.

Parameters:
method - The Method.
parameters - The array of parameter values.
Method Detail

getReturnType

public java.lang.Class<?> getReturnType()
Returns the return type of the MethodCall.

Returns:
A Class object representing the return type of the method.

invoke

public java.lang.Object invoke(java.lang.Object object)
                        throws java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Invokes the internal Method using the internal parameters, and returns the result.

Parameters:
object - The object on which to invoke the Method.
Returns:
The result of the invocation on the Method.
Throws:
java.lang.IllegalAccessException - If the Method is inaccessible (private, etc.)
java.lang.reflect.InvocationTargetException - If the Method throws an Exception during execution.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.