/** Resolve possibly complex name to an object value. Throws EvalError on various failures. A null object value is indicated by a Primitive.NULL. A return type of Primitive.VOID comes from attempting to access an undefined variable. Some cases: myVariable myVariable.foo myVariable.foo.bar java.awt.GridBagConstraints.BOTH my.package.stuff.MyClass.someField.someField... Interpreter reference is necessary to allow resolution of "this.interpreter" magic field. CallStack reference is necessary to allow resolution of "this.caller" magic field. "this.callstack" magic field. */ public Object toObject( CallStack callstack, Interpreter interpreter ) throws UtilEvalError { return toObject( callstack, interpreter, false ); }
/** Resolve possibly complex name to an object value. Throws EvalError on various failures. A null object value is indicated by a Primitive.NULL. A return type of Primitive.VOID comes from attempting to access an undefined variable. Some cases: myVariable myVariable.foo myVariable.foo.bar java.awt.GridBagConstraints.BOTH my.package.stuff.MyClass.someField.someField... Interpreter reference is necessary to allow resolution of "this.interpreter" magic field. CallStack reference is necessary to allow resolution of "this.caller" magic field. "this.callstack" magic field. */ public Object toObject( BshEvaluatingVisitor visitor ) throws UtilEvalError { return toObject( visitor, false ); }
/** Resolve name to an object through this namespace. * @param name the name * @param interpreter the interpreter * @return the object * @throws UtilEvalError the util eval error */ public Object get(final String name, final Interpreter interpreter) throws UtilEvalError { final CallStack callstack = new CallStack(this); return this.getNameResolver(name).toObject(callstack, interpreter); }
/** Resolve name to an object through this namespace. */ public Object get( String name, Interpreter interpreter ) throws UtilEvalError { CallStack callstack = new CallStack( this ); return getNameResolver( name ).toObject( new BshEvaluatingVisitor(callstack, interpreter) ); }
obj = toObject( null, null, true ); } catch ( UtilEvalError e ) { } // couldn't resolve it
Object toObject( CallStack callstack, Interpreter interpreter, boolean forceClass ) throws EvalError { try { return getName( callstack.top() ).toObject( callstack, interpreter, forceClass ); } catch ( UtilEvalError e ) { throw e.toEvalError( this, callstack ); } }
public Object ambiguousNameToObject( BSHAmbiguousName node, boolean forceClass ) throws EvalError { try { return node.getName( callstack.top() ).toObject( this, forceClass ); } catch ( UtilEvalError e ) { throw e.toEvalError( node, callstack ); } }
obj = toObject( new BshEvaluatingVisitor(null, null), true ); } catch ( UtilEvalError e ) { }; // couldn't resolve it
Object obj = targetName.toObject( callstack, interpreter );
Object obj = targetName.toObject( visitor );