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 Stringprivate final Stringprivate booleanprivate booleanstatic final intFields inherited from class PrintWriter
out -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class 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, writeMethods inherited from class 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 underlyingWriterto 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:
printin classPrintWriter
-
println
- Overrides:
printlnin classPrintWriter
-
println
-
print
-
doPrefix
private void doPrefix(int lineNumber)
-