org.apache.wicket.core.request.mapper
Class BookmarkableMapper

java.lang.Object
  extended by org.apache.wicket.request.mapper.AbstractMapper
      extended by org.apache.wicket.core.request.mapper.AbstractComponentMapper
          extended by org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
              extended by org.apache.wicket.core.request.mapper.BookmarkableMapper
All Implemented Interfaces:
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 (BookmarkableListenerInterfaceRequestHandler)
  /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.UrlInfo
 
Constructor Summary
BookmarkableMapper()
          Construct.
BookmarkableMapper(IPageParametersEncoder pageParametersEncoder)
          Construct.
 
Method Summary
protected  Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
          Builds URL for the given AbstractBookmarkableMapper.UrlInfo instance.
 int getCompatibilityScore(Request request)
           
protected  boolean pageMustHaveBeenCreatedBookmarkable()
          Indicates whether hybrid RenderPageRequestHandler URL for page will be generated only if page has been created with bookmarkable URL.
protected  AbstractBookmarkableMapper.UrlInfo parseRequest(Request request)
          Parse the given request to an AbstractBookmarkableMapper.UrlInfo instance.
 
Methods inherited from class org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper
checkPageClass, checkPageInstance, getPageInfo, mapHandler, mapRequest, processBookmarkable, processHybrid, processListener
 
Methods inherited from class org.apache.wicket.core.request.mapper.AbstractComponentMapper
encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameter, requestListenerInterfaceFromString, requestListenerInterfaceToString
 
Methods inherited from class org.apache.wicket.request.mapper.AbstractMapper
encodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, urlStartsWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BookmarkableMapper

public BookmarkableMapper(IPageParametersEncoder pageParametersEncoder)
Construct.

Parameters:
pageParametersEncoder -

BookmarkableMapper

public BookmarkableMapper()
Construct.

Method Detail

buildUrl

protected Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
Description copied from class: AbstractBookmarkableMapper
Builds URL for the given AbstractBookmarkableMapper.UrlInfo instance. The URL this method produces must be parseable by the AbstractBookmarkableMapper.parseRequest(Request) method.

Specified by:
buildUrl in class AbstractBookmarkableMapper
Returns:
Url result URL
See Also:
AbstractBookmarkableMapper.buildUrl(AbstractBookmarkableMapper.UrlInfo)

parseRequest

protected AbstractBookmarkableMapper.UrlInfo parseRequest(Request request)
Description copied from class: AbstractBookmarkableMapper
Parse the given request to an AbstractBookmarkableMapper.UrlInfo instance.

Specified by:
parseRequest in class AbstractBookmarkableMapper
Returns:
UrlInfo instance or null if this encoder can not handle the request
See Also:
AbstractBookmarkableMapper.parseRequest(org.apache.wicket.request.Request)

pageMustHaveBeenCreatedBookmarkable

protected boolean pageMustHaveBeenCreatedBookmarkable()
Description copied from class: AbstractBookmarkableMapper
Indicates whether hybrid 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

Specified by:
pageMustHaveBeenCreatedBookmarkable in class AbstractBookmarkableMapper
Returns:
true if hybrid URL requires page created bookmarkable, false otherwise.
See Also:
AbstractBookmarkableMapper.pageMustHaveBeenCreatedBookmarkable()

getCompatibilityScore

public int getCompatibilityScore(Request request)
Specified by:
getCompatibilityScore in interface IRequestMapper
Specified by:
getCompatibilityScore in class AbstractBookmarkableMapper
See Also:
AbstractBookmarkableMapper.getCompatibilityScore(org.apache.wicket.request.Request)


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.