Package com.strobel.decompiler
Class LineNumberFormatter
java.lang.Object
com.strobel.decompiler.LineNumberFormatter
A
LineNumberFormatter is used to rewrite an existing .java file, introducing
line number information. It can handle either, or both, of the following jobs:
- Introduce line numbers as leading comments.
- Stretch the file so that the line number comments match the physical lines.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLineNumberFormatter(File file, List<LineNumberPosition> lineNumberPositions, EnumSet<LineNumberFormatter.LineNumberOption> options) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidRewrites the file passed to 'this' constructor so that the actual line numbers match the recipe passed to 'this' constructor.
-
Constructor Details
-
LineNumberFormatter
public LineNumberFormatter(File file, List<LineNumberPosition> lineNumberPositions, EnumSet<LineNumberFormatter.LineNumberOption> options) Constructs an instance.- Parameters:
file- the file whose line numbers should be fixedlineNumberPositions- a recipe for how to fix the line numbers in 'file'.options- controls how 'this' represents line numbers in the resulting file
-
-
Method Details
-
reformatFile
Rewrites the file passed to 'this' constructor so that the actual line numbers match the recipe passed to 'this' constructor.- Throws:
IOException
-