Package org.kuali.rice.krad.uif.view
Class ViewIndex
java.lang.Object
org.kuali.rice.krad.uif.view.ViewIndex
- All Implemented Interfaces:
Serializable
Holds component indexes of a
View instance for convenient retrieval during the lifecycle.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearIndex(View view) Clears view indexes, for reinitializing indexes at the start of each phase.copy()Returns a clone of the view index.getCollectionGroupByPath(String collectionPath) Retrieves aCollectionGroupinstance from the indexGets the Map that contains collection indexing information.Retrieves aComponentfrom the view index by IdgetDataFieldByPath(String propertyPath) Retrieves aDataFieldinstance from the indexgetDataFieldByPropertyName(String propertyName) Retrieves aDataFieldinstance that has the given property name specified (note this is not the full binding path and first match is returned)Gets the Map that contains attribute field indexing information.Gets a lifecycle element instance by the given path (relative to the view).Gets the Map of lifecycle elements that are indexed by their path relative to the view.voidindexComponent(Component component) Adds an entry to the main index for the given component.booleanObserve an assigned ID.
-
Constructor Details
-
ViewIndex
public ViewIndex()
-
-
Method Details
-
clearIndex
Clears view indexes, for reinitializing indexes at the start of each phase. -
indexComponent
Adds an entry to the main index for the given component. If the component is of typeDataFieldorCollectionGroupan entry is created in the corresponding indexes for those types as well. Then the #indexComponent method is called for each of the component's childrenIf the component is already contained in the indexes, it will be replaced
DataFieldinstances are indexed by the attribute path. This is useful for retrieving the InputField based on the incoming request parameterCollectionGroupinstances are indexed by the collection path. This is useful for retrieving the CollectionGroup based on the incoming request parameter- Parameters:
component- component instance to index
-
observeAssignedId
Observe an assigned ID.- Parameters:
id- ID to observe- Returns:
- true if the ID is unique, false if the ID has already been observed
-
getComponentById
Retrieves aComponentfrom the view index by Id- Parameters:
id- id for the component to retrieve- Returns:
- Component instance found in index, or null if no such component exists
-
getDataFieldByPath
Retrieves aDataFieldinstance from the index- Parameters:
propertyPath- full path of the data field (from the form)- Returns:
- DataField instance for the path or Null if not found
-
getDataFieldByPropertyName
Retrieves aDataFieldinstance that has the given property name specified (note this is not the full binding path and first match is returned)- Parameters:
propertyName- property name for field to retrieve- Returns:
- DataField instance found or null if not found
-
getLifecycleElementsByPath
Gets the Map of lifecycle elements that are indexed by their path relative to the view.- Returns:
- map of all indexed lifecycle elements, key is the element path and value is the element instance
-
getLifecycleElementByPath
Gets a lifecycle element instance by the given path (relative to the view).- Parameters:
path- path of the element that should be returned- Returns:
- lifecycle element instance for given path or null if element at that path does not exist
-
getDataFieldIndex
Gets the Map that contains attribute field indexing information. The Map key points to an attribute binding path, and the Map value is theDataFieldinstance- Returns:
- data fields index map
-
getCollectionsIndex
Gets the Map that contains collection indexing information. The Map key gives the binding path to the collection, and the Map value givens theCollectionGroupinstance- Returns:
- collection index map
-
getCollectionGroupByPath
Retrieves aCollectionGroupinstance from the index- Parameters:
collectionPath- full path of the collection (from the form)- Returns:
- CollectionGroup instance for the collection path or Null if not found
-
copy
Returns a clone of the view index.- Returns:
- ViewIndex clone
-