org.apache.tapestry.record
Interface ClientPropertyPersistenceScope

All Known Implementing Classes:
AbstractPrefixedClientPropertyPersistenceScope

public interface ClientPropertyPersistenceScope

Service tapestry.persist.ClientPropertyPersistenceScope. Determines whether a particular property needs to be persisted or not.

Since:
4.0
Author:
Mindbridge
See Also:
ClientPropertyPersistenceStrategy

Method Summary
 java.lang.String constructParameterName(java.lang.String pageName)
          Constructs a parameter name for a particular page name.
 java.lang.String extractPageName(java.lang.String parameterName)
          Extracts a page name from a query parameter name.
 boolean isParameterForScope(java.lang.String parameterName)
          Checks a parameter to see if it was the result of constructParameterName(String) for this persistence scope.
 boolean shouldEncodeState(ServiceEncoding encoding, java.lang.String pageName, PersistentPropertyData data)
          Determines whether state should be encoded for the request.
 

Method Detail

shouldEncodeState

public boolean shouldEncodeState(ServiceEncoding encoding,
                                 java.lang.String pageName,
                                 PersistentPropertyData data)
Determines whether state should be encoded for the request.

Parameters:
encoding - identifies the service, URL and base set of parameters
pageName - the page for which data is potentially to be encoded
data -
Returns:
true if state should be encoded into the encoding, false otherwise

constructParameterName

public java.lang.String constructParameterName(java.lang.String pageName)
Constructs a parameter name for a particular page name. The parameter name can be recognized (in a later request) by the isParameterForScope(String) method.

Parameters:
pageName - the name of the page for which a corresponding parameter name should be generated.

isParameterForScope

public boolean isParameterForScope(java.lang.String parameterName)
Checks a parameter to see if it was the result of constructParameterName(String) for this persistence scope.

Parameters:
parameterName - a query parameter name
Returns:
true if the parameterName was genereted (i.e., is properly prefixed) by this scope, false otherwise.

extractPageName

public java.lang.String extractPageName(java.lang.String parameterName)
Extracts a page name from a query parameter name.

Parameters:
parameterName - the paramter name, for which {@link #isParameterForScope(String) must return true
Returns:
the name of the page