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 callgetPageParameters()
instead of callinggetPageInstance()
.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.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()
ReturnsPageParameters
of the page.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
PageParameters getPageParameters() throws PageExpiredException
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
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
-
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()
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
-
-