Class NavigationCase
- java.lang.Object
-
- javax.faces.application.NavigationCase
-
- Direct Known Subclasses:
NavigationCaseWrapper
public class NavigationCase extends java.lang.ObjectNavigationCase 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
Constructors Constructor Description NavigationCase(java.lang.String fromViewId, java.lang.String fromAction, java.lang.String fromOutcome, java.lang.String condition, java.lang.String toViewId, java.lang.String toFlowDocumentId, java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters, boolean redirect, boolean includeViewParams)Construct a newNavigationCasebased on the provided arguments.NavigationCase(java.lang.String fromViewId, java.lang.String fromAction, java.lang.String fromOutcome, java.lang.String condition, java.lang.String toViewId, java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters, boolean redirect, boolean includeViewParams)Construct a newNavigationCasebased on the provided arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.net.URLgetActionURL(FacesContext context)Construct an absolute URL to thisNavigationCaseinstance usingViewHandler.getActionURL(javax.faces.context.FacesContext, java.lang.String)on the path portion of the url.java.net.URLgetBookmarkableURL(FacesContext context)Construct an absolute URL suitable for a bookmarkable link to thisNavigationCaseinstance usingViewHandler.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.java.lang.BooleangetCondition(FacesContext context)Evaluates the<if>for this<navigation-case>, if any.java.lang.StringgetFromAction()Return the<from-action> for this<navigation-case>java.lang.StringgetFromOutcome()Return the<from-outcome> for this<navigation-case>java.lang.StringgetFromViewId()Return the<from-view-id>of the<navigation-rule>inside which this<navigation-case>is nested.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.java.net.URLgetRedirectURL(FacesContext context)Construct an absolute URL suitable for a "redirect" to thisNavigationCaseinstance usingViewHandler.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.java.net.URLgetResourceURL(FacesContext context)Construct an absolute URL to thisNavigationCaseinstance usingViewHandler.getResourceURL(javax.faces.context.FacesContext, java.lang.String)on the path portion of the url.java.lang.StringgetToFlowDocumentId()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.java.lang.StringgetToViewId(FacesContext context)Evaluates the<to-view-id>for this<navigation-case>booleanhasCondition()Test if this navigation case has an associated<if>element.inthashCode()booleanisIncludeViewParams()Return the<redirect>value for this<navigation-case>.booleanisRedirect()Return the<redirect>value for this<navigation-case>.java.lang.StringtoString()
-
-
-
Constructor Detail
-
NavigationCase
public NavigationCase(java.lang.String fromViewId, java.lang.String fromAction, java.lang.String fromOutcome, java.lang.String condition, java.lang.String toViewId, java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters, boolean redirect, boolean includeViewParams)Construct a new
NavigationCasebased on the provided arguments. See section JSF.7.4.2 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(javax.faces.context.FacesContext)toViewId- return fromgetToViewId(javax.faces.context.FacesContext)parameters- return fromgetParameters()redirect- return fromisRedirect()includeViewParams- returnisIncludeViewParams()
-
NavigationCase
public NavigationCase(java.lang.String fromViewId, java.lang.String fromAction, java.lang.String fromOutcome, java.lang.String condition, java.lang.String toViewId, java.lang.String toFlowDocumentId, java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameters, boolean redirect, boolean includeViewParams)Construct a new
NavigationCasebased on the provided arguments. See section JSF.7.4.2 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(javax.faces.context.FacesContext)toViewId- return fromgetToViewId(javax.faces.context.FacesContext)parameters- return fromgetParameters()redirect- return fromisRedirect()includeViewParams- returnisIncludeViewParams()
-
-
Method Detail
-
getActionURL
public java.net.URL getActionURL(FacesContext context) throws java.net.MalformedURLException
Construct an absolute URL to this
NavigationCaseinstance usingViewHandler.getActionURL(javax.faces.context.FacesContext, java.lang.String)on the path portion of the url.- Parameters:
context- theFacesContextfor the current request- Throws:
java.net.MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getResourceURL
public java.net.URL getResourceURL(FacesContext context) throws java.net.MalformedURLException
Construct an absolute URL to this
NavigationCaseinstance usingViewHandler.getResourceURL(javax.faces.context.FacesContext, java.lang.String)on the path portion of the url.- Parameters:
context- theFacesContextfor the current request- Throws:
java.net.MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getRedirectURL
public java.net.URL getRedirectURL(FacesContext context) throws java.net.MalformedURLException
Construct an absolute URL suitable for a "redirect" to this
NavigationCaseinstance usingViewHandler.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.- Parameters:
context- theFacesContextfor the current request- Throws:
java.net.MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getBookmarkableURL
public java.net.URL getBookmarkableURL(FacesContext context) throws java.net.MalformedURLException
Construct an absolute URL suitable for a bookmarkable link to this
NavigationCaseinstance usingViewHandler.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.- Parameters:
context- theFacesContextfor the current request- Throws:
java.net.MalformedURLException- if the process of constructing the URL causes this exception to be thrown.
-
getFromViewId
public java.lang.String getFromViewId()
Return the
<from-view-id>of the<navigation-rule>inside which this<navigation-case>is nested.
-
getFromAction
public java.lang.String getFromAction()
Return the
<from-action> for this<navigation-case>
-
getFromOutcome
public java.lang.String getFromOutcome()
Return the
<from-outcome> for this<navigation-case>
-
getToViewId
public java.lang.String getToViewId(FacesContext context)
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
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.- 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
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 abooleanper the normal EL 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- Throws:
any- exceptions encountered during the process of evaluating the expression or obtaining its value.
-
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,
nullwill be returned. The keys in theMapare parameter names. For each key, the corresponding value is aListof unconverted values.
-
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)
-
isIncludeViewParams
public boolean isIncludeViewParams()
Return the
<redirect>value for this<navigation-case>. This will betrueif the view parametets should be encoded into the redirect URL (only applies to redirect case)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-