com.sptci.echo2
Class Confirmation.Executor<S>

java.lang.Object
  extended by com.sptci.echo2.Confirmation.Executor<S>
Enclosing class:
Confirmation

public static class Confirmation.Executor<S>
extends Object

The executor used to execute the desired action after user confirmation. You must use the addParameter(java.lang.Class, java.lang.Object) method if the method you specified requires parameters.


Field Summary
private  ArrayList<ArrayList> args
          The arguments to be passed to the method.
private  String methodName
          The method that is to be executed if the user confirms the action.
private  S source
          The source object whose methodName should be invoked after user confirmation.
 
Constructor Summary
Confirmation.Executor(S source, String methodName)
          Create a new instance of the class with the specified parameters
 
Method Summary
 void addParameter(Class cls, Object object)
          Add the specified source and class combination to args.
(package private)  void execute()
          Execute the methodName on the source with the args parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private final S source
The source object whose methodName should be invoked after user confirmation.


methodName

private final String methodName
The method that is to be executed if the user confirms the action.


args

private ArrayList<ArrayList> args
The arguments to be passed to the method. A two-dimensional array with each row containing the source at index 1 and the class of the source object at index 0. This is necessary to be able to correctly handle null objects.

Constructor Detail

Confirmation.Executor

public Confirmation.Executor(S source,
                             String methodName)
Create a new instance of the class with the specified parameters

Parameters:
source - The source to set.
methodName - The methodName to set.
Method Detail

addParameter

public void addParameter(Class cls,
                         Object object)
Add the specified source and class combination to args. This method should be invoked as many times are required by specifying the class and object parameters in the same order required to execute methodName.

Parameters:
cls - The class of the parameter
object - The parameter value

execute

void execute()
Execute the methodName on the source with the args parameters.

See Also:
ReflectionUtility.fetchMethod( Object, String, Class[] )