org.licas.util

## Class ObjectInvoker

- java.lang.Object
- - org.licas.util.ObjectInvoker

-     public class ObjectInvoker
      extends java.lang.Object

  This class provides methods to invoke an object method using reflection.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectInvoker()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.Object` | `invokeMethod(MethodInfo methodInfo, java.lang.Object invokeObj)` Use reflection to invoke the method.
    `static java.lang.reflect.Method` | `retrieveMethod(java.lang.Class objClass, java.lang.String methodName)` Try to retrieve the method from the object, matching to the method name only.
    `static java.lang.reflect.Method` | `retrieveMethod(java.lang.Class objClass, java.lang.String methodName, java.lang.String replyClass)` Try to retrieve the method from the object.
    `static java.lang.reflect.Method` | `retrieveMethod(java.lang.Class objClass, java.lang.String methodName, java.lang.String replyClass, java.util.ArrayList<java.lang.String> paramTypes)` Try to retrieve the method from the object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ObjectInvoker

          public ObjectInvoker()

  - ### Method Detail

    - #### retrieveMethod

          public static java.lang.reflect.Method retrieveMethod(java.lang.Class objClass,
                                                                java.lang.String methodName)
                                                         throws java.lang.Exception

      Try to retrieve the method from the object, matching to the method name only.
      Parameters:
        `objClass` - the class for the object that executes the method.
        `methodName` - the method name.
      Returns:
        the method that matches the spec or null if none exists.
      Throws:
        `java.lang.Exception` - any error.

    - #### retrieveMethod

          public static java.lang.reflect.Method retrieveMethod(java.lang.Class objClass,
                                                                java.lang.String methodName,
                                                                java.lang.String replyClass)
                                                         throws java.lang.Exception

      Try to retrieve the method from the object.
      Parameters:
        `objClass` - the class for the object that executes the method.
        `methodName` - the method name.
        `replyClass` - the reply type. This is optional.
      Returns:
        the method that matches the spec or null if none exists.
      Throws:
        `java.lang.Exception` - any error.

    - #### retrieveMethod

          public static java.lang.reflect.Method retrieveMethod(java.lang.Class objClass,
                                                                java.lang.String methodName,
                                                                java.lang.String replyClass,
                                                                java.util.ArrayList<java.lang.String> paramTypes)

      Try to retrieve the method from the object.
      Parameters:
        `objClass` - the class for the object that executes the method.
        `methodName` - the method name.
        `replyClass` - the reply type. This is optional.
        `paramTypes` - list of parameter types. Can be empty.
      Returns:
        the method that matches the spec or null if none exists.

    - #### invokeMethod

          public static java.lang.Object invokeMethod(MethodInfo methodInfo,
                                                      java.lang.Object invokeObj)
                                               throws MethodNotFoundException,
                                                      java.lang.Exception

      Use reflection to invoke the method.
      Parameters:
        `methodInfo` - the method info details.
        `invokeObj` - the object to invoke the method on.
      Returns:
        the result of the execution.
      Throws:
        `MethodNotFoundException` - for a method declaration mismatch.
        `java.lang.Exception` - any other error.