Package bsh

Examples of bsh.BshMethod


  public Function getFunction(Scope scope, String name, Class[] argTypes) {
    return getFunction0(prepareNS(scope), name, argTypes);
  }
  private Function getFunction0(NameSpace bshns, String name, Class[] argTypes) {
    try {
       final BshMethod m = bshns.getMethod(
         name, argTypes != null ? argTypes: new Class[0], false);
       return m != null ? new BSHFunction(m): null;
    } catch (UtilEvalError ex) {
      throw UiException.Aide.wrap(ex);
    }
View Full Code Here


      }
    }

    for (;;) {
      try {
        final BshMethod mtd = (BshMethod)s.readObject();
        if (mtd == null) break; //no more

        //fix declaringNameSpace
        Field f = null;
        boolean acs = false;
        try {
          f = Classes.getAnyField(BshMethod.class, "declaringNameSpace");
          acs = f.isAccessible();
          Fields.setAccessible(f, true);
          f.set(mtd, ns);       
        } finally {
          if (f != null) Fields.setAccessible(f, acs);
        }
        ns.setMethod(mtd.getName(), mtd);
      } catch (IOException ex) {
        throw ex;
      } catch (Throwable ex) {
        log.warning("Ignored failure to read", ex);
      }
View Full Code Here

        }
        _vars = null;
      }
      if (_mtds != null) {
        for (Iterator it = _mtds.iterator(); it.hasNext();) {
          final BshMethod mtd = (BshMethod)it.next();
          try {
            _bshns.setMethod(mtd.getName(), mtd);
          } catch (Throwable ex) {
            log.warning("Ignored failure of set "+mtd, ex);
          }
        }
        _mtds = null;
View Full Code Here

TOP

Related Classes of bsh.BshMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.