org.kuali.rice.krad.uif.lifecycle
Class ComponentPostMetadata

java.lang.Object
  extended by org.kuali.rice.krad.uif.lifecycle.ComponentPostMetadata
All Implemented Interfaces:
Serializable

public class ComponentPostMetadata
extends Object
implements Serializable

Holds data about a component that might be needed to handle a post request.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
ViewPostMetadata, Serialized Form

Constructor Summary
ComponentPostMetadata(String id)
          Constructor taking the id for the component to store metadata for.
 
Method Summary
 void addData(String key, Object value)
          Adds a new data entry to the components post data.
 Map<String,Object> getData()
          General post data that has been stored for the component.
 Object getData(String key)
          Retrieves a post data value for the component.
 String getId()
          Id for the component the post metadata is associated with.
 String getPath()
          Path of the component within the view structure (tree).
 Map<String,String> getPhasePathMapping()
          Map containing the path for the component at each lifecycle phase.
 Map<String,List<String>> getRefreshPathMappings()
          Map of property paths whose lifecycle will be run when the component is refreshed.
 boolean isDetachedComponent()
          Indicates whether the component is detached from the view (not in the view's structure, but an external component, for example a dialog).
 void setData(Map<String,Object> data)
           
 void setDetachedComponent(boolean isDetachedComponent)
           
 void setId(String id)
           
 void setPath(String path)
           
 void setPhasePathMapping(Map<String,String> phasePathMapping)
           
 void setRefreshPathMappings(Map<String,List<String>> refreshPathMappings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentPostMetadata

public ComponentPostMetadata(String id)
Constructor taking the id for the component to store metadata for.

Parameters:
id - component id
Method Detail

getId

public String getId()
Id for the component the post metadata is associated with.

The id can be used to retrieve the component post metadata from the view post metadata

Returns:
component id

setId

public void setId(String id)
See Also:
getId()

getPath

public String getPath()
Path of the component within the view structure (tree).

This is set during the lifecycle process and used to retrieve the component for refresh calls

Returns:
path from view

setPath

public void setPath(String path)
See Also:
getPath()

getPhasePathMapping

public Map<String,String> getPhasePathMapping()
Map containing the path for the component at each lifecycle phase.

Note this is only stored if the path of the component is different from the getPath() at any of the phases

Returns:
map where key is the phase name and the value is the component's path

setPhasePathMapping

public void setPhasePathMapping(Map<String,String> phasePathMapping)
See Also:
getPhasePathMapping()

getRefreshPathMappings

public Map<String,List<String>> getRefreshPathMappings()
Map of property paths whose lifecycle will be run when the component is refreshed.

Each map entry contains a tree of paths to process for each of the lifecycle phases. This is so parents of the component (in each phase) are picked up during the refresh process

Returns:
map of refresh paths

setRefreshPathMappings

public void setRefreshPathMappings(Map<String,List<String>> refreshPathMappings)
See Also:
getRefreshPathMappings()

isDetachedComponent

public boolean isDetachedComponent()
Indicates whether the component is detached from the view (not in the view's structure, but an external component, for example a dialog).

This is used by the component refresh process to determine whether it can get the component instance by its path from the view (in the case of the component being attached), or if it must use its id (in the case of the component being detached).

Returns:
boolean true if the component is detached, false if not

setDetachedComponent

public void setDetachedComponent(boolean isDetachedComponent)
See Also:
isDetachedComponent

getData

public Map<String,Object> getData()
General post data that has been stored for the component.

Holds the general post data for a component. Any piece of data can be added to this map and then retrieved on a post call (for example in a controller method)

Note map returned is unmodifiable. Use addData(java.lang.String, java.lang.Object) to add new data entries

Returns:
unmodifiable map of data

setData

public void setData(Map<String,Object> data)
See Also:
getData()

addData

public void addData(String key,
                    Object value)
Adds a new data entry to the components post data.

Parameters:
key - key for data, which is used to retrieve the data
value - data value
See Also:
getData()

getData

public Object getData(String key)
Retrieves a post data value for the component.

Parameters:
key - key for the data value to retrieve
Returns:
data value, or null if data does not exist
See Also:
getData()


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.