Back to GWTP Home

com.gwtplatform.mvp.client.proxy
Interface TokenFormatter

Package class diagram package TokenFormatter
All Known Implementing Classes:
ParameterTokenFormatter, ParameterTokenFormatterOld, RouteTokenFormatter

public interface TokenFormatter

Formats tokens from String values to PlaceRequest and PlaceRequest hierarchies and vice-versa. An implementation is provided in ParameterTokenFormatter, see the documentation of this class for details.


Method Summary
 String toHistoryToken(List<PlaceRequest> placeRequestHierarchy)
          Converts a place request hierarchy (a list of PlaceRequest) into a history token.
 PlaceRequest toPlaceRequest(String placeToken)
          Converts a place token into a PlaceRequest.
 List<PlaceRequest> toPlaceRequestHierarchy(String historyToken)
          Converts a history token into a place request hierarchy (a list of PlaceRequest).
 String toPlaceToken(PlaceRequest placeRequest)
          Converts a PlaceRequest into a place token.
 

Method Detail

toHistoryToken

String toHistoryToken(List<PlaceRequest> placeRequestHierarchy)
                      throws TokenFormatException
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.

Parameters:
placeRequestHierarchy - The place request hierarchy.
Returns:
The history token, URL encoded.
Throws:
TokenFormatException - if there is an error converting.

toPlaceRequest

PlaceRequest toPlaceRequest(String placeToken)
                            throws TokenFormatException
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.

Parameters:
placeToken - The place token.
Returns:
The place request.
Throws:
TokenFormatException - if there is an error converting.

toPlaceRequestHierarchy

List<PlaceRequest> toPlaceRequestHierarchy(String historyToken)
                                           throws TokenFormatException
Converts a history token into a place request hierarchy (a list of PlaceRequest).

Parameters:
historyToken - The history token.
Returns:
The place request hierarchy.
Throws:
TokenFormatException - if there is an error converting.

toPlaceToken

String toPlaceToken(PlaceRequest placeRequest)
                    throws TokenFormatException
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.

Parameters:
placeRequest - The place request.
Returns:
The place token, URL encoded.
Throws:
TokenFormatException - if there is an error converting.

Back to GWTP Home

Copyright © 2010-2013 ArcBees. All Rights Reserved.