Class NavigationCase
- Direct Known Subclasses:
NavigationCaseWrapper
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
-
Constructor Summary
ConstructorsConstructorDescriptionNavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String, List<String>> parameters, boolean redirect, boolean includeViewParams) Deprecated, for removal: This API element is subject to removal in a future version.NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String, List<String>> parameters, String fragment, boolean redirect, boolean includeViewParams) Construct a newNavigationCasebased on the provided arguments.NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, Map<String, List<String>> parameters, boolean redirect, boolean includeViewParams) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetActionURL(FacesContext context) Construct an absolute URL to thisNavigationCaseinstance usingViewHandler.getActionURL(FacesContext, String)on the path portion of the url.getBookmarkableURL(FacesContext context) Construct an absolute URL suitable for a bookmarkable link to thisNavigationCaseinstance usingViewHandler.getBookmarkableURL(FacesContext, String, Map, boolean)on the path portion of the url.getCondition(FacesContext context) Evaluates the<if>for this<navigation-case>, if any.Return the URL fragment identifier (the part after#in a URL) to be appended to the redirect or bookmarkable URL for this navigation case.Return the<from-action>for this<navigation-case>Return the<from-outcome>for this<navigation-case>Return the<from-view-id>of the<navigation-rule>inside which this<navigation-case>is nested.Return the parameters to be included for navigation cases requiring a redirect.getRedirectURL(FacesContext context) Construct an absolute URL suitable for a "redirect" to thisNavigationCaseinstance usingViewHandler.getRedirectURL(FacesContext, String, Map, boolean)on the path portion of the url.getResourceURL(FacesContext context) Construct an absolute URL to thisNavigationCaseinstance usingViewHandler.getResourceURL(FacesContext, String)on the path portion of the url.If this navigation case represents a flow invocation, this property is the documentId in which the flow whose id is given by the return fromgetFromOutcome()is defined.getToViewId(FacesContext context) Evaluates the<to-view-id>for this<navigation-case>booleanTest if this navigation case has an associated<if>element.inthashCode()booleanReturn the<redirect>value for this<navigation-case>.booleanReturn the<redirect>value for this<navigation-case>.toString()
-
Constructor Details
-
NavigationCase
@Deprecated(since="5.0", forRemoval=true) public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, Map<String, List<String>> parameters, boolean redirect, boolean includeViewParams) Deprecated, for removal: This API element is subject to removal in a future version.Construct a new
NavigationCasebased on the provided arguments. See section 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document for how aNavigationCaseis used by the standardConfigurableNavigationHandler- Parameters:
fromViewId- return fromgetFromViewId()fromAction- return fromgetFromAction()fromOutcome- return fromgetFromOutcome()condition- A string to be interpreted as aValueExpressionby a call togetCondition(FacesContext)toViewId- return fromgetToViewId(FacesContext)parameters- return fromgetParameters()redirect- return fromisRedirect()includeViewParams- returnisIncludeViewParams()
-
NavigationCase
@Deprecated(since="5.0", forRemoval=true) public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String, List<String>> parameters, boolean redirect, boolean includeViewParams) Deprecated, for removal: This API element is subject to removal in a future version.Construct a new
NavigationCasebased on the provided arguments. See section 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document for how aNavigationCaseis used by the standardConfigurableNavigationHandler- Parameters:
fromViewId- return fromgetFromViewId()fromAction- return fromgetFromAction()fromOutcome- return fromgetFromOutcome()condition- A string to be interpreted as aValueExpressionby a call togetCondition(FacesContext)toViewId- return fromgetToViewId(FacesContext)toFlowDocumentId- the toFlow documentId.parameters- return fromgetParameters()redirect- return fromisRedirect()includeViewParams- returnisIncludeViewParams()
-
NavigationCase
public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String, List<String>> parameters, String fragment, boolean redirect, boolean includeViewParams) Construct a new
NavigationCasebased on the provided arguments. See section 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document for how aNavigationCaseis used by the standardConfigurableNavigationHandler- Parameters:
fromViewId- return fromgetFromViewId()fromAction- return fromgetFromAction()fromOutcome- return fromgetFromOutcome()condition- A string to be interpreted as aValueExpressionby a call togetCondition(FacesContext)toViewId- return fromgetToViewId(FacesContext)toFlowDocumentId- the toFlow documentId.parameters- return fromgetParameters()fragment- return fromgetFragment()redirect- return fromisRedirect()includeViewParams- returnisIncludeViewParams()- Since:
- 5.0
-
-
Method Details
-
getActionURL
Construct an absolute URL to this
NavigationCaseinstance usingViewHandler.getActionURL(FacesContext, String)on the path portion of the url.- Parameters:
context- theFacesContextfor the current request- Returns:
- the action URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getResourceURL
Construct an absolute URL to this
NavigationCaseinstance usingViewHandler.getResourceURL(FacesContext, String)on the path portion of the url.- Parameters:
context- theFacesContextfor the current request- Returns:
- the resource URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getRedirectURL
Construct an absolute URL suitable for a "redirect" to this
NavigationCaseinstance usingViewHandler.getRedirectURL(FacesContext, String, Map, boolean)on the path portion of the url.- Parameters:
context- theFacesContextfor the current request- Returns:
- the redirect URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getBookmarkableURL
Construct an absolute URL suitable for a bookmarkable link to this
NavigationCaseinstance usingViewHandler.getBookmarkableURL(FacesContext, String, Map, boolean)on the path portion of the url. This URL may include view parameters specified as metadata within the view.- Parameters:
context- theFacesContextfor the current request- Returns:
- the bookmarkable URL.
- Throws:
MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getFromViewId
Return the
<from-view-id>of the<navigation-rule>inside which this<navigation-case>is nested.- Returns:
- the from viedId.
-
getFromAction
Return the
<from-action>for this<navigation-case>- Returns:
- the from action.
-
getFromOutcome
Return the
<from-outcome>for this<navigation-case>- Returns:
- the from outcome.
-
getToViewId
Evaluates the
<to-view-id>for this<navigation-case>- Parameters:
context- theFacesContextfor the current request- Returns:
- the view ID that should be navigated to
-
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:
trueif there's an<if>element associated with this<navigation-case>, otherwisefalse
-
getCondition
Evaluates the
Note throws any exceptions encountered during the process of evaluating the expression or obtaining its value.<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 abooleanper the normal Jakarta Expression Language coercion rules.- Parameters:
context- theFacesContextfor the current request- Returns:
nullif there is no<if>element associated with this<navigation-case>, otherwise return the evaluation result of the condition
-
getParameters
Return the parameters to be included for navigation cases requiring a redirect. If no parameters are defined,
nullwill be returned. The keys in theMapare parameter names. For each key, the corresponding value is aListof unconverted values.- Returns:
- the list of parameters, or
null
-
getFragment
Return the URL fragment identifier (the part after
#in a URL) to be appended to the redirect or bookmarkable URL for this navigation case. Returnsnullwhen no fragment is defined.- Returns:
- the URL fragment identifier without the leading
#, ornullif none is defined - Since:
- 5.0
-
isRedirect
public boolean isRedirect()Return the
<redirect>value for this<navigation-case>. This will betrueif the new view should be navigated to via aExternalContext.redirect(String)- Returns:
trueif this is a redirect,falseotherwise.
-
isIncludeViewParams
public boolean isIncludeViewParams()Return the
<redirect>value for this<navigation-case>. This will betrueif 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.- Returns:
trueif view parameters are to be included,falseotherwise.
-
equals
-
hashCode
-
toString
-
NavigationCase(String, String, String, String, String, String, Map, String, boolean, boolean)instead.