|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xlattice.Context
public class Context
A naming context consisting of a possibly nested set of name-to-object bindings. If there is a parent context and a key cannot be resolved in this context, an attempt will be made to resolve it in the parent, recursively.
Names added to the context must not be null. This implementation is intended to be thread-safe.
Constructor Summary | |
---|---|
Context()
Create a context without a parent. |
|
Context(Context parent)
Create a context with a parent Context. |
Method Summary | |
---|---|
Context |
bind(java.lang.String name,
java.lang.Object o)
Bind a name to an Object at this Context level. |
Context |
getParent()
|
java.lang.Object |
lookup(java.lang.String name)
Looks up a name recursively. |
Context |
setParent(Context newParent)
Change the parent Context. |
int |
size()
|
void |
unbind(java.lang.String name)
Remove a binding from the Context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Context()
public Context(Context parent)
Method Detail |
---|
public Context bind(java.lang.String name, java.lang.Object o)
name
- the name being boundo
- the Object it is bound to
java.lang.IllegalArgumentException
- if either is null.public java.lang.Object lookup(java.lang.String name)
name
- the name we are attempting to match
public void unbind(java.lang.String name)
name
- Name to be unbound.public int size()
public Context getParent()
public Context setParent(Context newParent)
newParent
- New parent Context, possibly null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |