public Object invokeMethod(Object thiz,String name,Object... args) throws ScriptException, NoSuchMethodException {
  if (!(thiz instanceof bsh.This))   throw new ScriptException("Illegal objec type: " + thiz.getClass());
  bsh.This bshObject=(bsh.This)thiz;
  try {
    return bshObject.invokeMethod(name,args);
  }
 catch (  ParseException e) {
    throw new ScriptException(e.toString(),e.getErrorSourceFile(),e.getErrorLineNumber());
  }
catch (  TargetError e) {
    ScriptException se=new ScriptException(e.toString(),e.getErrorSourceFile(),e.getErrorLineNumber());
    se.initCause(e.getTarget());
    throw se;
  }
catch (  EvalError e) {
    throw new ScriptException(e.toString(),e.getErrorSourceFile(),e.getErrorLineNumber());
  }
catch (  InterpreterError e) {
    throw new ScriptException(e.toString());
  }
}

public Object invokeMethod ( Object thiz , String name , Object ... args ) throws ScriptException , NoSuchMethodException { if ( ! ( thiz instanceof bsh . This ) ) throw new ScriptException ( "Illegal objec type: " + thiz . getClass ( ) ) ; bsh . This bshObject = ( bsh . This ) thiz ; try { return bshObject . invokeMethod ( name , args ) ; } catch ( ParseException e ) { throw new ScriptException ( e . toString ( ) , e . getErrorSourceFile ( ) , e . getErrorLineNumber ( ) ) ; } catch ( TargetError e ) { ScriptException se = new ScriptException ( e . toString ( ) , e . getErrorSourceFile ( ) , e . getErrorLineNumber ( ) ) ; se . initCause ( e . getTarget ( ) ) ; throw se ; } catch ( EvalError e ) { throw new ScriptException ( e . toString ( ) , e . getErrorSourceFile ( ) , e . getErrorLineNumber ( ) ) ; } catch ( InterpreterError e ) { throw new ScriptException ( e . toString ( ) ) ; } }
calls a procedure compiled during a previous script execution , which is retained in the state of the < code > scriptengine < code > .
