|
JSPTemplates | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.Writer | +--java.io.StringWriter | +--org.tp23.jasper.runtime.ClearableStringWriter
This has been cribbed of Java StringWriter but allows the StringBufferinside to be emptied. This means that if someone wants to forward the destination we can clear the contents so anyone holding a reference to the origional writer will not have the string content that is meant to be discarded
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
ClearableStringWriter()
Create a new string writer, using the default initial string-buffer size. |
|
ClearableStringWriter(int initialSize)
Create a new string writer, using the specified initial string-buffer size. |
Method Summary | |
void |
clear()
|
void |
close()
Close the stream. |
void |
flush()
Flush the stream. |
java.lang.StringBuffer |
getBuffer()
Return the string buffer itself. |
int |
getRemaining()
|
java.lang.String |
toString()
Return the buffer's current value as a string. |
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(java.lang.String str)
Write a string. |
void |
write(java.lang.String str,
int off,
int len)
Write a portion of a string. |
Methods inherited from class java.io.Writer |
write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClearableStringWriter()
public ClearableStringWriter(int initialSize)
initialSize
- an int specifying the initial size of the buffer.Method Detail |
public void write(int c)
write
in class java.io.StringWriter
public void write(char[] cbuf, int off, int len)
write
in class java.io.StringWriter
cbuf
- Array of charactersoff
- Offset from which to start writing characterslen
- Number of characters to writepublic void write(java.lang.String str)
write
in class java.io.StringWriter
public void write(java.lang.String str, int off, int len)
write
in class java.io.StringWriter
str
- String to be writtenoff
- Offset from which to start writing characterslen
- Number of characters to writepublic java.lang.String toString()
toString
in class java.io.StringWriter
public java.lang.StringBuffer getBuffer()
getBuffer
in class java.io.StringWriter
public void flush()
flush
in class java.io.StringWriter
public void close() throws java.io.IOException
close
in class java.io.StringWriter
public void clear()
public int getRemaining()
|
JSPTemplates | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |