Top Description Inners Fields Constructors Methods
com.sun.faces.application

public Class NavigationHandlerImpl

extends ConfigurableNavigationHandler
Class Inheritance
Static Imports
com.sun.faces.application.SharedUtils.evaluateExpressions, com.sun.faces.flow.FlowHandlerImpl.FLOW_RETURN_DEPTH_PARAM_NAME, com.sun.faces.util.Util.notNull, jakarta.faces.component.UIViewAction.isProcessingBroadcast, jakarta.faces.flow.FlowHandler.FLOW_ID_REQUEST_PARAM_NAME, .FlowHandler.NULL_FLOW, .FlowHandler.TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME, java.util.logging.Level.FINE

NavigationHandlerImpl is the class that implements default navigation handling. Refer to section 7.4.2 of the specification for more details. PENDING: Make independent of ApplicationAssociate.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
development

Flag indicated the current mode.

private static final String
private static final Pattern
private static final Logger
private static final Pattern
private static final String
private static final String

Constructor Summary

AccessConstructor and Description

Method Summary

Modifier and TypeMethod and Description
private void
clearViewMapIfNecessary(FacesContext facesContext, String newId)

Calls clear() on the ViewMap (if available) if the view ID of the UIViewRoot differs from newId

private String

Returns:

id of possible Node or Flow without '/' in the string
convertToViewIdToFlowOrNodeId
(FacesContext
the FacesContext for the current request
ctx
,
NavigationHandlerImpl.CaseStruct
the CaseStruct to look for the to view id
caseStruct
)

To look for the Flow or Node by the id, the '/' in the id got from navCase should be trimmed.

private void
private NavigationHandlerImpl.CaseStruct

Returns:

The view identifier.
determineViewFromActionOutcome
(FacesContext
the FacesContext for the current request
ctx
,
Set<NavigationCase>
The list of navigation cases.
caseSet
,
String
The action reference string.
fromAction
,
String
The outcome string.
outcome
,
String toFlowDocumentId)

This method will attempt to find the view identifier based on action reference and outcome.

private NavigationHandlerImpl.CaseStruct

Returns:

The view identifier.
findDefaultMatch
(FacesContext
the FacesContext for the current request
ctx
,
String
The action reference string.
fromAction
,
String
The outcome string.
outcome
,
String toFlowDocumentId, Map<String, Set<NavigationCase>> navMap)

This method will extract the cases for which a from-view-id is an asterisk "*".

private NavigationHandlerImpl.CaseStruct

Returns:

The view identifier.
findExactMatch
(FacesContext
the FacesContext for the current request
ctx
,
String
The current view identifier.
viewId
,
String
The action reference string.
fromAction
,
String
The outcome string.
outcome
,
String toFlowDocumentId, Map<String, Set<NavigationCase>> navMap)

This method finds the List of cases for the current view identifier.

private NavigationHandlerImpl.CaseStruct
findFacesFlowCallMatch(FacesContext context, String fromAction, String outcome, String toFlowDocumentId)

private NavigationHandlerImpl.CaseStruct

Returns:

a CaseStruct representing the the navigation result based on the provided input
findImplicitMatch
(FacesContext
the FacesContext for the current request
context
,
String
of the UIViewRoot for the current request
viewId
,
String
the navigation action
fromAction
,
String
the navigation outcome
outcome
,
String flowDefiningDocumentId)

Create a navigation case based on content within the outcome.

private NavigationHandlerImpl.CaseStruct
findMethodCallMatch(FacesContext context, String fromAction, String outcome, String toFlowDocumentId)

private NavigationHandlerImpl.CaseStruct
findReturnMatch(FacesContext context, String fromAction, String outcome)

private NavigationHandlerImpl.CaseStruct
findRootNavigationMapAbandonedFlowMatch(FacesContext ctx, String viewId, String fromAction, String outcome, String toFlowDocumentId)

private NavigationHandlerImpl.CaseStruct
findSwitchMatch(FacesContext context, String fromAction, String outcome, String toFlowDocumentId)

private NavigationHandlerImpl.CaseStruct
findViewNodeMatch(FacesContext context, String fromAction, String outcome)

private NavigationHandlerImpl.CaseStruct

