org.apache.wicket.core.request.handler
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
 void detach()
          Detaches the page if it has been loaded.
 Class<? extends IRequestablePage> getPageClass()
          Returns class of the page.
 Integer getPageId()
          Returns the page id.
 IRequestablePage getPageInstance()
          Returns page instance specified by the constructor.
 PageParameters getPageParameters()
          Returns PageParameters of the page.
 Integer getRenderCount()
          Returns the number of times this page has been rendered.
 boolean hasPageInstance()
          Checks whether or not the provider has a page instance.
 boolean isNewPageInstance()
          Returns whether calling getPageInstance() will result in creating new page instance or whether it will be an existing instance (even though it might be pulled from page store).
 boolean isPageInstanceFresh()
          Returns whether or not the page instance held by this provider has been instantiated by the provider.
 

Method Detail

getPageInstance

IRequestablePage getPageInstance()
Returns page instance specified by the constructor.

Returns:
page instance
Throws:
StalePageException - if render count has been specified in constructor and the render count of page does not match the value
{@link - org.apache.wicket.protocol.http.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

PageParameters getPageParameters()
Returns PageParameters of the page.

Returns:
page parameters

isNewPageInstance

boolean isNewPageInstance()
Returns whether calling getPageInstance() will result in creating new page instance or whether it will be an existing instance (even though it might be pulled from page store).

Returns:
true if calling getPageInstance() will create new page instance, false otherwise.

getPageClass

Class<? extends IRequestablePage> getPageClass()
Returns class of the page.

Returns:
page class

getPageId

Integer getPageId()
Returns the page id.

Returns:
page id

getRenderCount

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()
Checks whether or not the provider has a page instance. This page instance might have been passed to this page provider directly or it may have been instantiated or retrieved from the page store.

Returns:
true iff page instance has been created or retrieved

isPageInstanceFresh

boolean isPageInstanceFresh()
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


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