Package org.apache.ofbiz.base.util
Class IndentingWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.apache.ofbiz.base.util.IndentingWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class IndentingWriter extends java.io.FilterWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
doNewline
protected boolean
doSpace
protected java.lang.StringBuilder
indent
protected boolean
lastWasNewline
-
Constructor Summary
Constructors Constructor Description IndentingWriter(java.io.Writer out)
IndentingWriter(java.io.Writer out, boolean doSpace, boolean doNewline)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkAfterNewline()
static IndentingWriter
makeIndentingWriter(java.io.Writer writer)
IndentingWriter
newline()
IndentingWriter
pop()
IndentingWriter
push()
IndentingWriter
space()
void
write(char[] buf)
void
write(char[] buf, int offset, int length)
void
write(int c)
void
write(java.lang.String s)
void
write(java.lang.String s, int offset, int length)
-
-
-
Method Detail
-
makeIndentingWriter
public static IndentingWriter makeIndentingWriter(java.io.Writer writer)
-
newline
public IndentingWriter newline() throws java.io.IOException
- Throws:
java.io.IOException
-
checkAfterNewline
protected void checkAfterNewline() throws java.io.IOException
- Throws:
java.io.IOException
-
push
public IndentingWriter push()
-
pop
public IndentingWriter pop()
-
space
public IndentingWriter space() throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(char[] buf) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(char[] buf, int offset, int length) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterWriter
- Throws:
java.io.IOException
-
write
public void write(int c) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterWriter
- Throws:
java.io.IOException
-
write
public void write(java.lang.String s) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(java.lang.String s, int offset, int length) throws java.io.IOException
- Overrides:
write
in classjava.io.FilterWriter
- Throws:
java.io.IOException
-
-