|
||||||||||
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(Map<Object,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(Object key)
Returns true if this context contains a value for the specified key. |
Object |
get(Object key)
Returns the value of the key. |
Map |
getContextData()
Utility method to retrieve containerContext data |
void |
hide(Object key)
Hides the item in the containerContext. |
void |
makeReadOnly()
Make the containerContext read-only. |
void |
put(Object key,
Object value)
Adds the item to the containerContext. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultContext()
public DefaultContext(Map<Object,Object> contextData)
contextData
- the containerContext dataMethod Detail |
---|
public boolean contains(Object key)
Context
contains
in interface Context
key
- the key to search
public Object get(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(Object key, Object value) throws IllegalStateException
Context
put
in interface Context
key
- the key of the itemvalue
- the item
IllegalStateException
- if this context is read-onlypublic void hide(Object key) throws IllegalStateException
Context
hide
in interface Context
key
- the items key
IllegalStateException
- if this context is read-onlypublic Map getContextData()
getContextData
in interface Context
public void makeReadOnly()
makeReadOnly
in interface Context
protected void checkWriteable() throws IllegalStateException
IllegalStateException
- if containerContext is read onlypublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |