public class ObjectInvoker
extends java.lang.Object
Constructor and Description |
---|
ObjectInvoker() |
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.
|
public static java.lang.reflect.Method retrieveMethod(java.lang.Class objClass, java.lang.String methodName) throws java.lang.Exception
objClass
- the class for the object that executes the method.methodName
- the method name.java.lang.Exception
- any error.public static java.lang.reflect.Method retrieveMethod(java.lang.Class objClass, java.lang.String methodName, java.lang.String replyClass) throws java.lang.Exception
objClass
- the class for the object that executes the method.methodName
- the method name.replyClass
- the reply type. This is optional.java.lang.Exception
- any error.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)
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.public static java.lang.Object invokeMethod(MethodInfo methodInfo, java.lang.Object invokeObj) throws MethodNotFoundException, java.lang.Exception
methodInfo
- the method info details.invokeObj
- the object to invoke the method on.MethodNotFoundException
- for a method declaration mismatch.java.lang.Exception
- any other error.