Package org.codehaus.plexus.context
Interface Context
-
public interface ContextContext of the plexus container.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(java.lang.Object key)Returns true if the map or the parent map contains the key.java.lang.Objectget(java.lang.Object key)Returns the value of the key.java.util.MapgetContextData()Utility method to retrieve containerContext data.voidhide(java.lang.Object key)Hides the item in the containerContext.voidmakeReadOnly()Make the containerContext read-only.voidput(java.lang.Object key, java.lang.Object value)Adds the item to the containerContext.
-
-
-
Method Detail
-
get
java.lang.Object get(java.lang.Object key) throws ContextExceptionReturns 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
- Throws:
ContextException- If the key doesn't exist.
-
getContextData
java.util.Map getContextData()
Utility method to retrieve containerContext data. the returned Map is an unmodifiable view.- Returns:
- the containerContext data
- Since:
- 1.0-alpha-18
-
contains
boolean contains(java.lang.Object key)
Returns true if the map or the parent map contains the key.- Parameters:
key- The key to search for.- Returns:
- Returns true if the key was found.
-
put
void put(java.lang.Object key, java.lang.Object value) throws java.lang.IllegalStateExceptionAdds the item to the containerContext.- Parameters:
key- the key of the itemvalue- the item- Throws:
java.lang.IllegalStateException- if containerContext is read only
-
hide
void hide(java.lang.Object key) throws java.lang.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:
java.lang.IllegalStateException- if containerContext is read only
-
makeReadOnly
void makeReadOnly()
Make the containerContext read-only. Any attempt to write to the containerContext via put() will result in an IllegalStateException.
-
-