public class ContextUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
cleanContextDeep(LifecycleElement lifecycleElement)
Sets the context of the given lifecycle element to null, then using reflection recursively finds any
lifecycle element children and sets their context to null.
|
static void |
pushAllToContextDeep(Component component,
Map<String,Object> sourceContext)
Pushes object to a component's context so that it is available from
Component.getContext() |
static void |
pushAllToContextDeep(List<? extends Component> components,
Map<String,Object> sourceContext)
Places a all entries from a map into each context map of a list of components.
|
static void |
pushObjectToContextDeep(Collection<? extends LifecycleElement> elements,
String contextName,
Object contextValue)
places a key, value pair in each context map of a list of components
|
static void |
pushObjectToContextDeep(Component component,
String contextName,
Object contextValue)
Pushes object to a component's context so that it is available from
Component.getContext() |
static void |
updateContextForLine(Component component,
CollectionGroup collectionGroup,
Object collectionLine,
int lineIndex,
String lineSuffix)
Update the context map for the given component with the collection context.
|
static void |
updateContextsForLine(List<? extends Component> components,
CollectionGroup collectionGroup,
Object collectionLine,
int lineIndex,
String lineSuffix)
Update the contexts of the given components.
|
public static void pushObjectToContextDeep(Collection<? extends LifecycleElement> elements, String contextName, Object contextValue)
elements
- the list of elementscontextName
- a value to be used as a key to retrieve the objectcontextValue
- the value to be placed in the contextpublic static void pushObjectToContextDeep(Component component, String contextName, Object contextValue)
Component.getContext()
The component's nested components that are available via Component#getComponentsForLifecycle
are also updated recursively
component
- the component whose context is to be updatedcontextName
- a value to be used as a key to retrieve the objectcontextValue
- the value to be placed in the contextpublic static void pushAllToContextDeep(Component component, Map<String,Object> sourceContext)
Component.getContext()
The component's nested components that are available via Component#getComponentsForLifecycle
are also updated recursively
component
- the component whose context is to be updatedsourceContext
- The source context map.public static void pushAllToContextDeep(List<? extends Component> components, Map<String,Object> sourceContext)
components
- The list components.sourceContext
- The source context map.public static void updateContextsForLine(List<? extends Component> components, CollectionGroup collectionGroup, Object collectionLine, int lineIndex, String lineSuffix)
components
- the components whose components to updatecollectionGroup
- collection group the components are associated withcollectionLine
- an instance of the data object for the linelineIndex
- the line indexlineSuffix
- id suffix for components in the line to make them uniquepublic static void updateContextForLine(Component component, CollectionGroup collectionGroup, Object collectionLine, int lineIndex, String lineSuffix)
The values of UifConstants.ContextVariableNames.LINE
and UifConstants.ContextVariableNames.INDEX
are set to collectionLine
and lineIndex
respectively.
component
- the component whose context is to be updatedcollectionGroup
- collection group the component is associated withcollectionLine
- an instance of the data object for the linelineIndex
- the line indexlineSuffix
- id suffix for components in the line to make them uniquepublic static void cleanContextDeep(LifecycleElement lifecycleElement)
lifecycleElement
- lifecycle element instance to cleanCopyright © 2005–2014 The Kuali Foundation. All rights reserved.