public abstract class AbstractSessionPersistentFieldStrategy extends Object implements PersistentFieldStrategy
Modifier | Constructor and Description |
---|---|
protected |
AbstractSessionPersistentFieldStrategy(String prefix,
Request request) |
Modifier and Type | Method and Description |
---|---|
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(Session session,
String attributeName)
Called after each key is read by
gatherFieldChanges(String) . |
void |
discardChanges(String pageName)
Discards any saved changes for the name page.
|
Collection<PersistentFieldChange> |
gatherFieldChanges(String pageName)
Finds all persistent changes previously stored for the named page (for the current active session or client).
|
void |
postChange(String pageName,
String componentId,
String fieldName,
Object newValue)
Posts a change of a persistent property.
|
protected AbstractSessionPersistentFieldStrategy(String prefix, Request request)
public final Collection<PersistentFieldChange> gatherFieldChanges(String pageName)
PersistentFieldStrategy
gatherFieldChanges
in interface PersistentFieldStrategy
public void discardChanges(String pageName)
PersistentFieldStrategy
discardChanges
in interface PersistentFieldStrategy
pageName
- logical name of page whose field persistent data should be discardedprotected void didReadChange(Session session, String attributeName)
gatherFieldChanges(String)
. This implementation does nothing,
subclasses may override.session
- the session from which a value was just readattributeName
- the name of the attribute used to read a valuepublic final void postChange(String pageName, String componentId, String fieldName, Object newValue)
PersistentFieldStrategy
postChange
in interface PersistentFieldStrategy
pageName
- the name of the page containing the componentcomponentId
- the nested id path of the component (or null for the page's root component)fieldName
- the name of the field whose persistent value has changednewValue
- the new value for the field, possibly nullprotected Object convertApplicationValueToPersisted(Object newValue)
newValue
- non-null valueconvertPersistedToApplicationValue(Object)
protected Object convertPersistedToApplicationValue(Object persistedValue)
persistedValue
- non-null persisted valueconvertPersistedToApplicationValue(Object)
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.