Top Inners Fields Constructors Methods
com.sun.faces.context

public Class PartialViewContextImpl

extends PartialViewContext
Class Inheritance
Static Imports
com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.PARTIAL_EXECUTE_PARAM, .RenderKitUtils.PredefinedPostbackParameter.PARTIAL_RENDER_PARAM, .RenderKitUtils.PredefinedPostbackParameter.PARTIAL_RESET_VALUES_PARAM, javax.faces.FactoryFinder.VISIT_CONTEXT_FACTORY

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PartialViewContextImpl.DelayedInitPartialResponseWriter

Delays the actual construction of the PartialResponseWriter until content is going to actually be written.

private static class

Field Summary

Modifier and TypeField and Description
private Boolean
private FacesContext
private List<String>
private List<String>
private static Logger
private static final String
private Boolean
private PartialResponseWriter
private boolean
private Boolean
private Collection<String>
Inherited from javax.faces.context.PartialViewContext:
ALL_PARTIAL_PHASE_CLIENT_IDSPARTIAL_EVENT_PARAM_NAMEPARTIAL_EXECUTE_PARAM_NAMEPARTIAL_RENDER_PARAM_NAMERESET_VALUES_PARAM_NAME

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private PartialResponseWriter
public List<String>
getEvalScripts()

Implements abstract javax.faces.context.PartialViewContext.getEvalScripts.

Returns a mutable List of scripts to be evaluated in client side on complete of ajax request.

public Collection<String>
getExecuteIds()

Implements abstract javax.faces.context.PartialViewContext.getExecuteIds.

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_EXECUTE_PARAM_NAME.

public PartialResponseWriter
getPartialResponseWriter()

Implements abstract javax.faces.context.PartialViewContext.getPartialResponseWriter.

Return the ResponseWriter to which components should direct their output for partial view rendering.

public Collection<String>
getRenderIds()

Implements abstract javax.faces.context.PartialViewContext.getRenderIds.

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_RENDER_PARAM_NAME.

public boolean
isAjaxRequest()

Implements abstract javax.faces.context.PartialViewContext.isAjaxRequest.

Return true if the request header Faces-Request is present with the value partial/ajax.

public boolean
isExecuteAll()

Implements abstract javax.faces.context.PartialViewContext.isExecuteAll.

Return true if isAjaxRequest returns true and PARTIAL_EXECUTE_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS.

public boolean
isPartialRequest()

Implements abstract javax.faces.context.PartialViewContext.isPartialRequest.

Return true isAjaxRequest returns true or if the request header Faces-Request is present with the value partial/process.

public boolean
isRenderAll()

Implements abstract javax.faces.context.PartialViewContext.isRenderAll.

Return true if isAjaxRequest returns true and PARTIAL_RENDER_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS.

public boolean
isResetValues()

Overrides javax.faces.context.PartialViewContext.isResetValues.

Return true if the incoming request has a parameter named by the value of RESET_VALUES_PARAM_NAME and that value is true.

private List<String>
private void
processComponents(UIComponent component, PhaseId phaseId, Collection<String> phaseClientIds, FacesContext context)

public void
processPartial(PhaseId
the javax.faces.event.PhaseId that indicates the lifecycle phase the components will be processed in.
phaseId
)

Implements abstract javax.faces.context.PartialViewContext.processPartial.

Perform lifecycle processing on components during the indicated phaseId.

public void
release()

Implements abstract javax.faces.context.PartialViewContext.release.

Release any resources associated with this PartialViewContext instance.

private void
renderAll(FacesContext context, UIViewRoot viewRoot)

private void
private void
private void
public void
setPartialRequest(boolean
the value true indicates this is a partial request.
isPartialRequest
)

Implements abstract javax.faces.context.PartialViewContext.setPartialRequest.

Dynamically indicate that this is a partial request.

public void
setRenderAll(boolean
the value true indicates the entire view must be rendered.
renderAll
)

Implements abstract javax.faces.context.PartialViewContext.setRenderAll.

Indicate the entire view must be rendered if renderAll is true.

private static PartialVisitContext

Returns:

the (unwrapped) partial visit context.
unwrapPartialVisitContext
(VisitContext
the visit context.
visitContext
)

