Package com.scriptbasic.utility
Class ReflectionUtility
java.lang.Object
com.scriptbasic.utility.ReflectionUtility
- Author:
- Peter Verhas date Aug 2, 2012
-
Method Summary
Modifier and TypeMethodDescriptionstatic Objectinvoke(Interpreter interpreter, String symbolicName, Method method, Object object, List<RightValue> args) Invoke themethodon theobjectusing theargs.
-
Method Details
-
invoke
public static Object invoke(Interpreter interpreter, String symbolicName, Method method, Object object, List<RightValue> args) throws ScriptBasicException Invoke themethodon theobjectusing theargs.If
objectisnullthen call the static method.If
objectis of a type that implements the interfaceNoAccessthen the call will fail.Before the Java method call the hook method
beforeCallJavaFunctionis called.After the Java method call the hook method
afterCallJavaFunctionis called.- Parameters:
interpreter- the interpretersymbolicName- 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 callobject- the object on which the call is to be performed ornullin case the method is staticargs- the arguments to the method call- Returns:
- the object returned by the Java method if any.
- Throws:
ScriptBasicException- in case of exception
-