public class EscapeWriter extends Writer
EscapeWriter(Object, String[], Writer)
Modifier and Type | Field and Description |
---|---|
private String[] |
characterEscapingTable
A table that maps chars (as index) to escape sequences.
|
private Writer |
writer
the actual writer
|
Constructor and Description |
---|
EscapeWriter(Object syncLock,
String[] charEscapeTable,
Writer plainWriter)
The constructor.
|
EscapeWriter(String[] charEscapeTable,
Writer plainWriter)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len) |
private final String[] characterEscapingTable
private final Writer writer
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.public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
Copyright © 2001–2016 mmm-Team. All rights reserved.