/** Locate a variable and return the Variable object with optional recursion through parent name spaces. <p/> If this namespace is static, return only static variables. @return the Variable value or null if it is not defined */ protected Variable getVariableImpl( String name, boolean recurse ) throws UtilEvalError { Variable var = null; // Change import precedence if we are a class body/instance // Get imported first. if ( var == null && isClass ) var = getImportedVar( name ); if ( var == null && variables != null ) var = (Variable)variables.get(name); // Change import precedence if we are a class body/instance if ( var == null && !isClass ) var = getImportedVar( name ); // try parent if ( recurse && (var == null) && (parent != null) ) var = parent.getVariableImpl( name, recurse ); return var; }
/** Locate a variable and return the Variable object with optional recursion * through parent name spaces. * <p/> * If this namespace is static, return only static variables. * @param name the name * @param recurse the recurse * @return the Variable value or null if it is not defined * @throws UtilEvalError the util eval error */ protected Variable getVariableImpl(final String name, final boolean recurse) throws UtilEvalError { Variable var = null; if (this.variables.containsKey(name)) return this.variables.get(name); else var = this.getImportedVar(name); // try parent if (recurse && var == null && this.parent != null) var = this.parent.getVariableImpl(name, recurse); return var; }