Back to GWTP Home

com.gwtplatform.mvp.client.proxy
Class ParameterTokenFormatterOld

Package class diagram package ParameterTokenFormatterOld
java.lang.Object
  extended by com.gwtplatform.mvp.client.proxy.ParameterTokenFormatterOld
All Implemented Interfaces:
TokenFormatter

Deprecated. Use ParameterTokenFormatter instead.

public final class ParameterTokenFormatterOld
extends Object
implements TokenFormatter

Formats tokens from String values to PlaceRequest and PlaceRequest hierarchies and vice-versa. The default implementation uses:

These symbols cannot be used in a name token. If one of the separating symbol is encountered in a parameter or a value it is escaped by being query-string encoded (see URL.encodeQueryString(String)). As a consequence, a custom ParameterTokenFormatterOld must use separators that are modified when passed to URL.encodeQueryString(String).

For example, ParameterTokenFormatterOld would parse:

 nameToken1;param1.1=value1.1;param1.2=value1.2/nameToken2/nameToken3;param3.1=value%2f3%3d1
 
Into the following hierarchy of PlaceRequest:

 {
   { "nameToken1", { {"param1.1", "value1.1"}, {"parame1.2","value1.2"} },
     "nameToken2", {},
     "nameToken3", { {"param3.1", "value/3=1"} } }
 }
 
If you want to use different symbols as separator, use the ParameterTokenFormatterOld(String, String, String) constructor.

Author:
Philippe Beaudoin, Yannis Gonianakis

Field Summary
protected static String DEFAULT_HIERARCHY_SEPARATOR
          Deprecated.  
protected static String DEFAULT_PARAM_SEPARATOR
          Deprecated.  
protected static String DEFAULT_VALUE_SEPARATOR
          Deprecated.  
 
Constructor Summary
ParameterTokenFormatterOld()
          Deprecated. Builds a ParameterTokenFormatterOld using the default separators.
ParameterTokenFormatterOld(String hierarchySeparator, String paramSeparator, String valueSeparator)
          Deprecated. This constructor makes it possible to use custom separators in your token formatter.
 
Method Summary
 String toHistoryToken(List<PlaceRequest> placeRequestHierarchy)
          Deprecated. Converts a place request hierarchy (a list of PlaceRequest) into a history token.
 PlaceRequest toPlaceRequest(String placeToken)
          Deprecated. Converts a place token into a PlaceRequest.
 List<PlaceRequest> toPlaceRequestHierarchy(String historyToken)
          Deprecated. Converts a history token into a place request hierarchy (a list of PlaceRequest).
 String toPlaceToken(PlaceRequest placeRequest)
          Deprecated. Converts a PlaceRequest into a place token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HIERARCHY_SEPARATOR

protected static final String DEFAULT_HIERARCHY_SEPARATOR
Deprecated. 
See Also:
Constant Field Values

DEFAULT_PARAM_SEPARATOR

protected static final String DEFAULT_PARAM_SEPARATOR
Deprecated. 
See Also:
Constant Field Values

DEFAULT_VALUE_SEPARATOR

protected static final String DEFAULT_VALUE_SEPARATOR
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

ParameterTokenFormatterOld

@Inject
public ParameterTokenFormatterOld()
Deprecated. 
Builds a ParameterTokenFormatterOld using the default separators.


ParameterTokenFormatterOld

public ParameterTokenFormatterOld(String hierarchySeparator,
                                  String paramSeparator,
                                  String valueSeparator)
Deprecated. 
This constructor makes it possible to use custom separators in your token formatter. The separators must be 1-letter strings, they must all be different from one another, and they must be encoded when ran through URL.encodeQueryString(String))

Parameters:
hierarchySeparator - The symbol used to separate PlaceRequest in a hierarchy. Must be a 1-character string and can't be %.
paramSeparator - The symbol used to separate parameters in a PlaceRequest. Must be a 1-character string and can't be %.
valueSeparator - The symbol used to separate the parameter name from its value. Must be a 1-character string and can't be %.
Method Detail

toHistoryToken

public String toHistoryToken(List<PlaceRequest> placeRequestHierarchy)
                      throws TokenFormatException
Deprecated. 
Description copied from interface: TokenFormatter
Converts a place request hierarchy (a list of PlaceRequest) into a history token. The history token will not be fully query encoded, it may still contain some unescaped separators. However, these separators can be encoded and it will still work, making the scheme robust to systems that force encoding these characters like some email apps.

Specified by:
toHistoryToken in interface TokenFormatter
Parameters:
placeRequestHierarchy - The place request hierarchy.
Returns:
The history token, URL encoded.
Throws:
TokenFormatException - if there is an error converting.

toPlaceRequest

public PlaceRequest toPlaceRequest(String placeToken)
                            throws TokenFormatException
Deprecated. 
Description copied from interface: TokenFormatter
Converts a place token into a PlaceRequest. A place token is different than a history token, since the history token can contain a hierarchy of different place requests.

Specified by:
toPlaceRequest in interface TokenFormatter
Parameters:
placeToken - The place token.
Returns:
The place request.
Throws:
TokenFormatException - if there is an error converting.

toPlaceRequestHierarchy

public List<PlaceRequest> toPlaceRequestHierarchy(String historyToken)
                                           throws TokenFormatException
Deprecated. 
Description copied from interface: TokenFormatter
Converts a history token into a place request hierarchy (a list of PlaceRequest).

Specified by:
toPlaceRequestHierarchy in interface TokenFormatter
Parameters:
historyToken - The history token.
Returns:
The place request hierarchy.
Throws:
TokenFormatException - if there is an error converting.

toPlaceToken

public String toPlaceToken(PlaceRequest placeRequest)
Deprecated. 
Description copied from interface: TokenFormatter
Converts a PlaceRequest into a place token. A place token is different than a history token, since the history token can contain a hierarchy of different place requests. The history token will not be fully query encoded, it may still contain some unescaped separators. However, these separators can be encoded and it will still work, making the scheme robust to systems that force encoding these characters like some email apps.

Specified by:
toPlaceToken in interface TokenFormatter
Parameters:
placeRequest - The place request.
Returns:
The place token, URL encoded.

Back to GWTP Home

Copyright © 2010-2013 ArcBees. All Rights Reserved.