public abstract class AbstractBookmarkableMapper extends AbstractComponentMapper
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractBookmarkableMapper.MountPathSegment |
protected static class |
AbstractBookmarkableMapper.UrlInfo
Represents information stored in URL.
|
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
mountSegments |
protected org.apache.wicket.request.mapper.parameter.IPageParametersEncoder |
pageParametersEncoder |
protected List<AbstractBookmarkableMapper.MountPathSegment> |
pathSegments |
| Constructor and Description |
|---|
AbstractBookmarkableMapper()
Construct.
|
AbstractBookmarkableMapper(String mountPath,
org.apache.wicket.request.mapper.parameter.IPageParametersEncoder pageParametersEncoder) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.apache.wicket.request.Url |
buildUrl(AbstractBookmarkableMapper.UrlInfo info)
Builds URL for the given
AbstractBookmarkableMapper.UrlInfo instance. |
protected boolean |
checkPageClass(Class<? extends IRequestablePage> pageClass) |
protected boolean |
checkPageInstance(IRequestablePage page) |
protected org.apache.wicket.request.mapper.parameter.PageParameters |
extractPageParameters(org.apache.wicket.request.Request request,
org.apache.wicket.request.Url url)
Extracts the PageParameters from URL if there are any
|
int |
getCompatibilityScore(org.apache.wicket.request.Request request) |
protected int[] |
getMatchedSegmentSizes(org.apache.wicket.request.Url url) |
protected org.apache.wicket.request.mapper.info.PageInfo |
getPageInfo(IPageRequestHandler handler) |
protected List<AbstractBookmarkableMapper.MountPathSegment> |
getPathSegments(String[] segments) |
protected boolean |
isCaseSensitiveMatch() |
protected boolean |
isFixedSegment(String segment) |
org.apache.wicket.request.Url |
mapHandler(org.apache.wicket.request.IRequestHandler requestHandler) |
org.apache.wicket.request.IRequestHandler |
mapRequest(org.apache.wicket.request.Request request) |
protected org.apache.wicket.request.mapper.parameter.PageParameters |
newPageParameters() |
protected abstract boolean |
pageMustHaveBeenCreatedBookmarkable()
Indicates whether hybrid
RenderPageRequestHandler URL for page will be generated only
if page has been created with bookmarkable URL. |
protected abstract AbstractBookmarkableMapper.UrlInfo |
parseRequest(org.apache.wicket.request.Request request)
Parse the given request to an
AbstractBookmarkableMapper.UrlInfo instance. |
protected org.apache.wicket.request.IRequestHandler |
processBookmarkable(Class<? extends IRequestablePage> pageClass,
org.apache.wicket.request.mapper.parameter.PageParameters pageParameters)
Creates a
IRequestHandler that processes a bookmarkable request. |
protected org.apache.wicket.request.IRequestHandler |
processHybrid(org.apache.wicket.request.mapper.info.PageInfo pageInfo,
Class<? extends IRequestablePage> pageClass,
org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
Integer renderCount)
Creates a
IRequestHandler that processes a hybrid request. |
protected org.apache.wicket.request.IRequestHandler |
processListener(org.apache.wicket.request.mapper.info.PageComponentInfo pageComponentInfo,
Class<? extends IRequestablePage> pageClass,
org.apache.wicket.request.mapper.parameter.PageParameters pageParameters)
Creates a
IRequestHandler that notifies an IRequestListener. |
protected Locale |
resolveUserLocale()
Override
AbstractMapper.resolveLocale() to return the result of this method if you want to use
the user's session or request locale for parsing numbers from the page parameters |
protected boolean |
segmentsMatch(String mountedSegment,
String urlSegment)
Decides whether a segment from the mounted path matches with a segment
from the requested url.
|
AbstractBookmarkableMapper |
setCaseSensitiveMatch(boolean isCaseSensitive)
Sets whether the matching of mounted segments against request's url ones should be
case sensitive or not.
|
protected boolean |
setPlaceholders(org.apache.wicket.request.mapper.parameter.PageParameters parameters,
org.apache.wicket.request.Url url)
Replaces mandatory and optional parameters with their values.
|
protected boolean |
urlStartsWithMountedSegments(org.apache.wicket.request.Url url) |
cleanClassName, encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameterprotected final List<AbstractBookmarkableMapper.MountPathSegment> pathSegments
protected final String[] mountSegments
protected final org.apache.wicket.request.mapper.parameter.IPageParametersEncoder pageParametersEncoder
public AbstractBookmarkableMapper()
public AbstractBookmarkableMapper(String mountPath, org.apache.wicket.request.mapper.parameter.IPageParametersEncoder pageParametersEncoder)
protected abstract AbstractBookmarkableMapper.UrlInfo parseRequest(org.apache.wicket.request.Request request)
AbstractBookmarkableMapper.UrlInfo instance.request - null if this encoder can not handle the requestprotected abstract org.apache.wicket.request.Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
AbstractBookmarkableMapper.UrlInfo instance. The URL this method produces must be
parseable by the parseRequest(Request) method.info - protected abstract boolean pageMustHaveBeenCreatedBookmarkable()
RenderPageRequestHandler URL for page will be generated only
if page has been created with bookmarkable URL.
For generic bookmarkable encoders this method should return true. For explicit
(mounted) encoders this method should return false
true if hybrid URL requires page created bookmarkable,
false otherwise.public int getCompatibilityScore(org.apache.wicket.request.Request request)
protected org.apache.wicket.request.IRequestHandler processBookmarkable(Class<? extends IRequestablePage> pageClass, org.apache.wicket.request.mapper.parameter.PageParameters pageParameters)
IRequestHandler that processes a bookmarkable request.pageClass - pageParameters - IRequestHandler capable of processing the bookmarkable request.protected org.apache.wicket.request.IRequestHandler processHybrid(org.apache.wicket.request.mapper.info.PageInfo pageInfo,
Class<? extends IRequestablePage> pageClass,
org.apache.wicket.request.mapper.parameter.PageParameters pageParameters,
Integer renderCount)
IRequestHandler that processes a hybrid request. When the page identified
by pageInfo was not available, the request should be treated as a bookmarkable
request.pageInfo - pageClass - pageParameters - renderCount - IRequestHandler capable of processing the hybrid request.protected org.apache.wicket.request.IRequestHandler processListener(org.apache.wicket.request.mapper.info.PageComponentInfo pageComponentInfo,
Class<? extends IRequestablePage> pageClass,
org.apache.wicket.request.mapper.parameter.PageParameters pageParameters)
IRequestHandler that notifies an IRequestListener.pageComponentInfo - pageClass - pageParameters - IRequestHandler that notifies an IRequestListener.public org.apache.wicket.request.IRequestHandler mapRequest(org.apache.wicket.request.Request request)
protected boolean checkPageInstance(IRequestablePage page)
protected boolean checkPageClass(Class<? extends IRequestablePage> pageClass)
public org.apache.wicket.request.Url mapHandler(org.apache.wicket.request.IRequestHandler requestHandler)
protected final org.apache.wicket.request.mapper.info.PageInfo getPageInfo(IPageRequestHandler handler)
protected org.apache.wicket.request.mapper.parameter.PageParameters newPageParameters()
PageParameters that will be passed to the page/resourceprotected Locale resolveUserLocale()
AbstractMapper.resolveLocale() to return the result of this method if you want to use
the user's session or request locale for parsing numbers from the page parametersprotected List<AbstractBookmarkableMapper.MountPathSegment> getPathSegments(String[] segments)
protected boolean isFixedSegment(String segment)
protected org.apache.wicket.request.mapper.parameter.PageParameters extractPageParameters(org.apache.wicket.request.Request request,
org.apache.wicket.request.Url url)
protected int[] getMatchedSegmentSizes(org.apache.wicket.request.Url url)
protected boolean segmentsMatch(String mountedSegment, String urlSegment)
mountedSegment - the segment from the mounted pathurlSegment - the segment from the request urltrue if the segments matchprotected boolean isCaseSensitiveMatch()
public AbstractBookmarkableMapper setCaseSensitiveMatch(boolean isCaseSensitive)
isCaseSensitive - a flag indicating whether the matching of mounted segments against request's
url ones should be case sensitive or notprotected boolean setPlaceholders(org.apache.wicket.request.mapper.parameter.PageParameters parameters,
org.apache.wicket.request.Url url)
false
indicating that there is a problem.
Optional parameters with missing values are just dropped.parameters - The parameters with the valuesurl - The url with the placeholderstrue if all mandatory parameters are properly substituted,
false - otherwiseprotected boolean urlStartsWithMountedSegments(org.apache.wicket.request.Url url)
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.