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

public Class FaceletPartialStateManagementStrategy

extends StateManagementStrategy
Class Inheritance
Static Imports
com.sun.faces.RIConstants.DYNAMIC_ACTIONS, .RIConstants.DYNAMIC_COMPONENT, com.sun.faces.util.ComponentStruct.ADD, .ComponentStruct.REMOVE, .Util.isEmpty, jakarta.faces.component.visit.VisitHint.SKIP_ITERATION, .VisitResult.ACCEPT, .VisitResult.COMPLETE, .VisitResult.REJECT, java.util.logging.Level.FINEST

The state management strategy for PSS.
Author
Manfred Riem ([email protected])

Field Summary

Modifier and TypeField and Description
private static final Logger
LOGGER

Stores the logger.

private static final Set<VisitHint>
SKIP_ITERATION_AND_EXECUTE_LIFECYCLE_HINTS

Stores the skip and lifecycle hints.

private static final Set<VisitHint>
SKIP_ITERATION_HINT

Stores the skip hint.

Constructor Summary

AccessConstructor and Description
public
public
FaceletPartialStateManagementStrategy(FacesContext
the Faces context.
context
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private UIComponent
locateComponentByClientId(final FacesContext
the Faces context.
context
,
final UIComponent subTree, final String
the client id of the component to find.
clientId
)

Find the given component in the component tree.

private void
pruneAndReAddToDynamicActions(List<ComponentStruct>
the dynamic action list.
dynamicActionList
,
ComponentStruct
the component struct to add.
struct
)

Methods that takes care of pruning and re-adding an action to the dynamic action list.

private void
restoreDynamicActions(FacesContext
the Faces context.
context
,
StateContext
the state context.
stateContext
,
Map<String, Object>
the state.
stateMap
)

Restore the list of dynamic actions and replay them.

private void
restoreDynamicAdd(FacesContext
the Faces context.
context
,
Map<String, Object>
the state.
state
,
ComponentStruct
the component struct.
struct
)

Method that takes care of restoring a dynamic add.

private void
restoreDynamicRemove(FacesContext
the Faces context.
context
,
ComponentStruct
the component struct.
struct
)

Method that takes care of restoring a dynamic remove.

public UIViewRoot

Returns:

the view root.
restoreView
(FacesContext
the Faces context.
context
,
String
the view id.
viewId
,
String
the render kit id.
renderKitId
)

Implements abstract jakarta.faces.view.StateManagementStrategy.restoreView.

Restore the view.

private void
saveDynamicActions(FacesContext
the Faces context.
context
,
StateContext
the state context.
stateContext
,
Map<String, Object>
the state.
stateMap
)

Save the dynamic actions.

public Object

Returns:

the saved view.
saveView
(FacesContext
the Faces context.
context
)

Implements abstract jakarta.faces.view.StateManagementStrategy.saveView.

Save the view.

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Stores the logger.

SKIP_ITERATION_AND_EXECUTE_LIFECYCLE_HINTSback to summary
private static final Set<VisitHint> SKIP_ITERATION_AND_EXECUTE_LIFECYCLE_HINTS

Stores the skip and lifecycle hints.

SKIP_ITERATION_HINTback to summary
private static final Set<VisitHint> SKIP_ITERATION_HINT

Stores the skip hint.

Constructor Detail

FaceletPartialStateManagementStrategyback to summary
public FaceletPartialStateManagementStrategy()

Constructor.

FaceletPartialStateManagementStrategyback to summary
public FaceletPartialStateManagementStrategy(FacesContext context)

Constructor.

Parameters
context:FacesContext

the Faces context.

Method Detail

locateComponentByClientIdback to summary
private UIComponent locateComponentByClientId(final FacesContext context, final UIComponent subTree, final String clientId)

Find the given component in the component tree.

Parameters
context:FacesContext

the Faces context.

clientId:String

the client id of the component to find.

pruneAndReAddToDynamicActionsback to summary
private void pruneAndReAddToDynamicActions(List<ComponentStruct> dynamicActionList, ComponentStruct struct)

Methods that takes care of pruning and re-adding an action to the dynamic action list.

If you remove a component, re-add it to the same parent and then remove it again, you only have to capture the FIRST remove. Similarly if you add a component, remove it, and then re-add it to the same parent you only need to capture the LAST add.

Parameters
dynamicActionList:List<ComponentStruct>

the dynamic action list.

struct:ComponentStruct

the component struct to add.

restoreDynamicActionsback to summary
private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap)

Restore the list of dynamic actions and replay them.

Parameters
context:FacesContext

the Faces context.

stateContext:StateContext

the state context.

stateMap:Map<String, Object>

the state.

restoreDynamicAddback to summary
private void restoreDynamicAdd(FacesContext context, Map<String, Object> state, ComponentStruct struct)

Method that takes care of restoring a dynamic add.

Parameters
context:FacesContext

the Faces context.

state:Map<String, Object>

the state.

struct:ComponentStruct

the component struct.

restoreDynamicRemoveback to summary
private void restoreDynamicRemove(FacesContext context, ComponentStruct struct)

Method that takes care of restoring a dynamic remove.

Parameters
context:FacesContext

the Faces context.

struct:ComponentStruct

the component struct.

restoreViewback to summary
public UIViewRoot restoreView(FacesContext context, String viewId, String renderKitId)

Implements abstract jakarta.faces.view.StateManagementStrategy.restoreView.

Restore the view.

Parameters
context:FacesContext

the Faces context.

viewId:String

the view id.

renderKitId:String

the render kit id.

Returns:UIViewRoot

the view root.

Annotations
@Override
saveDynamicActionsback to summary
private void saveDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap)

Save the dynamic actions.

Parameters
context:FacesContext

the Faces context.

stateContext:StateContext

the state context.

stateMap:Map<String, Object>

the state.

saveViewback to summary
public Object saveView(FacesContext context)

Implements abstract jakarta.faces.view.StateManagementStrategy.saveView.

Save the view.

Parameters
context:FacesContext

the Faces context.

Returns:Object

the saved view.

Annotations
@Override