| java.lang.Object bsh.NameSpace bsh.BlockNameSpace
BlockNameSpace | class BlockNameSpace extends NameSpace (Code) | | A specialized namespace for Blocks (e.g. the body of a "for" statement).
The Block acts like a child namespace but only for typed variables
declared within it (block local scope) or untyped variables explicitly set
in it via setBlockVariable(). Otherwise variable assignment
(including untyped variable usage) acts like it is part of the containing
block.
|
Method Summary | |
public This | getSuper(Interpreter declaringInterpreter) | public This | getThis(Interpreter declaringInterpreter) Get a 'this' reference is our parent's 'this' for the object closure.
e.g. | public void | importClass(String name) | public void | importPackage(String name) | public void | setBlockVariable(String name, Object value) Set an untyped variable in the block namespace.
The BlockNameSpace would normally delegate this set to the parent.
Typed variables are naturally set locally.
This is used in try/catch block argument. | public void | setMethod(String name, BshMethod method) | public void | setVariable(String name, Object value, boolean strictJava, boolean recurse) Override the standard namespace behavior to make assignments
happen in our parent (enclosing) namespace, unless the variable has
already been assigned here via a typed declaration or through
the special setBlockVariable() (used for untyped args in try/catch).
i.e. |
getThis | public This getThis(Interpreter declaringInterpreter)(Code) | | Get a 'this' reference is our parent's 'this' for the object closure.
e.g. Normally a 'this' reference to a BlockNameSpace (e.g. if () { } )
resolves to the parent namespace (e.g. the namespace containing the
"if" statement).
See Also: BlockNameSpace.getBlockThis(Interpreter) |
importClass | public void importClass(String name)(Code) | | delegate import to our parent
|
importPackage | public void importPackage(String name)(Code) | | delegate import to our parent
|
setBlockVariable | public void setBlockVariable(String name, Object value) throws UtilEvalError(Code) | | Set an untyped variable in the block namespace.
The BlockNameSpace would normally delegate this set to the parent.
Typed variables are naturally set locally.
This is used in try/catch block argument.
|
setVariable | public void setVariable(String name, Object value, boolean strictJava, boolean recurse) throws UtilEvalError(Code) | | Override the standard namespace behavior to make assignments
happen in our parent (enclosing) namespace, unless the variable has
already been assigned here via a typed declaration or through
the special setBlockVariable() (used for untyped args in try/catch).
i.e. only allow typed var declaration to happen in this namespace.
Typed vars are handled in the ordinary way local scope. All untyped
assignments are delegated to the enclosing context.
|
Methods inherited from bsh.NameSpace | public void addNameSourceListener(NameSource.Listener listener)(Code)(Java Doc) boolean attemptSetPropertyValue(String propName, Object value, Interpreter interp) throws UtilEvalError(Code)(Java Doc) void cacheClass(String name, Class c)(Code)(Java Doc) public void classLoaderChanged()(Code)(Java Doc) public void clear()(Code)(Java Doc) protected Variable createVariable(String name, Object value, Modifiers mods) throws UtilEvalError(Code)(Java Doc) protected Variable createVariable(String name, Class type, Object value, Modifiers mods) throws UtilEvalError(Code)(Java Doc) protected Variable createVariable(String name, Class type, LHS lhs) throws UtilEvalError(Code)(Java Doc) public void doSuperImport() throws UtilEvalError(Code)(Java Doc) public Object get(String name, Interpreter interpreter) throws UtilEvalError(Code)(Java Doc) public String[] getAllNames()(Code)(Java Doc) protected void getAllNamesAux(Vector vec)(Code)(Java Doc) public Class getClass(String name) throws UtilEvalError(Code)(Java Doc) Object getClassInstance() throws UtilEvalError(Code)(Java Doc) public BshClassManager getClassManager()(Code)(Java Doc) public Object getCommand(String name, Class[] argTypes, Interpreter interpreter) throws UtilEvalError(Code)(Java Doc) public Variable[] getDeclaredVariables()(Code)(Java Doc) public This getGlobal(Interpreter declaringInterpreter)(Code)(Java Doc) protected BshMethod getImportedMethod(String name, Class[] sig) throws UtilEvalError(Code)(Java Doc) protected Variable getImportedVar(String name) throws UtilEvalError(Code)(Java Doc) public int getInvocationLine()(Code)(Java Doc) public String getInvocationText()(Code)(Java Doc) public BshMethod getMethod(String name, Class[] sig) throws UtilEvalError(Code)(Java Doc) public BshMethod getMethod(String name, Class[] sig, boolean declaredOnly) throws UtilEvalError(Code)(Java Doc) public String[] getMethodNames()(Code)(Java Doc) public BshMethod[] getMethods()(Code)(Java Doc) public String getName()(Code)(Java Doc) Name getNameResolver(String ambigname)(Code)(Java Doc) SimpleNode getNode()(Code)(Java Doc) String getPackage()(Code)(Java Doc) public NameSpace getParent()(Code)(Java Doc) Object getPropertyValue(String propName, Interpreter interp) throws UtilEvalError(Code)(Java Doc) public This getSuper(Interpreter declaringInterpreter)(Code)(Java Doc) public This getThis(Interpreter declaringInterpreter)(Code)(Java Doc) public Object getVariable(String name) throws UtilEvalError(Code)(Java Doc) public Object getVariable(String name, boolean recurse) throws UtilEvalError(Code)(Java Doc) protected Variable getVariableImpl(String name, boolean recurse) throws UtilEvalError(Code)(Java Doc) public String[] getVariableNames()(Code)(Java Doc) public Object getVariableOrProperty(String name, Interpreter interp) throws UtilEvalError(Code)(Java Doc) public static Class identifierToClass(ClassIdentifier ci)(Code)(Java Doc) public void importClass(String name)(Code)(Java Doc) public void importCommands(String name)(Code)(Java Doc) public void importObject(Object obj)(Code)(Java Doc) public void importPackage(String name)(Code)(Java Doc) public void importStatic(Class clas)(Code)(Java Doc) public Object invokeMethod(String methodName, Object[] args, Interpreter interpreter) throws EvalError(Code)(Java Doc) public Object invokeMethod(String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo) throws EvalError(Code)(Java Doc) public void loadDefaultImports()(Code)(Java Doc) public void nameSpaceChanged()(Code)(Java Doc) public void prune()(Code)(Java Doc) void setClassInstance(Object instance)(Code)(Java Doc) void setClassManager(BshClassManager classManager)(Code)(Java Doc) void setClassStatic(Class clas)(Code)(Java Doc) void setLocalVariable(String name, Object value, boolean strictJava) throws UtilEvalError(Code)(Java Doc) void setLocalVariableOrProperty(String name, Object value, boolean strictJava) throws UtilEvalError(Code)(Java Doc) public void setMethod(String name, BshMethod method) throws UtilEvalError(Code)(Java Doc) public void setName(String name)(Code)(Java Doc) void setNode(SimpleNode node)(Code)(Java Doc) void setPackage(String packageName)(Code)(Java Doc) public void setParent(NameSpace parent)(Code)(Java Doc) public void setTypedVariable(String name, Class type, Object value, boolean isFinal) throws UtilEvalError(Code)(Java Doc) public void setTypedVariable(String name, Class type, Object value, Modifiers modifiers) throws UtilEvalError(Code)(Java Doc) public void setVariable(String name, Object value, boolean strictJava) throws UtilEvalError(Code)(Java Doc) void setVariable(String name, Object value, boolean strictJava, boolean recurse) throws UtilEvalError(Code)(Java Doc) public void setVariableOrProperty(String name, Object value, boolean strictJava) throws UtilEvalError(Code)(Java Doc) void setVariableOrProperty(String name, Object value, boolean strictJava, boolean recurse) throws UtilEvalError(Code)(Java Doc) public String toString()(Code)(Java Doc) public void unsetVariable(String name)(Code)(Java Doc) protected Object unwrapVariable(Variable var) throws UtilEvalError(Code)(Java Doc)
|
|
|