org.apache.myfaces.tobago.internal.context
Class ResponseWriterDivider

java.lang.Object
  extended by org.apache.myfaces.tobago.internal.context.ResponseWriterDivider

public class ResponseWriterDivider
extends Object

In some cases the rendered output must be places in the Response in a different order than it was rendered. The ResponseWriterDivider helps to manage a list of buffers which holds the temporary output.


Method Summary
 boolean activateBranch(javax.faces.context.FacesContext facesContext)
          Create (if needed) and activate a new branch.
static ResponseWriterDivider getInstance(javax.faces.context.FacesContext facesContext, String nameInRequest)
           
 boolean passivateBranch(javax.faces.context.FacesContext facesContext)
          Passivate the current branch.
 String toString()
           
 void writeOutAndCleanUp(javax.faces.context.FacesContext facesContext)
          Write the collected stuff in the original writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static ResponseWriterDivider getInstance(javax.faces.context.FacesContext facesContext,
                                                String nameInRequest)

activateBranch

public boolean activateBranch(javax.faces.context.FacesContext facesContext)
Create (if needed) and activate a new branch. After this call, all output will be stored in this new branch.

It is usually needed to get the response writer again with HtmlRendererUtils.getTobagoResponseWriter();

Returns:
true if the branch was not created new. So the branch was already existent.

passivateBranch

public boolean passivateBranch(javax.faces.context.FacesContext facesContext)
Passivate the current branch. After this call, all output will be written in the former branch (if any) or into the original writer.

It is usually needed to get the response writer again with HtmlRendererUtils.getTobagoResponseWriter();

Returns:
true, if the current writer is not the original writer. So the "stack" is at the bottom.

writeOutAndCleanUp

public void writeOutAndCleanUp(javax.faces.context.FacesContext facesContext)
                        throws IOException
Write the collected stuff in the original writer. This is always the last call on this object.

Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.