Class AbstractBookmarkableMapper

    • Method Detail

      • pageMustHaveBeenCreatedBookmarkable

        protected abstract boolean pageMustHaveBeenCreatedBookmarkable()
        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

        Returns:
        true if hybrid URL requires page created bookmarkable, false otherwise.
      • getCompatibilityScore

        public int getCompatibilityScore​(org.apache.wicket.request.Request request)
      • processBookmarkable

        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.
        Parameters:
        pageClass -
        pageParameters -
        Returns:
        a IRequestHandler capable of processing the bookmarkable request.
      • processHybrid

        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. When the page identified by pageInfo was not available, the request should be treated as a bookmarkable request.
        Parameters:
        pageInfo -
        pageClass -
        pageParameters -
        renderCount -
        Returns:
        a IRequestHandler capable of processing the hybrid request.
      • processListener

        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.
        Parameters:
        pageComponentInfo -
        pageClass -
        pageParameters -
        Returns:
        a IRequestHandler that notifies an IRequestListener.
      • mapRequest

        public org.apache.wicket.request.IRequestHandler mapRequest​(org.apache.wicket.request.Request request)
      • mapHandler

        public org.apache.wicket.request.Url mapHandler​(org.apache.wicket.request.IRequestHandler requestHandler)
      • newPageParameters

        protected org.apache.wicket.request.mapper.parameter.PageParameters newPageParameters()
        Returns:
        a new instance of PageParameters that will be passed to the page/resource
      • resolveUserLocale

        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
        Returns:
        the Session or Request's locale to use for parsing any numbers in the request parameters
      • extractPageParameters

        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
      • segmentsMatch

        protected boolean segmentsMatch​(String mountedSegment,
                                        String urlSegment)
        Decides whether a segment from the mounted path matches with a segment from the requested url. A custom implementation of this class may use more complex logic to handle spelling errors
        Parameters:
        mountedSegment - the segment from the mounted path
        urlSegment - the segment from the request url
        Returns:
        true if the segments match
      • isCaseSensitiveMatch

        protected boolean isCaseSensitiveMatch()
        Returns:
        whether the matching of mounted segments against request's url ones should be case sensitive or not
      • setCaseSensitiveMatch

        public AbstractBookmarkableMapper setCaseSensitiveMatch​(boolean isCaseSensitive)
        Sets whether the matching of mounted segments against request's url ones should be case sensitive or not.
        Parameters:
        isCaseSensitive - a flag indicating whether the matching of mounted segments against request's url ones should be case sensitive or not
        Returns:
        this instance, for chaining
      • setPlaceholders

        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. If a mandatory parameter is not provided then the method returns false indicating that there is a problem. Optional parameters with missing values are just dropped.
        Parameters:
        parameters - The parameters with the values
        url - The url with the placeholders
        Returns:
        true if all mandatory parameters are properly substituted, false - otherwise