tudresden.ocl.injection.reverseeng
Class IndentAwareWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
tudresden.ocl.injection.reverseeng.IndentAwareWriter
- public class IndentAwareWriter
- extends FilterWriter
A writer that is aware of the current indent level. The indent level is defined as the number of
consecutive spaces/tabs since the last \n.
- Version:
- 0.1
- Author:
- sz9 (Steffen Zschaler)
Field Summary |
private boolean |
m_fCollectIndent
true if indent should be accumulated (i.e., after \n until the first character different from
' ' and \n) |
private int |
m_nCurrentIndent
Current indent level. |
private int |
m_nLastIndent
Indent found before last \n. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_nCurrentIndent
private int m_nCurrentIndent
- Current indent level.
m_nLastIndent
private int m_nLastIndent
- Indent found before last \n.
m_fCollectIndent
private boolean m_fCollectIndent
- true if indent should be accumulated (i.e., after \n until the first character different from
' ' and \n)
IndentAwareWriter
public IndentAwareWriter(Writer wSource)
- Creates new IndentAwareWriter
write
public void write(int c)
throws IOException
- Throws:
IOException
write
public void write(String s,
int off,
int len)
throws IOException
- Throws:
IOException
write
public void write(char[] cbuf,
int off,
int len)
throws IOException
- Throws:
IOException
resetIndent
private void resetIndent()
getCurrentIndent
public int getCurrentIndent()
getLastIndent
public int getLastIndent()
Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.