Unwraps PartialVisitContext from a chain of VisitContextWrappers.

Field Detail

ajaxRequestback to summary
private Boolean ajaxRequest
ctxback to summary
private FacesContext ctx
evalScriptsback to summary
private List<String> evalScripts
executeIdsback to summary
private List<String> executeIds
LOGGERback to summary
private static Logger LOGGER
ORIGINAL_WRITERback to summary
private static final String ORIGINAL_WRITER
partialRequestback to summary
private Boolean partialRequest
partialResponseWriterback to summary
private PartialResponseWriter partialResponseWriter
releasedback to summary
private boolean released
renderAllback to summary
private Boolean renderAll
renderIdsback to summary
private Collection<String> renderIds

Constructor Detail

PartialViewContextImplback to summary
public PartialViewContextImpl(FacesContext ctx)

Method Detail

assertNotReleasedback to summary
private void assertNotReleased()
cleanupAfterViewback to summary
private void cleanupAfterView()
createPartialResponseWriterback to summary
private PartialResponseWriter createPartialResponseWriter()
getEvalScriptsback to summary
public List<String> getEvalScripts()

Implements abstract javax.faces.context.PartialViewContext.getEvalScripts.

Doc from javax.faces.context.PartialViewContext.getEvalScripts.

Returns a mutable List of scripts to be evaluated in client side on complete of ajax request.

Returns:List<String>

A mutable List of scripts to be evaluated in client side on complete of ajax request.

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#getEvalScripts()
getExecuteIdsback to summary
public Collection<String> getExecuteIds()

Implements abstract javax.faces.context.PartialViewContext.getExecuteIds.

Doc from javax.faces.context.PartialViewContext.getExecuteIds.

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_EXECUTE_PARAM_NAME. If there is no such request parameter, return an empty Collection. These client identifiers are used to identify components that will be processed during the execute phase of the request processing lifecycle. The returned Collection is mutable.

Returns:Collection<String>

the ids for the execute portion of the lifecycle

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#getExecuteIds()
getPartialResponseWriterback to summary
public PartialResponseWriter getPartialResponseWriter()

Implements abstract javax.faces.context.PartialViewContext.getPartialResponseWriter.

Doc from javax.faces.context.PartialViewContext.getPartialResponseWriter.

Return the ResponseWriter to which components should direct their output for partial view rendering. Within a given response, components can use either the ResponseStream or the ResponseWriter, but not both.

Returns:PartialResponseWriter

the ResponseWriter for output

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#getPartialResponseWriter()
getRenderIdsback to summary
public Collection<String> getRenderIds()

Implements abstract javax.faces.context.PartialViewContext.getRenderIds.

Doc from javax.faces.context.PartialViewContext.getRenderIds.

Return a Collection of client identifiers from the current request with the request parameter name PARTIAL_RENDER_PARAM_NAME. If there is no such request parameter, return an empty Collection. These client identifiers are used to identify components that will be processed during the render phase of the request processing lifecycle. The returned Collection is mutable.

Returns:Collection<String>

the ids for the render portion of the lifecycle

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#getRenderIds()
isAjaxRequestback to summary
public boolean isAjaxRequest()

Implements abstract javax.faces.context.PartialViewContext.isAjaxRequest.

Doc from javax.faces.context.PartialViewContext.isAjaxRequest.

Return true if the request header Faces-Request is present with the value partial/ajax. Otherwise, return false.

Returns:boolean

whether or not this is an ajax request

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#isAjaxRequest()
isExecuteAllback to summary
public boolean isExecuteAll()

Implements abstract javax.faces.context.PartialViewContext.isExecuteAll.

Doc from javax.faces.context.PartialViewContext.isExecuteAll.

Return true if isAjaxRequest returns true and PARTIAL_EXECUTE_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS. Otherwise, return false.

Returns:boolean

whether or not this is an execute all request

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#isExecuteAll()
isPartialRequestback to summary
public boolean isPartialRequest()

Implements abstract javax.faces.context.PartialViewContext.isPartialRequest.

Doc from javax.faces.context.PartialViewContext.isPartialRequest.

Return true isAjaxRequest returns true or if the request header Faces-Request is present with the value partial/process. Otherwise, return false.

Returns:boolean

