org.apache.tapestry.record
Class AbstractPrefixedClientPropertyPersistenceScope

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

public abstract class AbstractPrefixedClientPropertyPersistenceScope
extends 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(String prefix)
           
 
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 ClientPropertyPersistenceScope.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(String prefix)
Method Detail

constructParameterName

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

isParameterForScope

public boolean isParameterForScope(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 String extractPageName(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 ClientPropertyPersistenceScope.isParameterForScope(String) must return true
Returns:
the name of the page


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