Class BookmarkableMapper
- java.lang.Object
-
- org.apache.wicket.request.mapper.AbstractMapper
-
- org.apache.wicket.core.request.mapper.AbstractComponentMapper
-
- org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
-
- org.apache.wicket.core.request.mapper.BookmarkableMapper
-
- All Implemented Interfaces:
org.apache.wicket.request.IRequestMapper
public class BookmarkableMapper extends AbstractBookmarkableMapper
Decodes and encodes the following URLs:Page Class - Render (BookmarkablePageRequestHandler) /wicket/bookmarkable/org.apache.wicket.MyPage (will redirect to hybrid alternative if page is not stateless) Page Instance - Render Hybrid (RenderPageRequestHandler for pages that were created using bookmarkable URLs) /wicket/bookmarkable/org.apache.wicket.MyPage?2 Page Instance - Bookmarkable Listener (BookmarkableListenerRequestHandler) /wicket/bookmarkable/org.apache.wicket.MyPage?2-click-foo-bar-baz /wicket/bookmarkable/org.apache.wicket.MyPage?2-click.1-foo-bar-baz (1 is behavior index) (these will redirect to hybrid if page is not stateless)
- Author:
- Matej Knopp
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
AbstractBookmarkableMapper.MountPathSegment, AbstractBookmarkableMapper.UrlInfo
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
mountSegments, pageParametersEncoder, pathSegments
-
-
Constructor Summary
Constructors Constructor Description BookmarkableMapper()Construct.BookmarkableMapper(org.apache.wicket.request.mapper.parameter.IPageParametersEncoder pageParametersEncoder)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.wicket.request.UrlbuildUrl(AbstractBookmarkableMapper.UrlInfo info)Builds URL for the givenAbstractBookmarkableMapper.UrlInfoinstance.intgetCompatibilityScore(org.apache.wicket.request.Request request)protected booleanpageMustHaveBeenCreatedBookmarkable()Indicates whether hybridRenderPageRequestHandlerURL for page will be generated only if page has been created with bookmarkable URL.protected AbstractBookmarkableMapper.UrlInfoparseRequest(org.apache.wicket.request.Request request)Parse the given request to anAbstractBookmarkableMapper.UrlInfoinstance.protected booleanurlStartsWithAndHasPageClass(org.apache.wicket.request.Url url, java.lang.String... segments)Checks whether the url starts with the given segments and additionally checks whether the following segment is non-empty-
Methods inherited from class org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
checkPageClass, checkPageInstance, extractPageParameters, getMatchedSegmentSizes, getPageInfo, getPathSegments, isCaseSensitiveMatch, isFixedSegment, mapHandler, mapRequest, newPageParameters, processBookmarkable, processHybrid, processListener, resolveUserLocale, segmentsMatch, setCaseSensitiveMatch, setPlaceholders, urlStartsWithMountedSegments
-
Methods inherited from class org.apache.wicket.core.request.mapper.AbstractComponentMapper
cleanClassName, encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameter
-
-
-
-
Method Detail
-
buildUrl
protected org.apache.wicket.request.Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
Description copied from class:AbstractBookmarkableMapperBuilds URL for the givenAbstractBookmarkableMapper.UrlInfoinstance. The URL this method produces must be parseable by theAbstractBookmarkableMapper.parseRequest(Request)method.- Specified by:
buildUrlin classAbstractBookmarkableMapper- Returns:
- Url result URL
-
parseRequest
protected AbstractBookmarkableMapper.UrlInfo parseRequest(org.apache.wicket.request.Request request)
Description copied from class:AbstractBookmarkableMapperParse the given request to anAbstractBookmarkableMapper.UrlInfoinstance.- Specified by:
parseRequestin classAbstractBookmarkableMapper- Returns:
- UrlInfo instance or
nullif this encoder can not handle the request
-
pageMustHaveBeenCreatedBookmarkable
protected boolean pageMustHaveBeenCreatedBookmarkable()
Description copied from class:AbstractBookmarkableMapperIndicates whether hybridRenderPageRequestHandlerURL 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 returnfalse- Specified by:
pageMustHaveBeenCreatedBookmarkablein classAbstractBookmarkableMapper- Returns:
trueif hybrid URL requires page created bookmarkable,falseotherwise.
-
getCompatibilityScore
public int getCompatibilityScore(org.apache.wicket.request.Request request)
- Specified by:
getCompatibilityScorein interfaceorg.apache.wicket.request.IRequestMapper- Overrides:
getCompatibilityScorein classAbstractBookmarkableMapper
-
urlStartsWithAndHasPageClass
protected boolean urlStartsWithAndHasPageClass(org.apache.wicket.request.Url url, java.lang.String... segments)Checks whether the url starts with the given segments and additionally checks whether the following segment is non-empty- Parameters:
url- The url to be checkedsegments- The expected leading segments- Returns:
trueif the url starts with the given segments and there is non-empty segment after them
-
-