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 Details

    • getPageInstance

      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

      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

      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

      Returns the page id.
      Returns:
      page id
    • 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

      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:
      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