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

Object
  extended by DataGridStateFactory

public final class DataGridStateFactory
extends Object

Factory class used to construct instances of DataGridState objects. This class is used by the data grid and other clients to obtain the state for a data grid with a given name.

Data grid state information is scoped by a unique data grid String name. This name should be unique for a particular scope in a request. For all factory methods that take a data grid name as a parameter, the value of the name attribute should match the value of the DataGrid.setName(String) attribute for the data grid whose state to lookup.


Method Summary
 void attachDataGridState(String name, DataGridState state)
           Convenience method that allows a DataGridState object from a client to be attached to the factory.
 DataGridState getDataGridState(String name)
           Lookup a DataGridState object given a data grid identifier.
 DataGridState getDataGridState(String name, DataGridConfig config)
           Lookup a DataGridState object given a data grid identifier and a specific DataGridConfig object.
 DataGridURLBuilder getDataGridURLBuilder(String name)
           Lookup a DataGridURLBuilder object given a data grid identifier.
 DataGridURLBuilder getDataGridURLBuilder(String name, DataGridConfig config)
           Lookup a DataGridURLBuilder object given a data grid identifier and a specific DataGridConfig object.
static DataGridStateFactory getInstance(JspContext jspContext)
          Get an instance of a DataGridStateFactory given a JspContext.
static DataGridStateFactory getInstance(ServletRequest request)
          Get an instance of a DataGridStateFactory given a ServletRequest.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final DataGridStateFactory getInstance(JspContext jspContext)
Get an instance of a DataGridStateFactory given a JspContext.

Parameters:
jspContext - the current JspContext
Returns:
an instance of the factory

getInstance

public static final DataGridStateFactory getInstance(ServletRequest request)
Get an instance of a DataGridStateFactory given a ServletRequest.

Parameters:
request - the current ServletRequest
Returns:
an instance of the factory

getDataGridState

public final DataGridState getDataGridState(String name)

Lookup a DataGridState object given a data grid identifier.

This method will use the default DataGridConfig object when returning a data grid specific implementation of the DataGridState object. In order to specify a DataGridConfig, the getDataGridState(String, DataGridConfig) can be supplied with a specific data grid configuration.

Parameters:
name - the name of a data grid.
Returns:
the DataGridState for the data grid with the given name

getDataGridState

public final DataGridState getDataGridState(String name,
                                            DataGridConfig config)

Lookup a DataGridState object given a data grid identifier and a specific DataGridConfig object.

Parameters:
name - the name of the data grid
config - the DataGridConfig object to use when creating the grid's DataGridState object.
Returns:
the data grid state object

getDataGridURLBuilder

public final DataGridURLBuilder getDataGridURLBuilder(String name)

Lookup a DataGridURLBuilder object given a data grid identifier.

This method will use the default DataGridConfig object when returning a data grid specific implementation of the DataGridURLBuilder object. In order to specify a DataGridConfig, the getDataGridURLBuilder(String, DataGridConfig) can be supplied with a specific data grid configuration.

Parameters:
name - the name of the data grid
Returns:
the DataGridURLBuilder for the data grid with the given name

getDataGridURLBuilder

public final DataGridURLBuilder getDataGridURLBuilder(String name,
                                                      DataGridConfig config)

Lookup a DataGridURLBuilder object given a data grid identifier and a specific DataGridConfig object.

Parameters:
name - the name of the data grid
config - the DataGridConfig object to use when creating the grid's DataGridURLBuilder object.
Returns:
the URL builder for a data grid's state object

attachDataGridState

public final void attachDataGridState(String name,
                                      DataGridState state)

Convenience method that allows a DataGridState object from a client to be attached to the factory. This allows subsequent calls to retrieve this same DataGridState instance.

Parameters:
name - the name of the data grid
state - the DataGridState object to attach