Returns:

The view identifier.
findWildCardMatch
(FacesContext
the FacesContext for the current request
ctx
,
String
The current view identifier.
viewId
,
String
The action reference string.
fromAction
,
String
The outcome string.
outcome
,
String toFlowDocumentId, Map<String, Set<NavigationCase>> navMap)

This method traverses the wild card match List (containing from-view-id strings and finds the List of cases for each from-view-id string.

private boolean
flowsEqual(Flow flow1, Flow flow2)

public NavigationCase
getNavigationCase(FacesContext
The FacesContext for the current request
context
,
String
The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
fromAction
,
String
The logical outcome returned by a previous invoked application action (which may be null)
outcome
)

Implements abstract jakarta.faces.application.ConfigurableNavigationHandler.getNavigationCase.

Return the NavigationCase representing the navigation that would be taken had NavigationHandler#handleNavigation been called with the same arguments or null if there is no such case.

public NavigationCase
getNavigationCase(FacesContext
The FacesContext for the current request
context
,
String
The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
fromAction
,
String
The logical outcome returned by a previous invoked application action (which may be null)
outcome
,
String
The value of the toFlowDocumentId property for the navigation case (which may be null)
toFlowDocumentId
)

Overrides jakarta.faces.application.ConfigurableNavigationHandler.getNavigationCase.

Return the NavigationCase representing the navigation that would be taken had NavigationHandler#handleNavigation been called with the same arguments or null if there is no such case.

public Map<String, Set<NavigationCase>>
getNavigationCases()

Implements abstract jakarta.faces.application.ConfigurableNavigationHandler.getNavigationCases.

Return a Map<String, Set<NavigationCase>> where the keys are <from-view-id> values and the values are Set<NavigationCase> where each element in the Set is a NavigationCase that applies to that <from-view-id>.

private NavigationHandlerImpl.NavigationInfo
getNavigationInfo(FacesContext context, String toFlowDocumentId, String flowId)

private Map<String, Set<NavigationCase>>
private Map<String, Set<NavigationCase>>
private Map<String, Set<NavigationCase>>
private NavigationHandlerImpl.CaseStruct

Returns:

The view identifier.
getViewId
(FacesContext
the @{link FacesContext} for the current request
ctx
,
String
The action reference string
fromAction
,
String
The outcome string
outcome
,
String toFlowDocumentId)

This method uses helper methods to determine the new view identifier.

private Set<String>
public void
handleNavigation(FacesContext
The FacesContext for the current request
context
,
String
The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
fromAction
,
String
The logical outcome returned by a previous invoked application action (which may be null)
outcome
)

Implements abstract jakarta.faces.application.NavigationHandler.handleNavigation.

Perform navigation processing based on the state information in the specified FacesContext, plus the outcome string returned by an executed application action.

public void
handleNavigation(FacesContext
The FacesContext for the current request
context
,
String
The action binding expression that was evaluated to retrieve the specified outcome, or null if the outcome was acquired by some other means
fromAction
,
String
The logical outcome returned by a previous invoked application action (which may be null)
outcome
,
String
The defining document id of the flow into which this navigation will cause entry.
toFlowDocumentId
)

Overrides jakarta.faces.application.NavigationHandler.handleNavigation.

Overloaded variant of handleNavigation(jakarta.faces.context.FacesContext, java.lang.String, java.lang.String) that allows the caller to provide the defining document id for a flow to be entered by this navigation.

private void
private void
private void
private void
public void
inspectFlow(FacesContext
the Faces context.
context
,
Flow
the flow.
flow
)

Overrides jakarta.faces.application.ConfigurableNavigationHandler.inspectFlow.

Called by the flow system to cause the flow to be inspected for navigation rules.

private boolean
public static boolean
private void
setDidTransition(FacesContext context, boolean value)

public static void
setResetFlowHandlerStateIfUnset(FacesContext facesContext, boolean resetFlowHandlerState)

private NavigationHandlerImpl.CaseStruct
synthesizeCaseStruct(FacesContext context, Flow flow, String fromAction, String outcome)

public static void
private void
Inherited from jakarta.faces.application.ConfigurableNavigationHandler:
performNavigation