Class ReflectionUtility


  • public class ReflectionUtility
    extends java.lang.Object
    Author:
    Peter Verhas date Aug 2, 2012
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object invoke​(Interpreter interpreter, java.lang.String symbolicName, java.lang.reflect.Method method, java.lang.Object object, java.util.List<RightValue> args)
      Invoke the method on the object using the args.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • invoke

        public static java.lang.Object invoke​(Interpreter interpreter,
                                              java.lang.String symbolicName,
                                              java.lang.reflect.Method method,
                                              java.lang.Object object,
                                              java.util.List<RightValue> args)
                                       throws ScriptBasicException
        Invoke the method on the object using the args.

        If object is null then call the static method.

        If object is of a type that implements the interface NoAccess then the call will fail.

        Before the Java method call the hook method beforeCallJavaFunction is called.

        After the Java method call the hook methodafterCallJavaFunction is called.

        Parameters:
        interpreter - the interpreter
        symbolicName - the symbolic name of the method, as it is used in the BASIC level. This is used only for error reporting.
        method - the method to call
        object - the object on which the call is to be performed or null in case the method is static
        args - the arguments to the method call
        Returns:
        the object returned by the Java method if any.
        Throws:
        ScriptBasicException - in case of exception