Class NavigationCase

  • Direct Known Subclasses:
    NavigationCaseWrapper


    public class NavigationCase
    extends java.lang.Object

    NavigationCase represents a <navigation-case> in the navigation rule base, as well as the <from-view-id> with which this <navigation-case> is a sibling.

    Since:
    2.0
    • Method Detail

      • getFromViewId

        public java.lang.String getFromViewId​()

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

        Returns:
        the from viedId.
      • getFromAction

        public java.lang.String getFromAction​()

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

        Returns:
        the from action.
      • getFromOutcome

        public java.lang.String getFromOutcome​()

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

        Returns:
        the from outcome.
      • getToViewId

        public java.lang.String getToViewId​(FacesContext context)

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

        Parameters:
        context - the FacesContext for the current request
        Returns:
        the view ID that should be navigated to
      • getToFlowDocumentId

        public java.lang.String getToFlowDocumentId​()

        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 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.

        Returns:
        the toFlow documentId.
        Since:
        2.2
      • hasCondition

        public boolean hasCondition​()

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

        Returns:
        true if there's an <if> element associated with this <navigation-case>, otherwise false
      • getCondition

        public java.lang.Boolean getCondition​(FacesContext context)

        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 EL coercion rules.

        Note throws any exceptions encountered during the process of evaluating the expression or obtaining its value.
        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
      • getParameters

        public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameters​()

        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.

        Returns:
        the list of parameters, or null
      • isRedirect

        public boolean isRedirect​()

        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)

        Returns:
        true if this is a redirect, false otherwise.
      • isIncludeViewParams

        public boolean isIncludeViewParams​()

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

        Returns:
        true if view parameters are to be included, false otherwise.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode​()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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