org.overlord.sramp.ui.client.places
Class PlaceUtils

java.lang.Object
  extended by org.overlord.sramp.ui.client.places.PlaceUtils

public class PlaceUtils
extends Object

Some static utilities useful when dealing with places.

Author:
eric.wittmann@redhat.com

Method Summary
static String createPlaceToken(AbstractPagedPlace place, Object... extraParams)
          Common place token creation for places that support pagination.
static String createPlaceToken(Object... params)
          Creates a place token in the standard query-param string format.
static void fillPagedPlace(AbstractPagedPlace place, Map<String,String> params)
          Fills in the paged place with params found in the map.
static Map<String,String> parsePlaceToken(String placeToken)
          Parses the place token into a map of query parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parsePlaceToken

public static Map<String,String> parsePlaceToken(String placeToken)
Parses the place token into a map of query parameters. The expected format of any place token is a standard URL query-parameter formatted string.

Parameters:
placeToken - the place token
Returns:
a map of query params

createPlaceToken

public static String createPlaceToken(Object... params)
Creates a place token in the standard query-param string format. The query parameters should be passed in with a key and a value for each parameter. If one of the parameters should be present without a value, pass an empty string for its associated value. If the value of a param is null, it will be excluded from the token.

Parameters:
params - param/value pairs
Returns:
place token string

createPlaceToken

public static String createPlaceToken(AbstractPagedPlace place,
                                      Object... extraParams)
Common place token creation for places that support pagination.

Parameters:
place -
extraParams -

fillPagedPlace

public static void fillPagedPlace(AbstractPagedPlace place,
                                  Map<String,String> params)
Fills in the paged place with params found in the map.

Parameters:
place -
params -


Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.