Class PageImpl

    • Method Detail

      • setStats

        public void setStats​(Page.Stats stats)
        Description copied from interface: Page
        Invoked once at the end of page construction, to provide page construction statistics.
        Specified by:
        setStats in interface Page
      • getStats

        public Page.Stats getStats()
        Description copied from interface: Page
        Returns the page construction statistics for this page.
        Specified by:
        getStats in interface Page
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getComponentElementByNestedId

        public ComponentPageElement getComponentElementByNestedId​(java.lang.String nestedId)
        Description copied from interface: Page
        Retrieves a component element by its nested id (a sequence of simple ids, separated by dots). The individual names in the nested id are matched without regards to case. A nested id of '' (the empty string) returns the root element of the page.
        Specified by:
        getComponentElementByNestedId in interface Page
      • detached

        public boolean detached()
        Description copied from interface: Page
        Invoked to inform the page that it is being detached from the current request. This occurs just before the page is returned to the page pool. A page may be clean or dirty. A page is dirty if its dirty count is greater than zero (meaning that, during the render of the page, some components did not fully render), or if any of its listeners throw an exception from containingPageDidDetach(). The page pool should discard pages that are dirty, rather than store them into the pool. Under Tapestry 5.2 and pool-less pages, the result is ignored; all mutable state is expected to be discarded automatically from the PerthreadManager. A future release of Tapestry will likely convert this method to type void.
        Specified by:
        detached in interface Page
        Returns:
        true if the page is "dirty", false otherwise
        See Also:
        PageLifecycleListener.containingPageDidDetach()
      • getLogger

        public org.slf4j.Logger getLogger()
        Description copied from interface: Page
        Returns the logger of the root component element. Any logging about page construction or activity should be sent to this logger.
        Specified by:
        getLogger in interface Page
      • persistFieldChange

        public void persistFieldChange​(ComponentResources resources,
                                       java.lang.String fieldName,
                                       java.lang.Object newValue)
        Description copied from interface: Page
        Posts a change to a persistent field.
        Specified by:
        persistFieldChange in interface Page
        Parameters:
        resources - the component resources for the component or mixin containing the field whose value changed
        fieldName - the name of the field
        newValue - the new value for the field
      • getFieldChange

        public java.lang.Object getFieldChange​(java.lang.String nestedId,
                                               java.lang.String fieldName)
        Description copied from interface: Page
        Gets a change for a field within the component.
        Specified by:
        getFieldChange in interface Page
        Parameters:
        nestedId - the nested component id of the component containing the field
        fieldName - the name of the persistent field
        Returns:
        the value, or null if no value is stored
      • discardPersistentFieldChanges

        public void discardPersistentFieldChanges()
        Description copied from interface: Page
        Discards all persistent field changes for the page containing the component. Changes are eliminated from persistent storage (such as the Session) which will take effect in the next request (the attached page instance is not affected).
        Specified by:
        discardPersistentFieldChanges in interface Page
      • getName

        public java.lang.String getName()
        Description copied from interface: Page
        Returns the short, logical name for the page. This is the page name as it might included in an action or page render URL (though it will be converted to lower case when it is included).
        Specified by:
        getName in interface Page
      • addResetCallback

        public void addResetCallback​(java.lang.Runnable callback)
        Description copied from interface: PageLifecycleCallbackHub
        A reset occurs when a request for a page arrives that did not originate on the same page. This gives the application a chance to reset the state of the page.
        Specified by:
        addResetCallback in interface PageLifecycleCallbackHub
        Parameters:
        callback - invoked when a page is activated by link from some other page.
      • addResetListener

        public void addResetListener​(PageResetListener listener)
        Description copied from interface: Page
        Adds a new listener for page reset events.
        Specified by:
        addResetListener in interface Page
        Parameters:
        listener - will receive notifications when the page is accessed from a different page
      • addVerifyCallback

        public void addVerifyCallback​(java.lang.Runnable callback)
        Description copied from interface: PageLifecycleCallbackHub
        Adds a verify callback, which is allowed while the page is loading. Such callbacks are invoked once, after the page has been loaded successfully, and are then discarded. This was added specifically to ensure that components only verify that required parameters are bound after all components and mixins of the page have had a chance to initialize.
        Specified by:
        addVerifyCallback in interface PageLifecycleCallbackHub
        Parameters:
        callback - to be invoked after page loaded
      • getAttachCount

        public int getAttachCount()
        Description copied from interface: Page
        Returns the number of times the page has been attached to a request. This is a rough measure of how important the page is, relative to other pages. This value is volatile, changing constantly.
        Specified by:
        getAttachCount in interface Page