Interface ViewLifecyclePhase

All Superinterfaces:
LifecycleElementState, Runnable
All Known Implementing Classes:
ApplyModelComponentPhase, FinalizeComponentPhase, InitializeComponentPhase, PreProcessElementPhase, RenderComponentPhase, ViewLifecyclePhaseBase

public interface ViewLifecyclePhase extends LifecycleElementState, Runnable
Represents a phase in the view lifecycle.

A phase is contains a collection of ViewLifecycleTask instances that are processed on each component in the view tree.

Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Method Details

    • prepare

      void prepare(LifecycleElement element, Component parent, String parentPath, List<String> refreshPaths)
      Prepares a phase for use after being recycled (state cleared).
      Parameters:
      element - lifecycle element to prepare
      parent - parent component
      parentPath - path of the element related to its parent (in other words the property of the parent that holds this element)
      refreshPaths - during a component refresh request, the list of view paths that should be processed by the phase (this includes a subset of the entire view tree)
    • getParent

      Component getParent()
      Retrieves the component that is a parent to the element being processed in the view three.
      Returns:
      parent component
    • isProcessed

      boolean isProcessed()
      Determines if this lifecycle phase has completed processing.

      This method will return true when this phase's tasks have been processed, but does not necessarily indicate that successor phases have been completed. Use isComplete() to determine if the lifecycle has been fully completed for this phase.

      Returns:
      true if this phase has been processed, false if not
    • isComplete

      boolean isComplete()
      Determines if this lifecycle phase and all successor phases, have completed processing.
      Returns:
      true if this phase and all successor phases have been processed, false if not
      See Also:
    • getCurrentTask

      ViewLifecycleTask<?> getCurrentTask()
      Gets the task currently running.
      Returns:
      the task currently running, null if this phase is not active.
    • getEventToNotify

      ViewLifecycle.LifecycleEvent getEventToNotify()
      Gets the event to notify on completion.
      Returns:
      lifecycle event to notify on completion
      See Also:
    • getStartViewStatus

      String getStartViewStatus()
      Gets the expected view status prior to phase execution.
      Returns:
      expected view status prior to phase execution
    • getEndViewStatus

      String getEndViewStatus()
      Gets the expected view status after phase execution.
      Returns:
      expected view status after phase execution
    • getPredecessor

      ViewLifecyclePhase getPredecessor()
      Gets the lifecycle phase that directly precedes this phase.
      Returns:
      lifecycle phase that directly precedes this phase
    • setNextPhase

      void setNextPhase(ViewLifecyclePhase nextPhase)
      Sets the next phase, to queue for processing after this phase is completed.
      Parameters:
      nextPhase - next phase
      Throws:
      IllegalArgumentException - If nextPhase is null, or if the view status of the phases don't match.
      IllegalStateException - If the nextPhase has been set to a non-null value already.
    • setPredecessor

      void setPredecessor(ViewLifecyclePhase phase)
      Sets the predecessor, for notification during processing.
      Parameters:
      phase - predecessor phase
    • setRefreshPaths

      void setRefreshPaths(List<String> refreshPaths)
      Sets the refresh paths for this phase.
      Parameters:
      refreshPaths - list of refresh paths.
    • getRefreshPaths

      List<String> getRefreshPaths()
      During a component refresh, returns the list of view paths the lifecycle phase will be processed on.
      Returns:
      list of view paths
    • hasPendingSuccessors

      boolean hasPendingSuccessors()
      Determines of there are any pending successors of this phase.
      Returns:
      True if there are pending successors, false if no successors are pending.
    • removePendingSuccessor

      void removePendingSuccessor(String parentPath)
      Remove a pending successor by path.
      Parameters:
      parentPath - path
    • notifyCompleted

      void notifyCompleted()
      Invoked by the processor when this phase and all successors have completely processed.
    • recycle

      void recycle()
      Prepares this phase instance for recycled use.