Package com.strobel.decompiler
Class LineNumberPrintWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
com.strobel.decompiler.LineNumberPrintWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
A specialization of
PrintWriter
which can automatically prefix lines with a
Java-commented, justified line number. This class overrides only the
print(String)
and println(String)
methods, therefore all other
methods must be avoided.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final String
private boolean
private boolean
static final int
Fields inherited from class java.io.PrintWriter
out
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
Methods inherited from class java.io.Writer
nullWriter
-
Field Details
-
NO_LINE_NUMBER
public static final int NO_LINE_NUMBER- See Also:
-
_emptyPrefix
-
_format
-
_needsPrefix
private boolean _needsPrefix -
_suppressLineNumbers
private boolean _suppressLineNumbers
-
-
Constructor Details
-
LineNumberPrintWriter
Creates an instance. The only valid "print" methods to call areprint(String)
andprintln(String)
.- Parameters:
maxLineNo
- the highest line number that 'this' will ever encounterw
- the underlyingWriter
to which characters are printed.
-
-
Method Details
-
suppressLineNumbers
public void suppressLineNumbers()Causes 'this' printer to not emit any line numbers or any whitespace padding. -
print
- Overrides:
print
in classPrintWriter
-
println
- Overrides:
println
in classPrintWriter
-
println
-
print
-
doPrefix
private void doPrefix(int lineNumber)
-