|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
net.sourceforge.stripes.tag.layout.LayoutWriter
public class LayoutWriter
A writer that wraps around the normal JSP writer with the ability to silence the output
temporarily. This is required to prevent the non-layout contents of a LayoutDefinitionTag
from rendering more than once when LayoutRenderTag
s and LayoutComponentTag
s are
nested within it. The definition tag silences output during a component render phase, and the
component that wishes to render turns output back on during its body evaluation.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
LayoutWriter(JspWriter out)
Create a new layout writer that wraps the given JSP writer. |
Method Summary | |
---|---|
void |
clear()
Calls JspWriter.clear() on the wrapped JSP writer. |
void |
close()
|
String |
closeBuffer(PageContext pageContext)
Flush the page context's output buffer and resume sending output to the writer that was receiving output prior to calling openBuffer(PageContext) . |
void |
flush()
|
protected Writer |
getOut()
Get the writer to which output is currently being written. |
boolean |
isSilent()
If true, then discard all output. |
void |
openBuffer(PageContext pageContext)
Flush the page context's output buffer and redirect output into a buffer. |
void |
setSilent(boolean silent,
PageContext pageContext)
Enable or disable silent mode. |
protected void |
tryFlush(PageContext pageContext)
Try to flush the page context's output buffer. |
void |
write(char[] cbuf,
int off,
int len)
|
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LayoutWriter(JspWriter out)
out
- The JSP writer to which output will be written.Method Detail |
---|
protected Writer getOut()
public boolean isSilent()
public void setSilent(boolean silent, PageContext pageContext) throws IOException
silent
- True to silence output, false to enable output.pageContext
- The page context in use at the time output is to be silenced.
IOException
- If an error occurs writing to output.public void openBuffer(PageContext pageContext)
closeBuffer(PageContext)
.
public String closeBuffer(PageContext pageContext)
openBuffer(PageContext)
.
protected void tryFlush(PageContext pageContext)
public void close() throws IOException
close
in interface Closeable
close
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void clear() throws IOException
JspWriter.clear()
on the wrapped JSP writer.
IOException
public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |