Package org.codehaus.plexus.context
Interface Context
- 
- All Known Implementing Classes:
- DefaultContext
 
 public interface ContextContext is a Map of arbitrary data associated with the container.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(Object key)Returns true if this context contains a value for the specified key.Objectget(Object key)Returns the value of the key.Map<Object,Object>getContextData()Utility method to retrieve containerContext data.voidhide(Object key)Hides the item in the containerContext.voidmakeReadOnly()Make the containerContext read-only.voidput(Object key, Object value)Adds the item to the containerContext.
 
- 
- 
- 
Method Detail- 
containsboolean contains(Object key) Returns true if this context contains a value for the specified key.- Parameters:
- key- the key to search
- Returns:
- true if the key was found; false otherwise
 
 - 
getObject get(Object key) throws ContextException Returns the value of the key. If the key can't be found it will throw a exception.- Parameters:
- key- the key of the value to look up.
- Returns:
- returns the value associated with the key
- Throws:
- ContextException- if the key doesn't exist
 
 - 
getContextDataMap<Object,Object> getContextData() Utility method to retrieve containerContext data. The returned Map is an unmodifiable view.- Returns:
- the containerContext data
- Since:
- 1.0-alpha-18
 
 - 
putvoid put(Object key, Object value) throws IllegalStateException Adds the item to the containerContext.- Parameters:
- key- the key of the item
- value- the item
- Throws:
- IllegalStateException- if this context is read-only
 
 - 
hidevoid hide(Object key) throws IllegalStateException Hides the item in the containerContext. After remove(key) has been called, a get(key) will always fail, even if the parent containerContext has such a mapping.- Parameters:
- key- the items key
- Throws:
- IllegalStateException- if this context is read-only
 
 - 
makeReadOnlyvoid makeReadOnly() Make the containerContext read-only. Any attempt to write to the containerContext via put() will result in an IllegalStateException.
 
- 
 
-