javax.faces.application
Class NavigationCase

java.lang.Object
  extended by javax.faces.application.NavigationCase

public class NavigationCase
extends java.lang.Object

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

Since:
2.0

Constructor Summary
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 NavigationCase based on the provided arguments.

 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.net.URL getActionURL(FacesContext context)
          

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.

 java.net.URL getBookmarkableURL(FacesContext context)
          

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>, boolean) on the path portion of the url.

 java.lang.Boolean getCondition(FacesContext context)
          

Evaluates the <if> for this <navigation-case>, if any.

 java.lang.String getFromAction()
          

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

 java.lang.String getFromOutcome()
          

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

 java.lang.String getFromViewId()
          

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.URL getRedirectURL(FacesContext context)
          

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>, boolean) on the path portion of the url.

 java.net.URL getResourceURL(FacesContext context)
          

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.

 java.lang.String getToViewId(FacesContext context)
          

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

 boolean hasCondition()
          

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

 int hashCode()
           
 boolean isIncludeViewParams()
          

Return the <redirect> value for this <navigation-case>.

 boolean isRedirect()
          

Return the <redirect> value for this <navigation-case>.

 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 NavigationCase based on the provided arguments. See section JSF.7.4.2 for how a NavigationCase is used by the standard ConfigurableNavigationHandler

Parameters:
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()
Method Detail

getActionURL

public java.net.URL getActionURL(FacesContext context)
                          throws java.net.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.

Parameters:
context - the FacesContext for 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 NavigationCase instance using ViewHandler.getResourceURL(javax.faces.context.FacesContext, java.lang.String) on the path portion of the url.

Parameters:
context - the FacesContext for 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 NavigationCase instance using ViewHandler.getRedirectURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map>, boolean) on the path portion of the url.

Parameters:
context - the FacesContext for 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 NavigationCase instance using ViewHandler.getBookmarkableURL(javax.faces.context.FacesContext, java.lang.String, java.util.Map>, boolean) on the path portion of the url. This URL may include view parameters specified as metadata within the view.

Parameters:
context - the FacesContext for 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 - the FacesContext for the current request
Returns:
the view ID that should be navigated to

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

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
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, null will be returned. The keys in the Map are parameter names. For each key, the corresponding value is a List of unconverted values.


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)


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)


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


Submit a bug or feature

Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 4-June-2010 04:34