public class PageImpl extends Object implements Page
Page.Stats| Constructor and Description |
|---|
PageImpl(String name,
ComponentResourceSelector selector,
PersistentFieldManager persistentFieldManager,
PerthreadManager perThreadManager,
MetaDataLocator metaDataLocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(PageLifecycleListener listener)
Adds a listener that is notified of large scale page events.
|
void |
addPageAttachedCallback(Runnable callback)
Adds a callback for when the page is attached to the request.
|
void |
addPageDetachedCallback(Runnable callback)
Adds a callback for when the page is detached from the request.
|
void |
addPageLoadedCallback(Runnable callback)
Adds a callback for when the page is first loaded.
|
void |
addResetCallback(Runnable callback)
A reset occurs when a request for a page arrives that did not originate on the same page.
|
void |
addResetListener(PageResetListener listener)
Adds a new listener for page reset events.
|
void |
addVerifyCallback(Runnable callback)
Adds a verify callback, which is allowed while the page is loading.
|
void |
attached()
Invoked to inform the page that it is attached to the current request.
|
boolean |
detached()
Invoked to inform the page that it is being detached from the current request.
|
void |
discardPersistentFieldChanges()
Discards all persistent field changes for the page containing the component.
|
int |
getAttachCount()
Returns the number of times the page has been attached to a request.
|
ComponentPageElement |
getComponentElementByNestedId(String nestedId)
Retrieves a component element by its nested id (a sequence of simple ids, separated by dots).
|
Object |
getFieldChange(String nestedId,
String fieldName)
Gets a change for a field within the component.
|
org.slf4j.Logger |
getLogger()
Returns the logger of the root component element.
|
String |
getName()
Returns the short, logical name for the page.
|
Component |
getRootComponent()
The root component of the page.
|
ComponentPageElement |
getRootElement()
The root component of the page.
|
ComponentResourceSelector |
getSelector()
The selector (which includes Locale) used when the page was constructor.
|
Page.Stats |
getStats()
Returns the page construction statistics for this page.
|
boolean |
hasResetListeners()
Returns true if there are any
PageResetListener listeners. |
boolean |
isExactParameterCountMatch()
Returns true if extract parameter count matching is enabled.
|
void |
loaded()
Inform the page that it is now completely loaded.
|
void |
pageReset()
Invoked to notify
PageResetListener listeners. |
void |
persistFieldChange(ComponentResources resources,
String fieldName,
Object newValue)
Posts a change to a persistent field.
|
void |
removeLifecycleListener(PageLifecycleListener listener)
Removes a listener that was previously added.
|
void |
setRootElement(ComponentPageElement component)
Invoked during page construction time to connect the page's root component to the page
instance.
|
void |
setStats(Page.Stats stats)
Invoked once at the end of page construction, to provide page construction statistics.
|
String |
toString() |
public PageImpl(String name, ComponentResourceSelector selector, PersistentFieldManager persistentFieldManager, PerthreadManager perThreadManager, MetaDataLocator metaDataLocator)
name - canonicalized page nameselector - used to locate resourcespersistentFieldManager - for access to cross-request persistent valuesperThreadManager - metaDataLocator - public void setStats(Page.Stats stats)
Pagepublic Page.Stats getStats()
Pagepublic ComponentPageElement getComponentElementByNestedId(String nestedId)
PagegetComponentElementByNestedId in interface Pagepublic ComponentResourceSelector getSelector()
PagegetSelector in interface Pagepublic void setRootElement(ComponentPageElement component)
PagesetRootElement in interface Pagepublic ComponentPageElement getRootElement()
PagegetRootElement in interface Pagepublic Component getRootComponent()
PagegetRootComponent in interface Pagepublic void addLifecycleListener(PageLifecycleListener listener)
PageaddLifecycleListener in interface Pagepublic void removeLifecycleListener(PageLifecycleListener listener)
PageremoveLifecycleListener in interface Pagepublic boolean detached()
PagePerthreadManager. A future release of Tapestry will likely convert this method to
type void.detached in interface PagePageLifecycleListener.containingPageDidDetach()public void loaded()
Pageloaded in interface PagePageLifecycleListener.containingPageDidLoad()public void attached()
PagePage.loaded() will preceded the call to Page.attached().
First all listeners have PageLifecycleListener.restoreStateBeforePageAttach() invoked, followed by
PageLifecycleListener.containingPageDidAttach().public org.slf4j.Logger getLogger()
Pagepublic void persistFieldChange(ComponentResources resources, String fieldName, Object newValue)
PagepersistFieldChange in interface Pageresources - the component resources for the component or mixin containing the field whose
value changedfieldName - the name of the fieldnewValue - the new value for the fieldpublic Object getFieldChange(String nestedId, String fieldName)
PagegetFieldChange in interface PagenestedId - the nested component id of the component containing the fieldfieldName - the name of the persistent fieldpublic void discardPersistentFieldChanges()
PageSession) which will
take effect in the next request (the attached page instance is not affected).discardPersistentFieldChanges in interface Pagepublic String getName()
Pagepublic void addResetCallback(Runnable callback)
PageLifecycleCallbackHubaddResetCallback in interface PageLifecycleCallbackHubcallback - invoked when a page is activated by link from some other page.public void addResetListener(PageResetListener listener)
PageaddResetListener in interface Pagelistener - will receive notifications when the page is accessed from a different pagepublic void addVerifyCallback(Runnable callback)
PageLifecycleCallbackHubaddVerifyCallback in interface PageLifecycleCallbackHubcallback - to be invoked after page loadedpublic void pageReset()
PagePageResetListener listeners.public boolean hasResetListeners()
PagePageResetListener listeners.hasResetListeners in interface Pagepublic int getAttachCount()
PagegetAttachCount in interface Pagepublic boolean isExactParameterCountMatch()
PageisExactParameterCountMatch in interface PageMetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECKpublic void addPageLoadedCallback(Runnable callback)
PageLifecycleCallbackHubaddPageLoadedCallback in interface PageLifecycleCallbackHubcallback - invoked once, when page is first loadedpublic void addPageAttachedCallback(Runnable callback)
PageLifecycleCallbackHubaddPageAttachedCallback in interface PageLifecycleCallbackHubpublic void addPageDetachedCallback(Runnable callback)
PageLifecycleCallbackHubaddPageDetachedCallback in interface PageLifecycleCallbackHub5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.