|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.context.DefaultContext
public class DefaultContext
Default implementation of Context. This implementation is a static hierarchial store.
| Nested Class Summary | |
|---|---|
private static class |
DefaultContext.Hidden
|
| Field Summary | |
|---|---|
private static DefaultContext.Hidden |
HIDDEN_MAKER
|
private java.util.Map |
m_contextData
|
private org.apache.avalon.framework.context.Context |
m_parent
|
private boolean |
m_readOnly
|
| Constructor Summary | |
|---|---|
DefaultContext()
Create a Context with no parent. |
|
DefaultContext(org.apache.avalon.framework.context.Context parent)
Create a Context with specified parent. |
|
DefaultContext(java.util.Map contextData)
Create a Context with specified data. |
|
DefaultContext(java.util.Map contextData,
org.apache.avalon.framework.context.Context parent)
Create a Context with specified data and parent. |
|
| Method Summary | |
|---|---|
protected void |
checkWriteable()
Utility method to check if context is writeable and if not throw exception. |
boolean |
equals(java.lang.Object o)
Check for equality between two DefaultContext objects. |
java.lang.Object |
get(java.lang.Object key)
Retrieve an item from the Context. |
protected java.util.Map |
getContextData()
Utility method to retrieve context data. |
protected org.apache.avalon.framework.context.Context |
getParent()
Get parent context if any. |
int |
hashCode()
|
void |
hide(java.lang.Object key)
Hides the item in the context. |
void |
makeReadOnly()
Make the context read-only. |
void |
put(java.lang.Object key,
java.lang.Object value)
Helper method fo adding items to Context. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final DefaultContext.Hidden HIDDEN_MAKER
private final java.util.Map m_contextData
private final org.apache.avalon.framework.context.Context m_parent
private boolean m_readOnly
| Constructor Detail |
|---|
public DefaultContext(java.util.Map contextData,
org.apache.avalon.framework.context.Context parent)
contextData - the context dataparent - the parent Context (may be null)public DefaultContext(java.util.Map contextData)
contextData - the context datapublic DefaultContext(org.apache.avalon.framework.context.Context parent)
parent - the parent Context (may be null)public DefaultContext()
| Method Detail |
|---|
public java.lang.Object get(java.lang.Object key)
throws org.apache.avalon.framework.context.ContextException
get in interface org.apache.avalon.framework.context.Contextkey - the key of item
ContextException - if item not present
public void put(java.lang.Object key,
java.lang.Object value)
throws java.lang.IllegalStateException
key - the items keyvalue - the item
java.lang.IllegalStateException - if context is read only
public void hide(java.lang.Object key)
throws java.lang.IllegalStateException
key - the items key
java.lang.IllegalStateException - if context is read onlyprotected final java.util.Map getContextData()
protected final org.apache.avalon.framework.context.Context getParent()
public void makeReadOnly()
protected final void checkWriteable()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if context is read onlypublic boolean equals(java.lang.Object o)
Equality is said to be true if, and only if, the following criteria are met;
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||