|
||||||||||
| 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()
Clears all stacks; used when initializing the Environment before a render. |
|
|
getAccess(Class<T> type)
For some type, returns a temporary access object for the type. |
|
|
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()
<T> EnvironmentalAccess<T> getAccess(Class<T> type)
The access object must be discarded at the end of the request (it will be unusable at that point anyway).
T - type - type of environmental object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||