|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Environment
Provides access to environment objects, which are almost always provided to enclosed components by enclosing components. Environmental services are a form of very late binding.
The Environment acts like a collection of stacks. Each stack contains environmental objects of a given type. Most often, a stack has zero or one elements, but on occasion, a particular component will push an override onto the stack for the benefit of the components it encloses.
Environmental
,
EnvironmentalShadowBuilder
Method Summary | ||
---|---|---|
void |
clear()
Deprecated. Deprecated in 5.3 with no replacement. |
|
void |
cloak()
Hides all current environment values, making the Environment object appear empty, until a call to decloak() } restores the original state. |
|
void |
decloak()
Restores state previously hidden by cloak() }. |
|
|
peek(Class<T> type)
Peeks at the current top of the indicated stack. |
|
|
peekRequired(Class<T> type)
Peeks at the current top of the indicated stack (which must have a non-null value). |
|
|
pop(Class<T> type)
Removes and returns the top environmental object of the selected type. |
|
|
push(Class<T> type,
T instance)
Pushes a new service onto the stack. |
Method Detail |
---|
<T> T peek(Class<T> type)
T
- the type of environmental objecttype
- class used to select the object
<T> T peekRequired(Class<T> type)
T
- the type of environmental objecttype
- class used to select the object
RuntimeException
- if no service of that type has been added<T> T pop(Class<T> type)
T
- the type of environmental objecttype
- class used to select the object
NoSuchElementException
- if the environmental stack (for the specified type) is empty<T> T push(Class<T> type, T instance)
T
- the type of environmental objecttype
- class used to select the objectinstance
- the service object
void clear()
void cloak()
decloak()
} restores the original state.
void decloak()
cloak()
}.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |