public class PackageMapper extends AbstractBookmarkableMapper
To mount this mapper onto a path use the WebApplication.mountPackage(String, Class), ex:
MyApp#init() {
super.init();
mountPackage("/my/path", MyPage.class);
}
will result in urls like /my/path/MyPage
Page Class - Render (BookmarkablePageRequestHandler) /MyPage (will redirect to hybrid alternative if page is not stateless) Page Instance - Render Hybrid (RenderPageRequestHandler for pages that were created using bookmarkable URLs) /MyPage?2 Page Instance - Bookmarkable Listener (BookmarkableListenerInterfaceRequestHandler) /MyPage?2-click-foo-bar-baz /MyPage?2-click.1-foo-bar-baz (1 is behavior index) (these will redirect to hybrid if page is not stateless)
AbstractBookmarkableMapper.MountPathSegment, AbstractBookmarkableMapper.UrlInfomountSegments, pageParametersEncoder, pathSegments| Constructor and Description |
|---|
PackageMapper(String mountPath,
PackageName packageName)
Constructor.
|
PackageMapper(String mountPath,
PackageName packageName,
IPageParametersEncoder pageParametersEncoder)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Url |
buildUrl(AbstractBookmarkableMapper.UrlInfo info)
Builds URL for the given
AbstractBookmarkableMapper.UrlInfo instance. |
protected boolean |
checkPageClass(Class<? extends IRequestablePage> pageClass) |
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. |
protected String |
transformForUrl(String className)
Gives a chance to specializations of this mapper to transform the real class name to an alias
which is prettier to represent in the Url
|
protected String |
transformFromUrl(String classNameAlias)
Gives a chance to specializations of this mapper to transform the alias of the class name to
the real class name
|
checkPageInstance, extractPageParameters, getCompatibilityScore, getMatchedSegmentSizes, getPageInfo, getPathSegments, isCaseSensitiveMatch, isFixedSegment, mapHandler, mapRequest, processBookmarkable, processHybrid, processListener, segmentsMatch, setCaseSensitiveMatch, setPlaceholders, urlStartsWithMountedSegmentscleanClassName, encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameter, requestListenerInterfaceFromString, requestListenerInterfaceToStringencodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, safeSegmentGetter, urlStartsWithpublic PackageMapper(String mountPath, PackageName packageName)
packageName - public PackageMapper(String mountPath, PackageName packageName, IPageParametersEncoder pageParametersEncoder)
packageName - pageParametersEncoder - protected Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
AbstractBookmarkableMapperAbstractBookmarkableMapper.UrlInfo instance. The URL this method produces must be
parseable by the AbstractBookmarkableMapper.parseRequest(Request) method.buildUrl in class AbstractBookmarkableMapperprotected AbstractBookmarkableMapper.UrlInfo parseRequest(Request request)
AbstractBookmarkableMapperAbstractBookmarkableMapper.UrlInfo instance.parseRequest in class AbstractBookmarkableMappernull if this encoder can not handle the requestprotected String transformFromUrl(String classNameAlias)
classNameAlias - the alias for the class nameprotected String transformForUrl(String className)
className - the real class nameprotected boolean pageMustHaveBeenCreatedBookmarkable()
AbstractBookmarkableMapperRenderPageRequestHandler 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
pageMustHaveBeenCreatedBookmarkable in class AbstractBookmarkableMappertrue if hybrid URL requires page created bookmarkable,
false otherwise.protected boolean checkPageClass(Class<? extends IRequestablePage> pageClass)
checkPageClass in class AbstractBookmarkableMapperCopyright © 2006–2021 Apache Software Foundation. All rights reserved.