public Object call ( Object object , String name , Object [ ] args ) throws BSFException { /* If object is null use the interpreter's global scope. */ if ( object == null ) try { object = interpreter . get ( "global" ) ; } catch ( EvalError e ) { throw new BSFException ( BSFException . REASON_OTHER_ERROR , "bsh internal error: " + e , e ) ; } if ( object instanceof bsh . This ) try { Object value = ( ( bsh . This ) object ) . invokeMethod ( name , args ) ; return Primitive . unwrap ( value ) ; } catch ( InterpreterError e ) { throw new BSFException ( BSFException . REASON_UNKNOWN_LANGUAGE , "BeanShell interpreter internal error: " + e , e ) ; } catch ( TargetError e2 ) { throw new BSFException ( BSFException . REASON_EXECUTION_ERROR , "The application script threw an exception: " + e2 . getTarget ( ) , e2 ) ; } catch ( EvalError e3 ) { throw new BSFException ( BSFException . REASON_OTHER_ERROR , "BeanShell script error: " + e3 , e3 ) ; } else throw new BSFException ( "Cannot invoke method: " + name + ". Object: " + object + " is not a BeanShell scripted object." ) ; }
Invoke method name on the specified bsh scripted object . The object may be null to indicate the global namespace of the interpreter .