public class NavigationCase extends 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.
| Constructor and Description |
|---|
NavigationCase(String fromViewId,
String fromAction,
String fromOutcome,
String condition,
String toViewId,
Map<String,List<String>> parameters,
boolean redirect,
boolean includeViewParams)
Construct a new |
NavigationCase(String fromViewId,
String fromAction,
String fromOutcome,
String condition,
String toViewId,
String toFlowDocumentId,
Map<String,List<String>> parameters,
boolean redirect,
boolean includeViewParams)
Construct a new |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
URL |
getActionURL(FacesContext context)
Construct an absolute URL to this |
URL |
getBookmarkableURL(FacesContext context)
Construct an absolute URL suitable for a bookmarkable link to this
|
Boolean |
getCondition(FacesContext context)
Evaluates the |
String |
getFromAction()
Return the |
String |
getFromOutcome()
Return the |
String |
getFromViewId()
Return the |
Map<String,List<String>> |
getParameters()
Return the parameters to be included for navigation cases requiring a redirect. |
URL |
getRedirectURL(FacesContext context)
Construct an absolute URL suitable for a "redirect" to this |
URL |
getResourceURL(FacesContext context)
Construct an absolute URL to this |
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 |
String |
getToViewId(FacesContext context)
Evaluates the |
boolean |
hasCondition()
Test if this navigation case has an associated |
int |
hashCode() |
boolean |
isIncludeViewParams()
Return the |
boolean |
isRedirect()
Return the |
String |
toString() |
public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, Map<String,List<String>> parameters, boolean redirect, boolean includeViewParams)
Construct a new NavigationCase based on the provided arguments. See section
JSF.7.4.2 for how a NavigationCase is used by the standard
ConfigurableNavigationHandler
fromViewId - return from getFromViewId()fromAction - return from getFromAction()fromOutcome - return from getFromOutcome()condition - A string to be interpreted as a ValueExpression by a call to
getCondition(javax.faces.context.FacesContext)toViewId - return from getToViewId(javax.faces.context.FacesContext)parameters - return from getParameters()redirect - return from isRedirect()includeViewParams - return isIncludeViewParams()public NavigationCase(String fromViewId, String fromAction, String fromOutcome, String condition, String toViewId, String toFlowDocumentId, Map<String,List<String>> parameters, boolean redirect, boolean includeViewParams)
Construct a new NavigationCase based on the provided arguments. See section
JSF.7.4.2 for how a NavigationCase is used by the standard
ConfigurableNavigationHandler
fromViewId - return from getFromViewId()fromAction - return from getFromAction()fromOutcome - return from getFromOutcome()condition - A string to be interpreted as a ValueExpression by a call to
getCondition(javax.faces.context.FacesContext)toViewId - return from getToViewId(javax.faces.context.FacesContext)toFlowDocumentId - the toFlow documentId.parameters - return from getParameters()redirect - return from isRedirect()includeViewParams - return isIncludeViewParams()public URL getActionURL(FacesContext context) throws MalformedURLException
Construct an absolute URL to this NavigationCase instance using
ViewHandler.getActionURL(javax.faces.context.FacesContext, java.lang.String) on the path portion of the url.
context - the FacesContext for the current requestMalformedURLException - if the process of constructing the URL causes this exception to
be thrown.public URL getResourceURL(FacesContext context) throws MalformedURLException
Construct an absolute URL to this NavigationCase instance using
ViewHandler.getResourceURL(javax.faces.context.FacesContext, java.lang.String) on the path portion of the url.
context - the FacesContext for the current requestMalformedURLException - if the process of constructing the URL causes this exception to
be thrown.public URL getRedirectURL(FacesContext context) throws MalformedURLException
Construct an absolute URL suitable for a "redirect" to this NavigationCase
instance using ViewHandler.getRedirectURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean) on the path portion
of the url.
context - the FacesContext for the current requestMalformedURLException - if the process of constructing the URL causes this exception to
be thrown.public URL getBookmarkableURL(FacesContext context) throws MalformedURLException
Construct an absolute URL suitable for a bookmarkable link to this
NavigationCase instance using
ViewHandler.getBookmarkableURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>, boolean) on the path portion of the
url. This URL may include view parameters specified as metadata within the view.
context - the FacesContext for the current requestMalformedURLException - if the process of constructing the URL causes this exception to
be thrown.public String getFromViewId()
Return the <from-view-id> of the <navigation-rule>
inside which this <navigation-case> is nested.
public String getFromAction()
Return the <from-action> for this <navigation-case>
public String getFromOutcome()
Return the <from-outcome> for this <navigation-case>
public String getToViewId(FacesContext context)
Evaluates the <to-view-id> for this <navigation-case>
context - the FacesContext for the current requestpublic 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.
public boolean hasCondition()
Test if this navigation case has an associated <if> element.
true if there's an <if> element associated with this
<navigation-case>, otherwise falsepublic 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
Jakarta Expression Language coercion rules.
context - the FacesContext for the current requestnull if there is no <if> element associated with this
<navigation-case>, otherwise return the evaluation result of the
conditionpublic Map<String,List<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.
nullpublic 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)
true if this is a redirect, false otherwise.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)
true if view parameters are to be included, false
otherwise.Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.