org.apache.beehive.netui.databinding.datagrid.api
Class DataGridStateCodec

Object
  extended by DataGridStateCodec

public abstract class DataGridStateCodec
extends Object

This abstract base class acts as a service that exposes state information to a data grid.

Implementations of the DataGridStateCodec should be request scoped and are not meant to be serialized. Implementations can hold references to the ServletRequest. In order to maintain a data grid's state across a request in a Java object, the DataGridState object should be used.


Constructor Summary
DataGridStateCodec()
           
 
Method Summary
abstract  DataGridState getDataGridState()
          Get the DataGridState for a data grid.
abstract  DataGridURLBuilder getDataGridURLBuilder()
          Get a DataGridURLBuilder which can build be used to build URLs for a data grid's current state.
 String getGridName()
          Get the data grid name with which this DataGridStateCodec is associated.
 ServletRequest getServletRequest()
          Get the current servlet request with which this DataGridStateCodec is associated.
abstract  void setDataGridState(DataGridState state)
          Set the @{link DataGridState} object.
 void setGridName(String gridName)
          Set the data grid name with which this DataGridStateCodec is associated.
 void setServletRequest(ServletRequest request)
          Set the ServletRequest.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataGridStateCodec

public DataGridStateCodec()
Method Detail

setServletRequest

public void setServletRequest(ServletRequest request)
Set the ServletRequest. The ServletRequest can be used by implementations to discover information contained in request URL or searched for request attributes.

Parameters:
request - the current request

getServletRequest

public ServletRequest getServletRequest()
Get the current servlet request with which this DataGridStateCodec is associated.

Returns:
the ServletRequest

setGridName

public void setGridName(String gridName)
Set the data grid name with which this DataGridStateCodec is associated.

Parameters:
gridName - the data grid's name

getGridName

public String getGridName()
Get the data grid name with which this DataGridStateCodec is associated.

Returns:
the data grid's name

getDataGridState

public abstract DataGridState getDataGridState()
Get the DataGridState for a data grid. This object contains the state which the data grid will use during rendering.

Returns:
the current DataGridState object

setDataGridState

public abstract void setDataGridState(DataGridState state)
Set the @{link DataGridState} object. This allows a client to apply a prior DataGridState object in order to explicitly set the data grid's state to a previously create set of objects.

Parameters:
state - the new DataGridState

getDataGridURLBuilder

public abstract DataGridURLBuilder getDataGridURLBuilder()
Get a DataGridURLBuilder which can build be used to build URLs for a data grid's current state.

Returns:
the DataGridURLBuilder for the data grid's state