|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.clientcontroller.ContextImpl
This class specifies the state context interface
used by State
and Transition
objects. It will be
implemented by an adaptor class for a specific client realm.
Constructor Summary | |
protected |
ContextImpl(StateContext theParentContext)
Constructor |
Method Summary | |
protected void |
cleanup()
Removes all values and removes the child context. |
boolean |
containsValue(String aKey)
Determines if the specified value exists in the context set. |
Map |
getAllValues()
Retrieves all key-value pairs from this context set, assuming that this context is the root. |
Object |
getSingleValue(String aKey)
Retrieves the value mapped by aKey . |
Object |
getValue(String aKey)
Retrieves the value mapped by aKey . |
protected void |
removeChildContext()
Sets the child context to null . |
void |
removeValue(String aKey)
Removes the value mapped by aKey . |
protected void |
setChildContext(ContextImpl aChildContext)
Sets the child context reference. |
void |
setValue(String aKey,
Object aValue)
Sets the specified key-value under the local context. |
void |
updateValue(String aKey,
Object aValue)
Updates the value mapped by aKey . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ContextImpl(StateContext theParentContext)
Method Detail |
protected void setChildContext(ContextImpl aChildContext)
protected void removeChildContext()
null
.
public Object getValue(String aKey) throws ValueNotFoundException
aKey
. If the value is not found
in the local context then ancestor contexts are searched including the
root context.
This satisfies the StateContext
interface and is intended to
be used by states and transitions.
getValue
in interface StateContext
ValueNotFoundException
- if the key-value cannot be found.public void setValue(String aKey, Object aValue)
setValue
in interface StateContext
public void removeValue(String aKey) throws ValueNotFoundException
aKey
. If the value is not found
in the local context, an exception is thrown.
removeValue
in interface StateContext
ValueNotFoundException
- if the key-value cannot be found in the local context.public void updateValue(String aKey, Object aValue) throws ValueNotFoundException
aKey
. If the value is not found
in the local context then ancestor contexts are searched including the
root context. The value will be updated at the context level in which
it is found.
updateValue
in interface StateContext
ValueNotFoundException
- if the key-value cannot be found.public boolean containsValue(String aKey)
containsValue
in interface StateContext
true
if the value is found, otherwise false
.public Map getAllValues()
getAllValues
in interface ContextView
public Object getSingleValue(String aKey)
aKey
. If the value is not found
in the local context then child contexts are searched.
This satisfies the StateView
interface and is intended to
be used by users of a state machine that always have a reference to the
root context.
getSingleValue
in interface ContextView
null
if it isn't found.protected void cleanup()
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |