|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
net.sf.mmm.util.io.base.EscapeWriter
public class EscapeWriter
This is a wrapper for a writer that allows to map specific characters to a
escape sequences given a strings.
The mapping table for escaping is given as string array.
EscapeWriter(Object, String[], Writer)| Field Summary | |
|---|---|
private String[] |
characterEscapingTable
A table that maps chars (as index) to escape sequences. |
private Writer |
writer
the actual writer |
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
EscapeWriter(Object syncLock,
String[] charEscapeTable,
Writer plainWriter)
The constructor. |
|
EscapeWriter(String[] charEscapeTable,
Writer plainWriter)
The constructor. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
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 |
| Field Detail |
|---|
private final String[] characterEscapingTable
private final Writer writer
| Constructor Detail |
|---|
public EscapeWriter(String[] charEscapeTable,
Writer plainWriter)
charEscapeTable - is a String array that maps characters by to escape
sequences. If the numeric representation of a character is a legal
index for the given array and the String at that index is
null that string is written instead of the character.
In all other cases, the character is written without change.plainWriter - is the writer that is wrapped.EscapeWriter(Object, String[], Writer)
public EscapeWriter(Object syncLock,
String[] charEscapeTable,
Writer plainWriter)
syncLock - is an explicit lock object used for synchronization (see
Writer.Writer(java.lang.Object)).charEscapeTable - is a String array that maps characters by to escape
sequences. If the numeric representation of a character is a legal
index for the given array and the String at that index is NOT
null that string is written instead of the character.
In all other cases, the character is written without change.plainWriter - is the writer that is wrapped.| Method Detail |
|---|
public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOException
public void flush()
throws IOException
flush in interface Flushableflush in class WriterIOException
public void close()
throws IOException
close in interface Closeableclose in class WriterIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||