|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.context.DefaultContext
public class DefaultContext
Default implementation of Context.
This implementation is a static hierarchial store. It has the normal get()
and put
methods. The hide
method will hide a property. When
a property has been hidden the containerContext will not search in the parent containerContext for the value.
Constructor Summary | |
---|---|
DefaultContext()
Create an empty Context. |
|
DefaultContext(java.util.Map<java.lang.Object,java.lang.Object> contextData)
Create a Context with specified data. |
Method Summary | |
---|---|
protected void |
checkWriteable()
Utility method to check if containerContext is writeable and if not throw exception. |
boolean |
contains(java.lang.Object key)
Returns true if this context contains a value for the specified key. |
java.lang.Object |
get(java.lang.Object key)
Returns the value of the key. |
java.util.Map |
getContextData()
Utility method to retrieve containerContext data |
void |
hide(java.lang.Object key)
Hides the item in the containerContext. |
void |
makeReadOnly()
Make the containerContext read-only. |
void |
put(java.lang.Object key,
java.lang.Object value)
Adds the item to the containerContext. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultContext()
public DefaultContext(java.util.Map<java.lang.Object,java.lang.Object> contextData)
contextData
- the containerContext dataMethod Detail |
---|
public boolean contains(java.lang.Object key)
Context
contains
in interface Context
key
- the key to search
public java.lang.Object get(java.lang.Object key) throws ContextException
Context
get
in interface Context
key
- the key of the value to look up.
ContextException
- if the key doesn't existpublic void put(java.lang.Object key, java.lang.Object value) throws java.lang.IllegalStateException
Context
put
in interface Context
key
- the key of the itemvalue
- the item
java.lang.IllegalStateException
- if this context is read-onlypublic void hide(java.lang.Object key) throws java.lang.IllegalStateException
Context
hide
in interface Context
key
- the items key
java.lang.IllegalStateException
- if this context is read-onlypublic java.util.Map getContextData()
getContextData
in interface Context
public void makeReadOnly()
makeReadOnly
in interface Context
protected void checkWriteable() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if containerContext is read only
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |