@Immutable public class RequestParameterHandlerURLPathNamed extends AbstractRequestParameterHandlerNamed
IRequestParameterHandler that takes the request
parameters from the URL path. It build URLs in the form
basePath[/paramNameseparatorparamValue]*| Modifier and Type | Field and Description |
|---|---|
static char |
DEFAULT_SEPARATOR_CHAR
The separator char to be used if path based handling is enabled, to
separate name and value
|
DEFAULT_REQUEST_PARAMETER_DISPLAY_LOCALE, DEFAULT_REQUEST_PARAMETER_MENUITEM| Constructor and Description |
|---|
RequestParameterHandlerURLPathNamed()
Default constructor using
DEFAULT_SEPARATOR_CHAR as the separator. |
RequestParameterHandlerURLPathNamed(String sSeparator)
Constructor with a custom separator.
|
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.url.SimpleURL |
buildURL(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
String sBasePath,
Locale aDisplayLocale,
String sMenuItemID)
Build a URL based on the passed base path and an optional list of
parameters.
|
protected PhotonRequestParameters |
getParametersFromPath(String sPath) |
PhotonRequestParameters |
getParametersFromRequest(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Get all request parameters from the provided request.
|
PhotonRequestParameters |
getParametersFromURL(com.helger.commons.url.ISimpleURL aURL)
Get all request parameters from the provided URL.
|
String |
getSeparator() |
boolean |
isValidParameterName(String sParamName)
Check if the passed parameter name is valid according to the rules of this
parameter handler.
|
String |
toString() |
getRequestParamNameLocale, getRequestParamNameMenuItem, setRequestParamNameLocale, setRequestParamNameMenuItempublic static final char DEFAULT_SEPARATOR_CHAR
public RequestParameterHandlerURLPathNamed()
DEFAULT_SEPARATOR_CHAR as the separator.@Nonnull @Nonempty public String getSeparator()
null nor empty.@Nonnull protected PhotonRequestParameters getParametersFromPath(@Nonnull String sPath)
@Nonnull @ReturnsMutableCopy public PhotonRequestParameters getParametersFromRequest(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
IRequestParameterHandleraRequestScope - The current request scope. May not be null.null list of all parameters.@Nonnull @ReturnsMutableCopy public PhotonRequestParameters getParametersFromURL(@Nonnull com.helger.commons.url.ISimpleURL aURL)
IRequestParameterHandleraURL - The URL to extract the parameters from. May not be
null.null list of all parameters.@Nonnull public com.helger.commons.url.SimpleURL buildURL(@Nullable com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull @Nonempty String sBasePath, @Nullable Locale aDisplayLocale, @Nullable String sMenuItemID)
IRequestParameterHandleraRequestScope - Current request scope. May be null.sBasePath - The base path to use. May not be null and must NOT end
with a "/".aDisplayLocale - The display locale to use. May be null.sMenuItemID - The menu item ID to use. May be null.public boolean isValidParameterName(@Nonnull String sParamName)
AbstractRequestParameterHandlerNamedisValidParameterName in class AbstractRequestParameterHandlerNamedsParamName - The parameter name to check. May not be null.true if the parameter is valid, false
otherwise.public String toString()
toString in class AbstractRequestParameterHandlerNamedCopyright © 2014–2017 Philip Helger. All rights reserved.