Writer to efficiently handle the state manager replacement
marker written out by MultiViewHandler#writeState(javax.faces.context.FacesContext).
| Modifier and Type | Field and Description |
|---|---|
| private char[] | |
| private int | |
| private FacesContext | |
| private static final ThreadLocal | |
| private FastStringWriter | |
| private Writer | |
| private Writer | |
| private Object | |
| private static final int | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | WriteBehindStateWriter(Writer
the writer we write non-buffered content to out, FacesContext the context, int FacesContext for the current requestthe buffer size for post-processing buffered content bufSize)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. |
| public void | flush()
Implements abstract java. Implements java. |
| public void | |
| public static WriteBehindStateWriter | |
| private static int | Returns: the index of the next delimiter, if anybuffered content builder, int the offset to start the search from offset)
|
| private StringBuilder | Returns: the state.the state manager. stateManager, ResponseWriter the original response writer. origWriter)Get the state. |
| public void | |
| public boolean | |
| public void | write(int
int specifying a character to be written c)Overrides java. out.
|
| public void | write(char[]
Array of characters to be written cbuf)Overrides java. out.
|
| public void | write(String
String to be written str)Overrides java. out.
|
| public void | write(String
A String str, int Offset from which to start writing characters off, int Number of characters to write len)Overrides java. out.
|
| public void | write(char[]
Array of characters cbuf, int Offset from which to start writing characters off, int Number of characters to write len)Implements abstract java. out.
|
| public void | writingState()
When called, the original writer is backed up and replaced with a new FastStringWriter. |
| buf | back to summary |
|---|---|
| private char[] buf | |
| bufSize | back to summary |
|---|---|
| private int bufSize | |
| context | back to summary |
|---|---|
| private FacesContext context | |
| CUR_WRITER | back to summary |
|---|---|
| private static final ThreadLocal<WriteBehindStateWriter> CUR_WRITER | |
| fWriter | back to summary |
|---|---|
| private FastStringWriter fWriter | |
| orig | back to summary |
|---|---|
| private Writer orig | |
| out | back to summary |
|---|---|
| private Writer out | |
| state | back to summary |
|---|---|
| private Object state | |
| STATE_MARKER_LEN | back to summary |
|---|---|
| private static final int STATE_MARKER_LEN | |
| stateWritten | back to summary |
|---|---|
| private boolean stateWritten | |
| WriteBehindStateWriter | back to summary |
|---|---|
| public WriteBehindStateWriter(Writer out, FacesContext context, int bufSize) Constructs a new
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. This is a no-op.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract java. Implements java. This is a no-op.
| |
| flushToWriter | back to summary |
|---|---|
| public void flushToWriter() throws IOException Write directly from our FastStringWriter to the provided writer.
| |
| getCurrentInstance | back to summary |
|---|---|
public static WriteBehindStateWriter getCurrentInstance()
| |
| getNextDelimiterIndex | back to summary |
|---|---|
private static int getNextDelimiterIndex(StringBuilder builder, int offset)
| |
| getState | back to summary |
|---|---|
| private StringBuilder getState(StateManager stateManager, ResponseWriter origWriter) throws IOException Get the state. In JSF 2.2 it is required by the specification that the view state hidden input in each h:form has a unique id. So we have to call this method multiple times as each h:form needs to generate the element id for itself.
| |
| release | back to summary |
|---|---|
| public void release() Clear the ThreadLocal state. | |
| stateWritten | back to summary |
|---|---|
public boolean stateWritten()
| |
| write | back to summary |
|---|---|
| public void write(int c) throws IOException Overrides java. Writes directly to the current
| |
| write | back to summary |
|---|---|
| public void write(char[] cbuf) throws IOException Overrides java. Writes directly to the current
| |
| write | back to summary |
|---|---|
| public void write(String str) throws IOException Overrides java. Writes directly to the current
| |
| write | back to summary |
|---|---|
| public void write(String str, int off, int len) throws IOException Overrides java. Writes directly to the current
| |
| write | back to summary |
|---|---|
| public void write(char[] cbuf, int off, int len) throws IOException Implements abstract java. Writes directly to the current
| |
| writingState | back to summary |
|---|---|
| public void writingState() When called, the original writer is backed up and replaced with a new FastStringWriter. All content written after this method is called will then be buffered and written out later after the entire view has been rendered. | |