whether or not this request is partial

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#isPartialRequest()
isRenderAllback to summary
public boolean isRenderAll()

Implements abstract javax.faces.context.PartialViewContext.isRenderAll.

Doc from javax.faces.context.PartialViewContext.isRenderAll.

Return true if isAjaxRequest returns true and PARTIAL_RENDER_PARAM_NAME is present in the current request with the value ALL_PARTIAL_PHASE_CLIENT_IDS. Otherwise, return false.

Returns:boolean

whether or not this is a render all request

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#isRenderAll()
isResetValuesback to summary
public boolean isResetValues()

Overrides javax.faces.context.PartialViewContext.isResetValues.

Doc from javax.faces.context.PartialViewContext.isResetValues.

Return true if the incoming request has a parameter named by the value of RESET_VALUES_PARAM_NAME and that value is true. To preserve backward compatibility with custom implementations that may have extended from an earlier version of this class, an implementation is provided that returns false. A compliant implementation must override this method to take the specified action.

Returns:boolean

whether or not this is a reset values request

Annotations
@Override
populatePhaseClientIdsback to summary
private List<String> populatePhaseClientIds(RenderKitUtils.PredefinedPostbackParameter parameterName)
processComponentsback to summary
private void processComponents(UIComponent component, PhaseId phaseId, Collection<String> phaseClientIds, FacesContext context) throws IOException
processPartialback to summary
public void processPartial(PhaseId phaseId)

Implements abstract javax.faces.context.PartialViewContext.processPartial.

Doc from javax.faces.context.PartialViewContext.processPartial.

Perform lifecycle processing on components during the indicated phaseId. Only those components with identifiers existing in the Collection returned from getExecuteIds and getRenderIds will be processed.

When the indicated phaseId equals PhaseId#RENDER_RESPONSE, then perform the following tasks in sequence:

  1. If isResetValues() returns true, then call UIViewRoot#resetValues(FacesContext, Collection), passing getRenderIds().
  2. If isRenderAll() returns false, then render any component resource of UIViewRoot whose ResourceHandler#getRendererTypeForResourceName(String) does not return null, and whose UIComponent#getChildCount() is zero, and whose ResourceHandler#isResourceRendered(FacesContext, String, String) returns false, in an update element with an identifier of javax.faces.Resource.
  3. Process the components.
  4. Obtain the state by calling StateManager#getViewState and write it out as an update element with an identifier of <VIEW_ROOT_CONTAINER_CLIENT_ID><SEP>javax.faces.ViewState where <VIEW_ROOT_CONTAINER_CLIENT_ID> is the return from UIViewRoot#getContainerClientId(FacesContext) on the view from whence this state originated, and <SEP> is the currently configured UINamingContainer#getSeparatorChar(FacesContext).
  5. If isRenderAll() returns false, then write out each script of getEvalScripts() as an eval element.
Parameters
phaseId:PhaseId

the javax.faces.event.PhaseId that indicates the lifecycle phase the components will be processed in.

Annotations
@Override
See Also
PartialViewContext#processPartial(javax.faces.event.PhaseId)
releaseback to summary
public void release()

Implements abstract javax.faces.context.PartialViewContext.release.

Doc from javax.faces.context.PartialViewContext.release.

Release any resources associated with this PartialViewContext instance.

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#release()
renderAllback to summary
private void renderAll(FacesContext context, UIViewRoot viewRoot) throws IOException
renderComponentResourcesback to summary
private void renderComponentResources(FacesContext context, UIViewRoot viewRoot) throws IOException
renderEvalScriptsback to summary
private void renderEvalScripts(FacesContext context) throws IOException
renderStateback to summary
private void renderState(FacesContext context) throws IOException
setPartialRequestback to summary
public void setPartialRequest(boolean isPartialRequest)

Implements abstract javax.faces.context.PartialViewContext.setPartialRequest.

Doc from javax.faces.context.PartialViewContext.setPartialRequest.

Dynamically indicate that this is a partial request.

Parameters
isPartialRequest:boolean

the value true indicates this is a partial request.

Annotations
@Override
setRenderAllback to summary
public void setRenderAll(boolean renderAll)

Implements abstract javax.faces.context.PartialViewContext.setRenderAll.

