Class ReflectionUtility

java.lang.Object
com.scriptbasic.utility.ReflectionUtility

public class ReflectionUtility extends Object
Author:
Peter Verhas date Aug 2, 2012
  • Method Details

    • invoke

      public static Object invoke(Interpreter interpreter, String symbolicName, Method method, Object object, 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