com.sun.faces.renderkit
public abstract class StateHelper extends java.lang.Object
StateHelper
implementations.Modifier and Type | Field and Description |
---|---|
protected boolean |
compressViewState
Flag indicating whether or not view state should be compressed to reduce
the memory/bandwidth footprint.
|
protected SerializationProvider |
serialProvider
Factory for serialization streams.
|
protected static char[] |
STATE_FIELD_AUTOCOMPLETE_END
The end of the hidden state field.
|
protected static char[] |
STATE_FIELD_END
The end of the hidden state field.
|
protected static char[] |
STATE_FIELD_START
State hidden field start.
|
protected static char[] |
STATE_FIELD_START_NO_ID
Alternate hidden field to generate W3C valid XHTML.
|
protected char[] |
stateFieldEnd
This will be used the by the different
StateHelper implementations
when writing the end of the state field. |
protected char[] |
stateFieldStart
This will be used the by the different
StateHelper implementations
when writing the start of the state field. |
protected WebConfiguration |
webConfig
Access to the context init parameters that configure this application.
|
Constructor and Description |
---|
StateHelper()
Constructs a new
StateHelper instance. |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Object |
getState(javax.faces.context.FacesContext ctx,
java.lang.String viewId) |
protected static java.lang.String |
getStateParamValue(javax.faces.context.FacesContext context)
Get our view state from this request
|
protected void |
writeRenderKitIdField(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
If a custom
RenderKit is used, write out the ID
of the RenderKit out as a hidden field. |
abstract void |
writeState(javax.faces.context.FacesContext ctx,
java.lang.Object state,
java.lang.StringBuilder stateCapture)
Functionally similar to ResponseStateManager#writeState(FacesContext, Object)
with an option to write the state directly to the provided
StringBuilder
without sending any markup to the client. |
protected static final char[] STATE_FIELD_START
State hidden field start. Content after this is the actual
state representation followed by the STATE_FIELD_END
.
com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter#EnableViewStateIdRendering}
protected static final char[] STATE_FIELD_START_NO_ID
Alternate hidden field to generate W3C valid XHTML. This version
includes no id attribute. This version will be used when the
EnableViewStateIdRendering
is disabled.
com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter#EnableViewStateIdRendering}
protected static final char[] STATE_FIELD_END
The end of the hidden state field.
protected static final char[] STATE_FIELD_AUTOCOMPLETE_END
The end of the hidden state field.
protected SerializationProvider serialProvider
Factory for serialization streams. These are pluggable via the WebConfiguration.WebContextInitParameter#SerializationProviderClass.
protected WebConfiguration webConfig
Access to the context init parameters that configure this application.
protected boolean compressViewState
Flag indicating whether or not view state should be compressed to reduce the memory/bandwidth footprint. This option is common to both types of state saving.
protected char[] stateFieldStart
StateHelper
implementations
when writing the start of the state field. This value of this field is
determined by the value of the WebConfiguration.BooleanWebContextInitParameter.EnableViewStateIdRendering
protected char[] stateFieldEnd
StateHelper
implementations
when writing the end of the state field. This value of this field is
determined by the value of the WebConfiguration.BooleanWebContextInitParameter.AutoCompleteOffOnViewState
public abstract void writeState(javax.faces.context.FacesContext ctx, java.lang.Object state, java.lang.StringBuilder stateCapture) throws java.io.IOException
Functionally similar to ResponseStateManager#writeState(FacesContext, Object)
with an option to write the state directly to the provided StringBuilder
without sending any markup to the client.
java.io.IOException
ResponseStateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)
public abstract java.lang.Object getState(javax.faces.context.FacesContext ctx, java.lang.String viewId) throws java.io.IOException
java.io.IOException
ResponseStateManager.getState(javax.faces.context.FacesContext, String)
protected static java.lang.String getStateParamValue(javax.faces.context.FacesContext context)
Get our view state from this request
context
- the FacesContext
for the current requestprotected void writeRenderKitIdField(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer) throws java.io.IOException
If a custom RenderKit
is used, write out the ID
of the RenderKit
out as a hidden field. This will be used
when restoring the view state.
context
- the FacesContext
for the current requestwriter
- the ResponseWriter
to write tojava.io.IOException
- if an error occurs writing to the clientCopyright © 2002-2010 Oracle America, Inc. All Rights Reserved.