|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bsh.NameSpace | +--bsh.BlockNameSpace
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. Elsewhere variable assignment (including untyped variable usage) acts like it is part of the containing block.
Note: It *must* remain possible for a BlockNameSpace to be a child of another BlockNameSpace and have variable propogation pass all the way through. (This happens naturally and simply here). This is used in BSHForStatement (see notes there).
Nested Class Summary |
Nested classes inherited from class bsh.NameSpace |
NameSpace.TypedVariable |
Nested classes inherited from class bsh.NameSource |
NameSource.Listener |
Field Summary | |
(package private) boolean |
initMode
When true, capture all variable assignment locally |
Fields inherited from class bsh.NameSpace |
callerInfoNode, JAVACODE, name, nameSourceListeners |
Constructor Summary | |
BlockNameSpace(NameSpace parent)
|
Method Summary | |
NameSpace |
getSuper()
super is our parent's super |
(package private) This |
getThis(Interpreter declaringInterpreter)
this is our parent's this |
void |
importClass(java.lang.String name)
delegate import to our parent |
void |
importPackage(java.lang.String name)
delegate import to our parent |
void |
setInitMode(boolean b)
When set to true, handle all variable assignment in this local scope - don't delegate to parent. |
void |
setVariable(java.lang.String name,
java.lang.Object o)
Override the standard namespace behavior. |
(package private) boolean |
weHaveVar(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
boolean initMode
Constructor Detail |
public BlockNameSpace(NameSpace parent) throws EvalError
Method Detail |
public void setVariable(java.lang.String name, java.lang.Object o) throws EvalError
setVariable
in class NameSpace
o
- a value of null will remove the variable definition.
EvalError
Primitive
public void setInitMode(boolean b)
boolean weHaveVar(java.lang.String name)
public NameSpace getSuper()
getSuper
in class NameSpace
This getThis(Interpreter declaringInterpreter)
getThis
in class NameSpace
public void importClass(java.lang.String name)
importClass
in class NameSpace
public void importPackage(java.lang.String name)
importPackage
in class NameSpace
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |