org.tynamo.conversations.services
Class ConversationalPersistentFieldStrategy

java.lang.Object
  extended by org.tynamo.conversations.services.ConversationalPersistentFieldStrategy
All Implemented Interfaces:
org.apache.tapestry5.services.PersistentFieldStrategy

public class ConversationalPersistentFieldStrategy
extends Object
implements org.apache.tapestry5.services.PersistentFieldStrategy


Constructor Summary
ConversationalPersistentFieldStrategy(org.apache.tapestry5.services.Request request, ConversationManager conversationManager)
           
 
Method Summary
protected  Object convertApplicationValueToPersisted(Object newValue)
          Hook that allows a value to be converted as it is written to the session.
protected  Object convertPersistedToApplicationValue(Object persistedValue)
          Converts a persisted value stored in the session back into an application value.
protected  void didReadChange(org.apache.tapestry5.services.Session session, String attributeName)
          Called after each key is read by gatherFieldChanges(String).
 void discardChanges(String pageName)
           
 Collection<org.apache.tapestry5.services.PersistentFieldChange> gatherFieldChanges(String pageName)
           
static boolean isBlank(String input)
           
 void postChange(String pageName, String componentId, String fieldName, Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversationalPersistentFieldStrategy

public ConversationalPersistentFieldStrategy(org.apache.tapestry5.services.Request request,
                                             ConversationManager conversationManager)
Method Detail

gatherFieldChanges

public final Collection<org.apache.tapestry5.services.PersistentFieldChange> gatherFieldChanges(String pageName)
Specified by:
gatherFieldChanges in interface org.apache.tapestry5.services.PersistentFieldStrategy

discardChanges

public void discardChanges(String pageName)
Specified by:
discardChanges in interface org.apache.tapestry5.services.PersistentFieldStrategy

didReadChange

protected void didReadChange(org.apache.tapestry5.services.Session session,
                             String attributeName)
Called after each key is read by gatherFieldChanges(String). This implementation does nothing, subclasses may override.

Parameters:
session - the session from which a value was just read
attributeName - the name of the attribute used to read a value

isBlank

public static boolean isBlank(String input)

postChange

public final void postChange(String pageName,
                             String componentId,
                             String fieldName,
                             Object newValue)
Specified by:
postChange in interface org.apache.tapestry5.services.PersistentFieldStrategy

convertApplicationValueToPersisted

protected Object convertApplicationValueToPersisted(Object newValue)
Hook that allows a value to be converted as it is written to the session. Passed the new value provided by the application, returns the object to be stored in the session. This implementation simply returns the provided value.

Parameters:
newValue - non-null value
Returns:
persisted value
See Also:
convertPersistedToApplicationValue(Object)

convertPersistedToApplicationValue

protected Object convertPersistedToApplicationValue(Object persistedValue)
Converts a persisted value stored in the session back into an application value. This implementation returns the persisted value as is.

Parameters:
persistedValue - non-null persisted value
Returns:
application value
See Also:
convertPersistedToApplicationValue(Object)


Copyright © 2004-2010. All Rights Reserved.