Doc from javax.faces.context.PartialViewContext.setRenderAll.

Indicate the entire view must be rendered if renderAll is true.

Parameters
renderAll:boolean

the value true indicates the entire view must be rendered.

Annotations
@Override
See Also
javax.faces.context.PartialViewContext#setRenderAll(boolean)
unwrapPartialVisitContextback to summary
private static PartialVisitContext unwrapPartialVisitContext(VisitContext visitContext)

Unwraps PartialVisitContext from a chain of VisitContextWrappers. If no PartialVisitContext is found in the chain, null is returned instead.

Parameters
visitContext:VisitContext

the visit context.

Returns:PartialVisitContext

the (unwrapped) partial visit context.

com.sun.faces.context back to summary

private final Class PartialViewContextImpl.DelayedInitPartialResponseWriter

extends PartialResponseWriter
Class Inheritance

Delays the actual construction of the PartialResponseWriter until content is going to actually be written.

Field Summary

Modifier and TypeField and Description
private PartialViewContextImpl
private ResponseWriter
Inherited from javax.faces.context.PartialResponseWriter:
RENDER_ALL_MARKERVIEW_STATE_MARKER

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ResponseWriter
getWrapped()

Overrides javax.faces.context.ResponseWriterWrapper.getWrapped.

Implements javax.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

public void
write(String
String to be written
text
)

Overrides java.io.Writer.write.

Writes a string.
Inherited from javax.faces.context.PartialResponseWriter:
deleteendDocumentendErrorendEvalendExtensionendInsertendUpdateredirectstartDocumentstartErrorstartEvalstartExtensionstartInsertAfterstartInsertBeforestartUpdateupdateAttributes

Field Detail

ctxback to summary
private PartialViewContextImpl ctx
writerback to summary
private ResponseWriter writer

Constructor Detail

DelayedInitPartialResponseWriterback to summary
public DelayedInitPartialResponseWriter(PartialViewContextImpl ctx)

Method Detail

getWrappedback to summary
public ResponseWriter getWrapped()

Overrides javax.faces.context.ResponseWriterWrapper.getWrapped.

Implements javax.faces.FacesWrapper.getWrapped.

Doc from javax.faces.FacesWrapper.getWrapped.

A class that implements this interface uses this method to return an instance of the class being wrapped.

Returns:ResponseWriter

the wrapped instance.

Annotations
@Override
writeback to summary
public void write(String text) throws IOException

Overrides java.io.Writer.write.

Doc from java.io.Writer.write.

Writes a string.

Parameters
text:String

String to be written

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
com.sun.faces.context back to summary

private Class PartialViewContextImpl.PhaseAwareVisitCallback

extends Object
implements VisitCallback
Class Inheritance
  • java.lang.Object
  • com.sun.faces.context.PartialViewContextImpl.PhaseAwareVisitCallback
All Implemented Interfaces
javax.faces.component.visit.VisitCallback

Field Summary

Modifier and TypeField and Description
private FacesContext
private PhaseId

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public VisitResult
visit(VisitContext
the VisitContext for this tree visit.
context
,
UIComponent
the UIComponent to visit
comp
)

Implements javax.faces.component.visit.VisitCallback.visit.

This method is called during component tree visits by VisitContext.invokeVisitCallback() to visit the specified component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private FacesContext ctx
curPhaseback to summary
private PhaseId curPhase

Constructor Detail

PhaseAwareVisitCallbackback to summary
private PhaseAwareVisitCallback(FacesContext ctx, PhaseId curPhase)

Method Detail

visitback to summary
public VisitResult visit(VisitContext context, UIComponent comp)

Implements javax.faces.component.visit.VisitCallback.visit.

Doc from javax.faces.component.visit.VisitCallback.visit.

This method is called during component tree visits by VisitContext.invokeVisitCallback() to visit the specified component. At the point in time when this method is called, the argument target is guaranteed to be in the proper state with respect to its ancestors in the View.

Parameters
context:VisitContext

the VisitContext for this tree visit.

comp:UIComponent

the UIComponent to visit

Returns:VisitResult

a VisitResult that indicates whether to continue visiting the component's subtree, skip visiting the component's subtree or end the visit.

Annotations
@Override