public class NavigationHandlerImpl
extends javax.faces.application.ConfigurableNavigationHandler
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.
Modifier and Type | Class and Description |
---|---|
private static class |
NavigationHandlerImpl.CaseStruct |
private static class |
NavigationHandlerImpl.NavigationInfo |
private static class |
NavigationHandlerImpl.NavigationMap |
Modifier and Type | Field and Description |
---|---|
private boolean |
development
Flag indicated the current mode.
|
private static java.lang.String |
DID_TRANSITION_FLAG |
private static java.util.regex.Pattern |
INCLUDE_VIEW_PARAMS_EQUALS_TRUE |
private static java.util.logging.Logger |
logger |
private java.util.Map<java.lang.String,NavigationHandlerImpl.NavigationInfo> |
navigationMaps
Map containing configured navigation cases. |
private static java.util.regex.Pattern |
REDIRECT_EQUALS_TRUE |
private static java.lang.String |
ROOT_NAVIGATION_MAP_ID |
Constructor and Description |
---|
NavigationHandlerImpl()
This constructor uses the current
ApplicationAssociate
instance to obtain the navigation mappings used to make
navigational decisions. |
Modifier and Type | Method and Description |
---|---|
private void |
clearViewMapIfNecessary(javax.faces.context.FacesContext facesContext,
java.lang.String newId)
Calls
clear() on the ViewMap (if available) if the view
ID of the UIViewRoot differs from newId |
private java.lang.String |
convertToViewIdToFlowOrNodeId(javax.faces.context.FacesContext ctx,
NavigationHandlerImpl.CaseStruct caseStruct)
To look for the Flow or Node by the id, the '/' in the id got from navCase should be trimmed.
|
private void |
createNavigationMaps() |
private NavigationHandlerImpl.CaseStruct |
determineViewFromActionOutcome(javax.faces.context.FacesContext ctx,
java.util.Set<javax.faces.application.NavigationCase> caseSet,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId)
This method will attempt to find the
view identifier based on action reference
and outcome. |
private NavigationHandlerImpl.CaseStruct |
findDefaultMatch(javax.faces.context.FacesContext ctx,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId,
java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> navMap)
This method will extract the cases for which a
from-view-id is
an asterisk "*". |
private NavigationHandlerImpl.CaseStruct |
findExactMatch(javax.faces.context.FacesContext ctx,
java.lang.String viewId,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId,
java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> navMap)
This method finds the List of cases for the current
view identifier. |
private NavigationHandlerImpl.CaseStruct |
findFacesFlowCallMatch(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId) |
private NavigationHandlerImpl.CaseStruct |
findImplicitMatch(javax.faces.context.FacesContext context,
java.lang.String viewId,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String flowDefiningDocumentId)
Create a navigation case based on content within the outcome.
|
private NavigationHandlerImpl.CaseStruct |
findMethodCallMatch(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId) |
private NavigationHandlerImpl.CaseStruct |
findReturnMatch(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome) |
private NavigationHandlerImpl.CaseStruct |
findRootNavigationMapAbandonedFlowMatch(javax.faces.context.FacesContext ctx,
java.lang.String viewId,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId) |
private NavigationHandlerImpl.CaseStruct |
findSwitchMatch(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId) |
private NavigationHandlerImpl.CaseStruct |
findViewNodeMatch(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome) |
private NavigationHandlerImpl.CaseStruct |
findWildCardMatch(javax.faces.context.FacesContext ctx,
java.lang.String viewId,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId,
java.util.Map<java.lang.String,java.util.Set<javax.faces.application.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. |
javax.faces.application.NavigationCase |
getNavigationCase(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome) |
javax.faces.application.NavigationCase |
getNavigationCase(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId) |
java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> |
getNavigationCases() |
private NavigationHandlerImpl.NavigationInfo |
getNavigationInfo(javax.faces.context.FacesContext context,
java.lang.String toFlowDocumentId,
java.lang.String flowId) |
private java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> |
getNavigationMap(javax.faces.context.FacesContext context) |
private java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> |
getRootNavigationMap() |
private java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> |
getRootNaviMap() |
private NavigationHandlerImpl.CaseStruct |
getViewId(javax.faces.context.FacesContext ctx,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId)
This method uses helper methods to determine the new
view identifier. |
private java.util.Set<java.lang.String> |
getWildCardMatchList(javax.faces.context.FacesContext context) |
void |
handleNavigation(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome) |
void |
handleNavigation(javax.faces.context.FacesContext context,
java.lang.String fromAction,
java.lang.String outcome,
java.lang.String toFlowDocumentId) |
private void |
initializeNavigationFromAssociate() |
private void |
initializeNavigationFromFlow(javax.faces.context.FacesContext context,
javax.faces.flow.Flow toInspect) |
private void |
initializeNavigationFromFlowNonThreadSafe(javax.faces.flow.Flow toInspect) |
private void |
initializeNavigationFromFlowThreadSafe(javax.faces.flow.Flow toInspect) |
void |
inspectFlow(javax.faces.context.FacesContext context,
javax.faces.flow.Flow flow) |
private boolean |
isDidTransition(javax.faces.context.FacesContext context) |
private void |
setDidTransition(javax.faces.context.FacesContext context,
boolean value) |
private NavigationHandlerImpl.CaseStruct |
synthesizeCaseStruct(javax.faces.context.FacesContext context,
javax.faces.flow.Flow flow,
java.lang.String fromAction,
java.lang.String outcome) |
private void |
updateRenderTargets(javax.faces.context.FacesContext ctx,
java.lang.String newId) |
private static final java.util.logging.Logger logger
private volatile java.util.Map<java.lang.String,NavigationHandlerImpl.NavigationInfo> navigationMaps
Map
containing configured navigation cases.private boolean development
private static final java.util.regex.Pattern REDIRECT_EQUALS_TRUE
private static final java.util.regex.Pattern INCLUDE_VIEW_PARAMS_EQUALS_TRUE
private static final java.lang.String ROOT_NAVIGATION_MAP_ID
private static final java.lang.String DID_TRANSITION_FLAG
public NavigationHandlerImpl()
ApplicationAssociate
instance to obtain the navigation mappings used to make
navigational decisions.public javax.faces.application.NavigationCase getNavigationCase(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
getNavigationCase
in class javax.faces.application.ConfigurableNavigationHandler
ConfigurableNavigationHandler.getNavigationCase(javax.faces.context.FacesContext, String, String)
public javax.faces.application.NavigationCase getNavigationCase(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
getNavigationCase
in class javax.faces.application.ConfigurableNavigationHandler
public java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> getNavigationCases()
getNavigationCases
in class javax.faces.application.ConfigurableNavigationHandler
ConfigurableNavigationHandler.getNavigationCases()
public void inspectFlow(javax.faces.context.FacesContext context, javax.faces.flow.Flow flow)
inspectFlow
in class javax.faces.application.ConfigurableNavigationHandler
public void handleNavigation(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
handleNavigation
in class javax.faces.application.NavigationHandler
public void handleNavigation(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
handleNavigation
in class javax.faces.application.NavigationHandler
private java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> getRootNaviMap()
private java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> getNavigationMap(javax.faces.context.FacesContext context)
private void createNavigationMaps()
private java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> getRootNavigationMap()
private java.util.Set<java.lang.String> getWildCardMatchList(javax.faces.context.FacesContext context)
private NavigationHandlerImpl.NavigationInfo getNavigationInfo(javax.faces.context.FacesContext context, java.lang.String toFlowDocumentId, java.lang.String flowId)
private void initializeNavigationFromAssociate()
private void initializeNavigationFromFlow(javax.faces.context.FacesContext context, javax.faces.flow.Flow toInspect)
private void initializeNavigationFromFlowNonThreadSafe(javax.faces.flow.Flow toInspect)
private void initializeNavigationFromFlowThreadSafe(javax.faces.flow.Flow toInspect)
private void clearViewMapIfNecessary(javax.faces.context.FacesContext facesContext, java.lang.String newId)
clear()
on the ViewMap (if available) if the view
ID of the UIViewRoot differs from newId
private void updateRenderTargets(javax.faces.context.FacesContext ctx, java.lang.String newId)
private NavigationHandlerImpl.CaseStruct getViewId(javax.faces.context.FacesContext ctx, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
view
identifier.
Refer to section 7.4.2 of the specification for more details.ctx
- the @{link FacesContext} for the current requestfromAction
- The action reference stringoutcome
- The outcome stringview
identifier.private NavigationHandlerImpl.CaseStruct findExactMatch(javax.faces.context.FacesContext ctx, java.lang.String viewId, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId, java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> navMap)
view
identifier.
After the cases are found, the from-action
and from-outcome
values are evaluated to determine the new view
identifier.
Refer to section 7.4.2 of the specification for more details.ctx
- the FacesContext
for the current requestviewId
- The current view
identifier.fromAction
- The action reference string.outcome
- The outcome string.view
identifier.private NavigationHandlerImpl.CaseStruct findWildCardMatch(javax.faces.context.FacesContext ctx, java.lang.String viewId, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId, java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> navMap)
from-view-id
strings and finds the List of cases for each from-view-id
string.
Refer to section 7.4.2 of the specification for more details.ctx
- the FacesContext
for the current requestviewId
- The current view
identifier.fromAction
- The action reference string.outcome
- The outcome string.view
identifier.private NavigationHandlerImpl.CaseStruct findDefaultMatch(javax.faces.context.FacesContext ctx, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId, java.util.Map<java.lang.String,java.util.Set<javax.faces.application.NavigationCase>> navMap)
from-view-id
is
an asterisk "*".
Refer to section 7.4.2 of the specification for more details.ctx
- the FacesContext
for the current requestfromAction
- The action reference string.outcome
- The outcome string.view
identifier.private NavigationHandlerImpl.CaseStruct findRootNavigationMapAbandonedFlowMatch(javax.faces.context.FacesContext ctx, java.lang.String viewId, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
private NavigationHandlerImpl.CaseStruct findImplicitMatch(javax.faces.context.FacesContext context, java.lang.String viewId, java.lang.String fromAction, java.lang.String outcome, java.lang.String flowDefiningDocumentId)
Create a navigation case based on content within the outcome.
context
- the FacesContext
for the current requestviewId
- of the UIViewRoot
for the current requestfromAction
- the navigation actionoutcome
- the navigation outcomeprivate NavigationHandlerImpl.CaseStruct findSwitchMatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
private NavigationHandlerImpl.CaseStruct synthesizeCaseStruct(javax.faces.context.FacesContext context, javax.faces.flow.Flow flow, java.lang.String fromAction, java.lang.String outcome)
private NavigationHandlerImpl.CaseStruct findMethodCallMatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
private NavigationHandlerImpl.CaseStruct findFacesFlowCallMatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
private boolean isDidTransition(javax.faces.context.FacesContext context)
private void setDidTransition(javax.faces.context.FacesContext context, boolean value)
private NavigationHandlerImpl.CaseStruct findViewNodeMatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
private NavigationHandlerImpl.CaseStruct findReturnMatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
private NavigationHandlerImpl.CaseStruct determineViewFromActionOutcome(javax.faces.context.FacesContext ctx, java.util.Set<javax.faces.application.NavigationCase> caseSet, java.lang.String fromAction, java.lang.String outcome, java.lang.String toFlowDocumentId)
view
identifier based on action reference
and outcome. Refer to section 7.4.2 of the specification for more details.ctx
- the FacesContext
for the current requestcaseSet
- The list of navigation cases.fromAction
- The action reference string.outcome
- The outcome string.view
identifier.private java.lang.String convertToViewIdToFlowOrNodeId(javax.faces.context.FacesContext ctx, NavigationHandlerImpl.CaseStruct caseStruct)
ctx
- the FacesContext
for the current requestcaseStruct
- the NavigationHandlerImpl.CaseStruct
to look for the to view idCopyright © 2002-2013 Oracle America, Inc. All Rights Reserved.