Module org.apache.wicket.core
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
Modifier and TypeMethodDescriptionvoid
detach()
Detaches the page if it has been loaded.boolean
Returns whether or not the page instance held by this provider has been instantiated by the provider.Class<? extends IRequestablePage>
Returns class of the page.Returns the page id.Returns page instance specified by the constructor.ReturnsPageParameters
of the page.Returns the number of times this page has been rendered.boolean
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
Returns whether the provided page was expired prior to this access.
-
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
ReturnsPageParameters
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 callingPageProvider.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:
IllegalStateException
- if this method is called and the provider does not yet have a page instance, ie ifgetPageInstance()
has never been called on this provider
-