Package org.uberfire.mvp.impl
Class DefaultPlaceRequest
- java.lang.Object
-
- org.uberfire.mvp.impl.DefaultPlaceRequest
-
- All Implemented Interfaces:
PlaceRequest
- Direct Known Subclasses:
ConditionalPlaceRequest,ExternalPathPlaceRequest,ForcedPlaceRequest,PathPlaceRequest
@Portable public class DefaultPlaceRequest extends Object implements PlaceRequest
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringidentifierprotected Map<String,String>parameters-
Fields inherited from interface org.uberfire.mvp.PlaceRequest
NOWHERE
-
-
Constructor Summary
Constructors Constructor Description DefaultPlaceRequest()DefaultPlaceRequest(String identifier)Creates a place request for the given place ID.DefaultPlaceRequest(String identifier, Map<String,String> parameters)Creates a place request for the given place ID with the given state parameters for that place.DefaultPlaceRequest(String identifier, Map<String,String> parameters, boolean updateLocationBar)Creates a place request for the given place ID, with the given state parameters for that place, and the given preference of whether or not the browser's location bar should be updated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PlaceRequestaddParameter(String name, String value)PlaceRequestclone()booleanequals(Object o)StringgetFullIdentifier()StringgetIdentifier()StringgetParameter(String key, String defaultValue)Set<String>getParameterNames()Map<String,String>getParameters()inthashCode()booleanisUpdateLocationBarAllowed()Indicates whether or not the Workbench framework should add a browser history item when navigating to this place.static PlaceRequestparse(CharSequence partNameAndParams)Creates a new place request from a string that encodes a place ID and optional parameters in standard URL query syntax.voidsetIdentifier(String identifier)voidsetUpdateLocationBar(boolean updateLocationBar)StringtoString()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.uberfire.mvp.PlaceRequest
asString, getPath
-
-
-
-
Constructor Detail
-
DefaultPlaceRequest
public DefaultPlaceRequest()
-
DefaultPlaceRequest
public DefaultPlaceRequest(String identifier)
Creates a place request for the given place ID.- Parameters:
identifier- The place ID, or an empty string for the default place.
-
DefaultPlaceRequest
public DefaultPlaceRequest(String identifier, Map<String,String> parameters)
Creates a place request for the given place ID with the given state parameters for that place.- Parameters:
identifier- The place ID, or an empty string for the default place.parameters- Place-specific parameters to pass to the place. Must not be null.
-
DefaultPlaceRequest
public DefaultPlaceRequest(String identifier, Map<String,String> parameters, boolean updateLocationBar)
Creates a place request for the given place ID, with the given state parameters for that place, and the given preference of whether or not the browser's location bar should be updated.- Parameters:
identifier- The place ID, or an empty string for the default place.parameters- Place-specific parameters to pass to the place. Must not be null.updateLocationBar- If true, the browser's history will be updated with this place request. If false, the location bar will not be modified as a result of this place request.
-
-
Method Detail
-
parse
public static PlaceRequest parse(CharSequence partNameAndParams)
Creates a new place request from a string that encodes a place ID and optional parameters in standard URL query syntax.For example, the following returns a PlaceRequest with identifier
MyPlaceIDand two parameters,param1andparam2.DefaultPlaceRequest.parse("MyPlaceID?param1=val1¶m2=val2")- Parameters:
partNameAndParams- specification of the place ID and optional parameter map. Special characters in the identifier, key name, or key value can be escaped using URL encoding: for '%' use '%25'; for '&' use '%26'; for '=' use '%3d'; for '?' use '%3f'.- Returns:
- a new PlaceRequest configured according to the given string.
-
getIdentifier
public String getIdentifier()
- Specified by:
getIdentifierin interfacePlaceRequest
-
setIdentifier
public void setIdentifier(String identifier)
- Specified by:
setIdentifierin interfacePlaceRequest
-
getFullIdentifier
public String getFullIdentifier()
- Specified by:
getFullIdentifierin interfacePlaceRequest
-
getParameter
public String getParameter(String key, String defaultValue)
- Specified by:
getParameterin interfacePlaceRequest
-
getParameterNames
public Set<String> getParameterNames()
- Specified by:
getParameterNamesin interfacePlaceRequest
-
getParameters
public Map<String,String> getParameters()
- Specified by:
getParametersin interfacePlaceRequest
-
addParameter
public PlaceRequest addParameter(String name, String value)
- Specified by:
addParameterin interfacePlaceRequest
-
clone
public PlaceRequest clone()
- Specified by:
clonein interfacePlaceRequest- Overrides:
clonein classObject
-
isUpdateLocationBarAllowed
public boolean isUpdateLocationBarAllowed()
Description copied from interface:PlaceRequestIndicates whether or not the Workbench framework should add a browser history item when navigating to this place.- Specified by:
isUpdateLocationBarAllowedin interfacePlaceRequest
-
setUpdateLocationBar
public void setUpdateLocationBar(boolean updateLocationBar)
- Specified by:
setUpdateLocationBarin interfacePlaceRequest
-
-