public static BshMethod[] getMethods(NameSpace ns) { if (ns == null) return new BshMethod[0]; return ns.getMethods(); }
final BshMethod[] mtds = ns.getMethods(); for (int j = mtds != null ? mtds.length : 0; --j >= 0;) { final String nm = mtds[j].getName();
/** This is the invocation handler for the dynamic proxy. <p> Notes: Inner class for the invocation handler seems to shield this unavailable interface from JDK1.2 VM... I don't understand this. JThis works just fine even if those classes aren't there (doesn't it?) This class shouldn't be loaded if an XThis isn't instantiated in NameSpace.java, should it? */ class Handler implements InvocationHandler, java.io.Serializable { public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { try { return invokeImpl( proxy, method, args ); } catch ( TargetError te ) { // Unwrap target exception. If the interface declares that // it throws the ex it will be delivered. If not it will be // wrapped in an UndeclaredThrowable // This isn't simple because unwrapping this loses all context info. // So rewrap is better than unwrap. - fschmidt Throwable t = te.getTarget(); Class<? extends Throwable> c = t.getClass(); String msg = t.getMessage(); try {
ns.setLocalVariable(varName,namespace.getVariable(varName,false),false); for( BshMethod method : namespace.getMethods() ) { ns.setMethod(method);