Class NavigationCaseWrapper

java.lang.Object
jakarta.faces.application.NavigationCase
jakarta.faces.application.NavigationCaseWrapper
All Implemented Interfaces:
FacesWrapper<NavigationCase>

public abstract class NavigationCaseWrapper extends NavigationCase implements FacesWrapper<NavigationCase>

Provides a simple implementation of NavigationCase that can be subclassed by developers wishing to provide specialized behavior to an existing NavigationCase instance. The default implementation of all methods is to call through to the wrapped NavigationCase instance.

Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped() to access the instance being wrapped.

Since:
2.2
  • Constructor Details

    • NavigationCaseWrapper

      @Deprecated public NavigationCaseWrapper()
      Deprecated.
      Use the other constructor taking the implementation being wrapped.
    • NavigationCaseWrapper

      public NavigationCaseWrapper(NavigationCase wrapped)

      If this navigation case has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

      Parameters:
      wrapped - The implementation being wrapped.
      Since:
      2.3
  • Method Details

    • getWrapped

      public NavigationCase getWrapped()
      Description copied from interface: FacesWrapper

      A class that implements this interface uses this method to return an instance of the class being wrapped.

      Specified by:
      getWrapped in interface FacesWrapper<NavigationCase>
      Returns:
      the wrapped instance.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class NavigationCase
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class NavigationCase
    • toString

      public String toString()
      Overrides:
      toString in class NavigationCase
    • getActionURL

      public URL getActionURL(FacesContext context) throws MalformedURLException
      Description copied from class: NavigationCase

      Construct an absolute URL to this NavigationCase instance using ViewHandler.getActionURL(FacesContext, String) on the path portion of the url.

      Overrides:
      getActionURL in class NavigationCase
      Parameters:
      context - the FacesContext for the current request
      Returns:
      the action URL.
      Throws:
      MalformedURLException - if the process of constructing the URL causes this exception to be thrown.
    • getBookmarkableURL

      public URL getBookmarkableURL(FacesContext context) throws MalformedURLException
      Description copied from class: NavigationCase

      Construct an absolute URL suitable for a bookmarkable link to this NavigationCase instance using ViewHandler.getBookmarkableURL(FacesContext, String, Map, boolean) on the path portion of the url. This URL may include view parameters specified as metadata within the view.

      Overrides:
      getBookmarkableURL in class NavigationCase
      Parameters:
      context - the FacesContext for the current request
      Returns:
      the bookmarkable URL.
      Throws:
      MalformedURLException - if the process of constructing the URL causes this exception to be thrown.
    • getCondition

      public Boolean getCondition(FacesContext context)
      Description copied from class: NavigationCase

      Evaluates the <if> for this <navigation-case>, if any. The expression to be evaluated is passed into the constructor as a string. When the expression is evaluated, its value must be coerced into a boolean per the normal Jakarta Expression Language coercion rules.

      Note throws any exceptions encountered during the process of evaluating the expression or obtaining its value.
      Overrides:
      getCondition in class NavigationCase
      Parameters:
      context - the FacesContext for the current request
      Returns:
      null if there is no <if> element associated with this <navigation-case>, otherwise return the evaluation result of the condition
    • getFromAction

      public String getFromAction()
      Description copied from class: NavigationCase

      Return the <from-action> for this <navigation-case>

      Overrides:
      getFromAction in class NavigationCase
      Returns:
      the from action.
    • getFromOutcome

      public String getFromOutcome()
      Description copied from class: NavigationCase

      Return the <from-outcome> for this <navigation-case>

      Overrides:
      getFromOutcome in class NavigationCase
      Returns:
      the from outcome.
    • getFromViewId

      public String getFromViewId()
      Description copied from class: NavigationCase

      Return the <from-view-id> of the <navigation-rule> inside which this <navigation-case> is nested.

      Overrides:
      getFromViewId in class NavigationCase
      Returns:
      the from viedId.
    • getParameters

      public Map<String, List<String>> getParameters()
      Description copied from class: NavigationCase

      Return the parameters to be included for navigation cases requiring a redirect. If no parameters are defined, null will be returned. The keys in the Map are parameter names. For each key, the corresponding value is a List of unconverted values.

      Overrides:
      getParameters in class NavigationCase
      Returns:
      the list of parameters, or null
    • getFragment

      public String getFragment()
      Description copied from class: NavigationCase

      Return the URL fragment identifier (the part after # in a URL) to be appended to the redirect or bookmarkable URL for this navigation case. Returns null when no fragment is defined.

      Overrides:
      getFragment in class NavigationCase
      Returns:
      the URL fragment identifier without the leading #, or null if none is defined
    • getRedirectURL

      public URL getRedirectURL(FacesContext context) throws MalformedURLException
      Description copied from class: NavigationCase

      Construct an absolute URL suitable for a "redirect" to this NavigationCase instance using ViewHandler.getRedirectURL(FacesContext, String, Map, boolean) on the path portion of the url.

      Overrides:
      getRedirectURL in class NavigationCase
      Parameters:
      context - the FacesContext for the current request
      Returns:
      the redirect URL.
      Throws:
      MalformedURLException - if the process of constructing the URL causes this exception to be thrown.
    • getResourceURL

      public URL getResourceURL(FacesContext context) throws MalformedURLException
      Description copied from class: NavigationCase

      Construct an absolute URL to this NavigationCase instance using ViewHandler.getResourceURL(FacesContext, String) on the path portion of the url.

      Overrides:
      getResourceURL in class NavigationCase
      Parameters:
      context - the FacesContext for the current request
      Returns:
      the resource URL.
      Throws:
      MalformedURLException - if the process of constructing the URL causes this exception to be thrown.
    • getToViewId

      public String getToViewId(FacesContext context)
      Description copied from class: NavigationCase

      Evaluates the <to-view-id> for this <navigation-case>

      Overrides:
      getToViewId in class NavigationCase
      Parameters:
      context - the FacesContext for the current request
      Returns:
      the view ID that should be navigated to
    • getToFlowDocumentId

      public String getToFlowDocumentId()
      Description copied from class: NavigationCase

      If this navigation case represents a flow invocation, this property is the documentId in which the flow whose id is given by the return from NavigationCase.getFromOutcome() is defined. Implementations must override this method to return the value defined in the corresponding application configuration resources element. The base implementation returns the empty string.

      Overrides:
      getToFlowDocumentId in class NavigationCase
      Returns:
      the toFlow documentId.
    • hasCondition

      public boolean hasCondition()
      Description copied from class: NavigationCase

      Test if this navigation case has an associated <if> element.

      Overrides:
      hasCondition in class NavigationCase
      Returns:
      true if there's an <if> element associated with this <navigation-case>, otherwise false
    • isIncludeViewParams

      public boolean isIncludeViewParams()
      Description copied from class: NavigationCase

      Return the <redirect> value for this <navigation-case>. This will be true if the view parameters should be encoded into the redirect URL (only applies to redirect case)

      When true, view parameter values are obtained from the source view (the view being navigated away from) and encoded into the target URL. See the Jakarta Faces Specification Document section on ViewHandler.getBookmarkableURL() for the complete algorithm and clarifications on view parameter value resolution.

      Overrides:
      isIncludeViewParams in class NavigationCase
      Returns:
      true if view parameters are to be included, false otherwise.
    • isRedirect

      public boolean isRedirect()
      Description copied from class: NavigationCase

      Return the <redirect> value for this <navigation-case>. This will be true if the new view should be navigated to via a ExternalContext.redirect(String)

      Overrides:
      isRedirect in class NavigationCase
      Returns:
      true if this is a redirect, false otherwise.