org.apache.tapestry.record
Interface ClientPropertyPersistenceScope

All Known Implementing Classes:
AbstractPrefixedClientPropertyPersistenceScope, AppClientPropertyPersistenceScope, PageClientPropertyPersistenceScope

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
 String constructParameterName(String pageName)
          Constructs a parameter name for a particular page name.
 String extractPageName(String parameterName)
          Extracts a page name from a query parameter name.
 boolean isParameterForScope(String parameterName)
          Checks a parameter to see if it was the result of constructParameterName(String) for this persistence scope.
 boolean shouldEncodeState(ServiceEncoding encoding, String pageName, PersistentPropertyData data)
          Determines whether state should be encoded for the request.
 

Method Detail

shouldEncodeState

boolean shouldEncodeState(ServiceEncoding encoding,
                          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 - The data to check.
Returns:
true if state should be encoded into the encoding, false otherwise

constructParameterName

String constructParameterName(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.
Returns:
a query parameter name that identifies the page and this client persistence scope.

isParameterForScope

boolean isParameterForScope(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

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

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


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.