org.apache.tapestry.record
Class AbstractPrefixedClientPropertyPersistenceScope

java.lang.Object
  extended byorg.apache.tapestry.record.AbstractPrefixedClientPropertyPersistenceScope
All Implemented Interfaces:
ClientPropertyPersistenceScope
Direct Known Subclasses:
AppClientPropertyPersistenceScope, PageClientPropertyPersistenceScope

public abstract class AbstractPrefixedClientPropertyPersistenceScope
extends java.lang.Object
implements ClientPropertyPersistenceScope

Base implementation of ClientPropertyPersistenceScope wherein the scopes are recognized via a prefix on the page name to form the query parameter name. Capiche?

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
AbstractPrefixedClientPropertyPersistenceScope(java.lang.String prefix)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.record.ClientPropertyPersistenceScope
shouldEncodeState
 

Constructor Detail

AbstractPrefixedClientPropertyPersistenceScope

public AbstractPrefixedClientPropertyPersistenceScope(java.lang.String prefix)
Method Detail

constructParameterName

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

Specified by:
constructParameterName in interface ClientPropertyPersistenceScope
Parameters:
pageName - the name of the page for which a corresponding parameter name should be generated.

isParameterForScope

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

Specified by:
isParameterForScope in interface ClientPropertyPersistenceScope
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)
Description copied from interface: ClientPropertyPersistenceScope
Extracts a page name from a query parameter name.

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