public final class ViewLifecycleUtils extends Object
LifecycleElement
instances.Modifier and Type | Method and Description |
---|---|
static Map<String,LifecycleElement> |
getElementsForLifecycle(LifecycleElement element)
Gets sub-elements for lifecycle processing.
|
static Map<String,LifecycleElement> |
getElementsForLifecycle(LifecycleElement element,
String viewPhase)
Gets subcomponents for lifecycle processing.
|
static <T extends LifecycleElement> |
getElementsOfTypeDeep(Collection<? extends LifecycleElement> items,
Class<T> elementType)
Return the lifecycle elements of the specified type from the given list
|
static <T extends LifecycleElement> |
getElementsOfTypeDeep(LifecycleElement element,
Class<T> elementType)
Returns the lifecycle elements of the specified type from the given list.
|
static <T extends LifecycleElement> |
getElementsOfTypeShallow(LifecycleElement element,
Class<T> elementType)
Returns elements of the given type that are direct children of the given element including
itself, or a child of a non-component child of the given element.
|
static Set<String> |
getLifecycleRestrictedProperties(LifecycleElement element,
String viewPhase)
Gets property names of all bean properties on the lifecycle element restricted for the
indicated view phase.
|
static <T extends LifecycleElement> |
getNestedElementsOfTypeShallow(LifecycleElement element,
Class<T> elementType)
Get nested elements of the type specified one layer deep; this defers from
getElementsOfTypeShallow because it does NOT include itself as a match if it also matches the
type being requested.
|
static String |
getNextLifecyclePhase(LifecycleElement element)
Gets the next lifecycle phase to be executed on the provided element.
|
static boolean |
isExcluded(Component component)
Determines if a component should be excluded from the current lifecycle.
|
static void |
recycleElementMap(Map<?,?> elementMap)
Recycle a map returned by
getElementsForLifecycle(LifecycleElement, String) . |
public static Set<String> getLifecycleRestrictedProperties(LifecycleElement element, String viewPhase)
element
- The lifecycle element.viewPhase
- The view phase to retrieve restrictions for.public static String getNextLifecyclePhase(LifecycleElement element)
If the view status is null, invalid, or RENDERED
,
then UifConstants.ViewPhases.INITIALIZE
will be returned and a warning logged.
element
- The lifecycle element.LifecycleElement.getViewStatus()
,
UifConstants.ViewPhases
public static Map<String,LifecycleElement> getElementsForLifecycle(LifecycleElement element)
element
- The element to scan.public static Map<String,LifecycleElement> getElementsForLifecycle(LifecycleElement element, String viewPhase)
element
- The component to scan.viewPhase
- The view phase to return subcomponents for.public static void recycleElementMap(Map<?,?> elementMap)
getElementsForLifecycle(LifecycleElement, String)
.elementMap
- map to recyclepublic static <T extends LifecycleElement> List<T> getElementsOfTypeDeep(Collection<? extends LifecycleElement> items, Class<T> elementType)
Elements that match, implement or are extended from the specified elementType
are
returned in the result. If an element is a parent to other elements then these child elements
are searched for matching types as well.
T
- the type of the elements that are returneditems
- list of elements from which to searchelementType
- the class or interface of the element type to returnpublic static <T extends LifecycleElement> List<T> getElementsOfTypeDeep(LifecycleElement element, Class<T> elementType)
Elements that match, implement or are extended from the specified elementType
are
returned in the result. If an element is a parent to other elements then these child
components are searched for matching component types as well.
T
- the type of the elements that are returnedelement
- The elements to searchelementType
- the class or interface of the elements type to returnpublic static <T extends LifecycleElement> List<T> getElementsOfTypeShallow(LifecycleElement element, Class<T> elementType)
Deep search is only performed on non-component nested elements.
T
- type of component that will be returnedelement
- instance to get children forelementType
- type for component to returnpublic static <T extends LifecycleElement> List<T> getNestedElementsOfTypeShallow(LifecycleElement element, Class<T> elementType)
T
- type of element that will be returnedelement
- instance to get children forelementType
- type for element to returnpublic static boolean isExcluded(Component component)
component
- The component.Copyright © 2005–2014 The Kuali Foundation. All rights reserved.