| Modifier and Type | Field and Description |
|---|---|
| private final boolean | isVarArgs
Whether this method handles varargs. |
| Access | Constructor and Description |
|---|---|
| public | MethodExecutor(Introspector
the introspector used to discover the method is, Object the object to find the method in obj, String the method name name, Object[] the method arguments args)Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| private static AbstractExecutor. | Returns: a filled up parameter (may contain a null method)the introspector used to discover the method is, Object the object to introspect obj, String the name of the method to find method, Object[] the method arguments args)Discovers a method for a |
| public Object | Returns: the result of the method invocationthe object to invoke the method upon o, Object[] the method arguments args)Implements abstract org. |
| protected Object[] | Returns: The actual parameters adjusted for the varargs in order to fit the method declaration.The vararg class type (aka component type
of the expected array arg) type, int The index of the vararg in the method declaration
(This will always be one less than the number of
expected arguments.) index, Object[] The actual parameters being passed to this method actual)Reassembles arguments if the method is a vararg method. |
| private static boolean | Returns: true if method is vararg, false otherwisea the method to check m)Determines if a method can accept a variable number of arguments. |
| public Object | tryExecute(String
the method name name, Object the object to invoke the method upon obj, Object[] the method arguments args)Overrides org. |
| isVarArgs | back to summary |
|---|---|
| private final boolean isVarArgs Whether this method handles varargs. | |
| MethodExecutor | back to summary |
|---|---|
| public MethodExecutor(Introspector is, Object obj, String name, Object[] args) Creates a new instance.
| |
| discover | back to summary |
|---|---|
| private static AbstractExecutor. Discovers a method for a
If the object is an array, an attempt will be made to find the
method in a List (see If the object is a class, an attempt will be made to find the method as a static method of that class.
| |
| execute | back to summary |
|---|---|
| public Object execute(Object o, Object[] args) throws IllegalAccessException, InvocationTargetException Implements abstract org. Invokes the method to be executed.
| |
| handleVarArg | back to summary |
|---|---|
| protected Object[] handleVarArg(Class<?> type, int index, Object[] actual) Reassembles arguments if the method is a vararg method.
| |
| isVarArgMethod | back to summary |
|---|---|
| private static boolean isVarArgMethod(Method m) Determines if a method can accept a variable number of arguments.
| |
| tryExecute | back to summary |
|---|---|
| public Object tryExecute(String name, Object obj, Object[] args) Overrides org. Doc from org. Tries to reuse this executor, checking that it is compatible with the actual set of arguments. | |