|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer java.io.PrintWriter SK.gnome.dwarf.utils.io.HTMLPrintWriter
Provides a writer for HTML rendering.
This writer replaces "<", ">", "&" and double quotes with the special HTML entities <, >, & and ". It should be used primarily for writing small portions of an ordinary text when it will be HTML-rendered before displaying to the user. This prevents disappearing some text in the rendered output because of these special characters.
Field Summary |
Fields inherited from class java.io.PrintWriter |
out |
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
HTMLPrintWriter(java.io.Writer out)
Creates a new HTMLPrintWriter. |
|
HTMLPrintWriter(java.io.Writer out,
boolean autoFlush)
Creates a new HTMLPrintWriter writer. |
Method Summary | |
static java.lang.String |
decode(java.lang.String s)
Decodes the given string. |
static java.lang.String |
encode(java.lang.String s)
Encodes the given string. |
void |
write(char[] cbuf,
int off,
int len)
Writes a portion of an array of characters. |
void |
write(int c)
Writes a single character. |
void |
write(java.lang.String s,
int off,
int len)
Writes a portion of a string. |
Methods inherited from class java.io.PrintWriter |
close, flush, checkError, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setError, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HTMLPrintWriter(java.io.Writer out)
out
- a Writer object to provide the underlying streampublic HTMLPrintWriter(java.io.Writer out, boolean autoFlush)
out
- a Writer object to provide the underlying stream.autoFlush
- a boolean; if true, the println() methods will flush the output buffer.Method Detail |
public void write(int c)
c
- a characterpublic void write(char[] cbuf, int off, int len)
cbuf
- buffer of characters to be writtenoff
- offset from which to start reading characterslen
- number of characters to be writtenpublic void write(java.lang.String s, int off, int len)
s
- A Stringoff
- Offset from which to start writing characterslen
- Number of characters to writepublic static java.lang.String encode(java.lang.String s)
Replaces "<", ">", "&" and double quotes in the string with the special HTML entities <, >, & and ".
s
- string to encode
public static java.lang.String decode(java.lang.String s)
Replaces the special HTML entities <, >, & and " in the string with the "<", ">", "&" and double quotes characters.
s
- string to decode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |