com.ctc.wstx.util
Class LineSuppressWriter
java.lang.Object
java.io.Writer
com.ctc.wstx.util.LineSuppressWriter
- public class LineSuppressWriter
- extends java.io.Writer
Simple decorator Writer, that can optionally suppress empty lines (lines
with only white space content); configuration is done by specifying
what is the maximum number of consequtive empty lines allowed. Setting
this value to 0 will filter out all lines; setting it to, say,
Integer.MAX_VALUE essentially does nothing.
Note: only ascii white space (space char and below) are considered
white space.
| Fields inherited from class java.io.Writer |
lock |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mWriter
protected final java.io.Writer mWriter
mMaxEmptyLines
protected int mMaxEmptyLines
mTrimLeading
protected boolean mTrimLeading
mTrimTrailing
protected boolean mTrimTrailing
mCurrEmptyLines
protected int mCurrEmptyLines
mCurrLine
protected char[] mCurrLine
mCurrPtr
protected int mCurrPtr
mCurrIsEmpty
protected boolean mCurrIsEmpty
mSingleCharBuf
protected char[] mSingleCharBuf
LineSuppressWriter
public LineSuppressWriter(java.io.Writer sink)
setMaxConsequtiveEmptyLines
public void setMaxConsequtiveEmptyLines(int max)
setTrim
public void setTrim(boolean lead,
boolean trail)
setTrimLeading
public void setTrimLeading(boolean state)
setTrimTrailing
public void setTrimTrailing(boolean state)
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(char[] cbuf)
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(int c)
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(java.lang.String str)
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException