org.apache.myfaces.trinidad.render
Class ClientRowKeyManager

java.lang.Object
  extended by org.apache.myfaces.trinidad.render.ClientRowKeyManager
All Implemented Interfaces:
Serializable

public abstract class ClientRowKeyManager
extends Object
implements Serializable

This class manages server-side rowkey Objects with client-side string keys. This class must be Serializable as it is state-saved along with the UIComponent state.

See Also:
Serialized Form

Constructor Summary
ClientRowKeyManager()
           
 
Method Summary
abstract  String getClientRowKey(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object rowKey)
          Gets a string version of a key that identifies the row with the given rowkey.
abstract  Object getRowKey(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String clientRowKey)
          Gets the corresponding server-side rowkey object from the given client-side string key.
 boolean replaceRowKey(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object oldRowKey, Object newRowKey)
          Replaces an old row key with a new key if the old row key exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientRowKeyManager

public ClientRowKeyManager()
Method Detail

getClientRowKey

public abstract String getClientRowKey(javax.faces.context.FacesContext context,
                                       javax.faces.component.UIComponent component,
                                       Object rowKey)
Gets a string version of a key that identifies the row with the given rowkey. This string key can be used on the client-side to identify the row. If a string key for the given rowkey does not exist, then a new one is created. The lifespan of this string rowkey is entirely upto each implementation. Implementors must ensure that if a particular row is still present on the client-side, then its string key must also continue to be valid.

Parameters:
rowKey - the rowkey to convert into a client key. Note that null is special and is not allowed.

getRowKey

public abstract Object getRowKey(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component,
                                 String clientRowKey)
Gets the corresponding server-side rowkey object from the given client-side string key. If the string key has expired, implementors should return null. However, if any part of a row is still present on the client-side, its corresponding string-key may not expire.

Parameters:
clientRowKey - the string key
Returns:
null, if the string key has expired, or never existed.

replaceRowKey

public boolean replaceRowKey(javax.faces.context.FacesContext context,
                             javax.faces.component.UIComponent component,
                             Object oldRowKey,
                             Object newRowKey)
Replaces an old row key with a new key if the old row key exists. If the old row key is successfully replaced, the new row key will be mapped to the existing client row key.

Parameters:
context -
component -
oldRowKey - row key to replace (may not exist)
newRowKey - new row key
Returns:
true if old row key existed and was replaced, false otherwise


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.