Interface IPageProvider

  • All Known Subinterfaces:
    IPageAndComponentProvider
    All Known Implementing Classes:
    PageAndComponentProvider, PageProvider

    public interface IPageProvider
    Represents object capable of providing a page instance. In some cases the implementation class might now page class and page parameters without having the actual page instance. Thus it's recommended to call getPageParameters() instead of calling getPageInstance() .getPageParameters(). Same goes for page class.
    Author:
    Matej Knopp
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void detach()
      Detaches the page if it has been loaded.
      boolean doesProvideNewPage()
      Returns whether or not the page instance held by this provider has been instantiated by the provider.
      java.lang.Class<? extends IRequestablePage> getPageClass()
      Returns class of the page.
      java.lang.Integer getPageId()
      Returns the page id.
      IRequestablePage getPageInstance()
      Returns page instance specified by the constructor.
      org.apache.wicket.request.mapper.parameter.PageParameters getPageParameters()
      Returns PageParameters of the page.
      java.lang.Integer getRenderCount()
      Returns the number of times this page has been rendered.
      boolean hasPageInstance()
      If this provider returns existing page, regardless if it was already created by PageProvider itself or is or can be found in the data store.
      boolean wasExpired()
      Returns whether the provided page was expired prior to this access.
    • Method Detail

      • getPageInstance

        IRequestablePage getPageInstance()
                                  throws PageExpiredException
        Returns page instance specified by the constructor.
        Returns:
        page instance
        Throws:
        PageExpiredException - if the specified page could not have been found and the constructor used did not provide enough information to create new page instance
      • getPageParameters

        org.apache.wicket.request.mapper.parameter.PageParameters getPageParameters()
                                                                             throws PageExpiredException
        Returns PageParameters of the page.
        Returns:
        page parameters
        Throws:
        PageExpiredException - if the specified page could not have been found and the constructor used did not provide enough information to create new page instance
      • wasExpired

        boolean wasExpired()
        Returns whether the provided page was expired prior to this access.
        Returns:
        true> if the page was created after its original instance expired.
      • getPageClass

        java.lang.Class<? extends IRequestablePage> getPageClass()
                                                          throws PageExpiredException
        Returns class of the page.
        Returns:
        page class
        Throws:
        PageExpiredException - if the specified page could not have been found and the constructor used did not provide enough information to create new page instance
      • getPageId

        java.lang.Integer getPageId()
        Returns the page id.
        Returns:
        page id
      • getRenderCount

        java.lang.Integer getRenderCount()
        Returns the number of times this page has been rendered.
        Returns:
        the number of times this page has been rendered.
      • detach

        void detach()
        Detaches the page if it has been loaded.
      • hasPageInstance

        boolean hasPageInstance()
        If this provider returns existing page, regardless if it was already created by PageProvider itself or is or can be found in the data store. The only guarantee is that by calling PageProvider.getPageInstance() this provider will return an existing instance and no page will be created.
        Returns:
        if provides an existing page
      • doesProvideNewPage

        boolean doesProvideNewPage()
        Returns whether or not the page instance held by this provider has been instantiated by the provider.
        Returns:
        true iff the page instance held by this provider was instantiated by the provider
        Throws:
        java.lang.IllegalStateException - if this method is called and the provider does not yet have a page instance, ie if getPageInstance() has never been called on this provider