|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.scripting.util.AbstractNamespace
org.zkoss.zk.scripting.util.SimpleNamespace
public class SimpleNamespace
A simple implementation of Namespace.
| Constructor Summary | |
|---|---|
SimpleNamespace()
|
|
SimpleNamespace(Component owner)
|
|
| Method Summary | |
|---|---|
boolean |
containsVariable(java.lang.String name,
boolean local)
Returns whether the specified variable is defined. |
void |
copy(Namespace ns)
Copies all variables from the specified namespace. |
Namespace |
getParent()
Returns the parent name space, or null if this is topmost. |
java.lang.Object |
getVariable(java.lang.String name,
boolean local)
Returns the variable of the specified name, or null if not defined or the value is null. |
java.util.Set |
getVariableNames()
Returns a set of variable names stored in this name space. |
void |
setParent(Namespace parent)
Sets the parent name space. |
void |
setVariable(java.lang.String name,
java.lang.Object value,
boolean local)
Sets the variable of the specified name. |
void |
unsetVariable(java.lang.String name,
boolean local)
Unsets a variable from the current ID space. |
| Methods inherited from class org.zkoss.zk.scripting.util.AbstractNamespace |
|---|
addChangeListener, notifyAdd, notifyParentChanged, notifyRemove, removeChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleNamespace()
public SimpleNamespace(Component owner)
owner - the owner of this namespace.
If not null, the fellow of the owner is considered as part of this namespace.
In other words, containsVariable(java.lang.String, boolean) and getVariable(java.lang.String, boolean)
will check Component.getFellow(java.lang.String).| Method Detail |
|---|
public void copy(Namespace ns)
public java.util.Set getVariableNames()
NamespaceNote: it doesn't include the parent's varaibles.
public boolean containsVariable(java.lang.String name,
boolean local)
Namespace
local - whether not to search its ancestor.
If false and the current ID space doen't define the variable,
it searches up its ancestor (via Namespace.getParent()) to see
any of them has defined the specified variable.
public java.lang.Object getVariable(java.lang.String name,
boolean local)
Namespace
local - whether not to search its ancestor.
If false and the current ID space doen't define the variable,
it searches up its ancestor (via Namespace.getParent()) to see
any of them has defined the specified variable.
public void setVariable(java.lang.String name,
java.lang.Object value,
boolean local)
Namespace
local - whether not to set the variable to this name space
directly. If false, it searches whether the variable is defined
in any of its ancestor (via Namespace.getParent()). If local = false
and the ancestor is found, the value is stored to the ancestor
instead of this.
public void unsetVariable(java.lang.String name,
boolean local)
NamespaceUnlike Namespace.setVariable(java.lang.String, java.lang.Object, boolean), this method removed only
the variable defined in the ID space cotnaining this component.
public Namespace getParent()
Namespace
public void setParent(Namespace parent)
Namespace
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||