|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jena.atlas.io.AWriterBase
org.apache.jena.atlas.io.IndentedWriter
public class IndentedWriter
A writer that records what the current indentation level is, and uses that to insert a prefix at each line. It can also insert line numbers at the beginning of lines.
| Field Summary | |
|---|---|
static IndentedWriter |
stderr
Stderr wrapped in an IndentedWriter - no line numbers |
static IndentedWriter |
stdout
Stdout wrapped in an IndentedWriter - no line numbers |
| Constructor Summary | |
|---|---|
IndentedWriter(OutputStream outStream)
Construct a UTF8 IndentedWriter around an OutputStream |
|
IndentedWriter(OutputStream outStream,
boolean withLineNumbers)
Construct a UTF8 IndentedWriter around an OutputStream |
|
| Method Summary | |
|---|---|
boolean |
atLineStart()
|
void |
close()
|
void |
decIndent()
|
void |
decIndent(int x)
|
void |
ensureStartOfLine()
|
void |
flush()
|
int |
getAbsoluteIndent()
|
int |
getCol()
Get the absolute column. |
int |
getCurrentOffset()
Position past current indent |
String |
getEndOfLineMarker()
|
boolean |
getFlushOnNewline()
Flush on newline |
int |
getIndent()
Deprecated. Use getAbsoluteIndent() |
char |
getPadChar()
|
String |
getPadString()
|
int |
getRow()
Get row/line (counts from 1) |
int |
getUnitIndent()
|
boolean |
hasLineNumbers()
|
void |
incIndent()
|
void |
incIndent(int x)
|
boolean |
inFlatMode()
Flat mode - print without NL, for a more compact representation - depends on caller |
void |
newline()
|
void |
pad()
Pad to the indent (if we are before it) |
void |
pad(int col)
Pad to a given number of columns EXCLUDING the indent. |
void |
pad(int col,
boolean absoluteColumn)
Pad to a given number of columns maybe including the indent. |
void |
print(char ch)
|
void |
print(char[] cbuf)
|
void |
print(char ch,
int n)
Print a char N times |
void |
print(String str)
|
void |
print(String s,
int n)
Print a string N times |
void |
printf(String formatStr,
Object... args)
|
void |
println()
|
void |
println(char ch)
|
void |
println(String str)
|
void |
setAbsoluteIndent(int x)
|
void |
setEndOfLineMarker(String marker)
Set the marker included at end of line - set to null for "none". |
void |
setFlatMode(boolean flatMode)
|
void |
setFlushOnNewline(boolean flushOnNewline)
|
void |
setLineNumbers(boolean lineNumbers)
|
void |
setPadChar(char ch)
|
void |
setPadString(String str)
|
void |
setUnitIndent(int x)
|
String |
toString()
|
| Methods inherited from class org.apache.jena.atlas.io.AWriterBase |
|---|
write, write, write |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.jena.atlas.io.AWriter |
|---|
write, write, write |
| Field Detail |
|---|
public static final IndentedWriter stdout
public static final IndentedWriter stderr
| Constructor Detail |
|---|
public IndentedWriter(OutputStream outStream)
public IndentedWriter(OutputStream outStream,
boolean withLineNumbers)
| Method Detail |
|---|
public void print(String str)
print in interface AWriter
public void printf(String formatStr,
Object... args)
printf in interface AWriterpublic void print(char ch)
print in interface AWriterpublic void println(String str)
println in interface AWriterpublic void println(char ch)
public void println()
println in interface AWriterpublic void print(char[] cbuf)
print in interface AWriter
public void print(String s,
int n)
public void print(char ch,
int n)
public void newline()
public void ensureStartOfLine()
public void close()
close in interface AWriterclose in interface Closeablepublic void flush()
flush in interface AWriterpublic void pad()
public void pad(int col)
col - Column number (first column is 1).
public void pad(int col,
boolean absoluteColumn)
col - Column number (first column is 1).absoluteColumn - Whether to include the indentpublic int getRow()
public int getCol()
@Deprecated public int getIndent()
public int getAbsoluteIndent()
public void setAbsoluteIndent(int x)
public int getCurrentOffset()
public boolean hasLineNumbers()
public void setLineNumbers(boolean lineNumbers)
public String getEndOfLineMarker()
public void setEndOfLineMarker(String marker)
public boolean inFlatMode()
public void setFlatMode(boolean flatMode)
public boolean getFlushOnNewline()
public void setFlushOnNewline(boolean flushOnNewline)
public char getPadChar()
public void setPadChar(char ch)
public String getPadString()
public void setPadString(String str)
public void incIndent()
public void incIndent(int x)
public void decIndent()
public void decIndent(int x)
public void setUnitIndent(int x)
public int getUnitIndent()
public boolean atLineStart()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||