Class ViewLifecycleUtils
java.lang.Object
org.kuali.rice.krad.uif.lifecycle.ViewLifecycleUtils
Utilities for working with
LifecycleElement instances.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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>
List<T> getElementsOfTypeDeep(Collection<? extends LifecycleElement> items, Class<T> elementType) Return the lifecycle elements of the specified type from the given liststatic <T extends LifecycleElement>
List<T> getElementsOfTypeDeep(LifecycleElement element, Class<T> elementType) Returns the lifecycle elements of the specified type from the given list.static <T extends LifecycleElement>
List<T> 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.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>
List<T> 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 StringgetNextLifecyclePhase(LifecycleElement element) Gets the next lifecycle phase to be executed on the provided element.static booleanisExcluded(Component component) Determines if a component should be excluded from the current lifecycle.static voidrecycleElementMap(Map<?, ?> elementMap) Recycle a map returned bygetElementsForLifecycle(LifecycleElement, String).
-
Method Details
-
getLifecycleRestrictedProperties
public 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.- Parameters:
element- The lifecycle element.viewPhase- The view phase to retrieve restrictions for.- Returns:
- set of property names
-
getNextLifecyclePhase
Gets the next lifecycle phase to be executed on the provided element.If the view status is null, invalid, or
RENDERED, thenUifConstants.ViewPhases.INITIALIZEwill be returned and a warning logged.- Parameters:
element- The lifecycle element.- Returns:
- The next phase in the element's lifecycle based on view status
- See Also:
-
getElementsForLifecycle
Gets sub-elements for lifecycle processing.- Parameters:
element- The element to scan.- Returns:
- map of lifecycle elements
-
getElementsForLifecycle
public static Map<String,LifecycleElement> getElementsForLifecycle(LifecycleElement element, String viewPhase) Gets subcomponents for lifecycle processing.- Parameters:
element- The component to scan.viewPhase- The view phase to return subcomponents for.- Returns:
- lifecycle components
-
recycleElementMap
Recycle a map returned bygetElementsForLifecycle(LifecycleElement, String).- Parameters:
elementMap- map to recycle
-
getElementsOfTypeDeep
public static <T extends LifecycleElement> List<T> getElementsOfTypeDeep(Collection<? extends LifecycleElement> items, Class<T> elementType) Return the lifecycle elements of the specified type from the given listElements that match, implement or are extended from the specified
elementTypeare returned in the result. If an element is a parent to other elements then these child elements are searched for matching types as well.- Type Parameters:
T- the type of the elements that are returned- Parameters:
items- list of elements from which to searchelementType- the class or interface of the element type to return- Returns:
- List of matching elements
-
getElementsOfTypeDeep
public static <T extends LifecycleElement> List<T> getElementsOfTypeDeep(LifecycleElement element, Class<T> elementType) Returns the lifecycle elements of the specified type from the given list.Elements that match, implement or are extended from the specified
elementTypeare 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.- Type Parameters:
T- the type of the elements that are returned- Parameters:
element- The elements to searchelementType- the class or interface of the elements type to return- Returns:
- List of matching elements
-
getElementsOfTypeShallow
public static <T extends LifecycleElement> List<T> 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.Deep search is only performed on non-component nested elements.
- Type Parameters:
T- type of component that will be returned- Parameters:
element- instance to get children forelementType- type for component to return- Returns:
- list of child components with the given type
-
getNestedElementsOfTypeShallow
public static <T extends LifecycleElement> List<T> 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.- Type Parameters:
T- type of element that will be returned- Parameters:
element- instance to get children forelementType- type for element to return- Returns:
- list of child elements with the given type
-
isExcluded
Determines if a component should be excluded from the current lifecycle.- Parameters:
component- The component.
-