Class TextOutputFormatter
java.lang.Object
com.strobel.decompiler.languages.java.TextOutputFormatter
- All Implemented Interfaces:
IOutputFormatter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
whether or not to emit debug line number comments into the source code -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private boolean
private boolean
private int
when writing out line numbers, keeps track of the most recently used one to avoid redundancyprivate boolean
private final List
<LineNumberPosition> maps original line numbers to decompiler-emitted line numbers and columnsprivate OffsetToLineNumberConverter
converts from bytecode offset to line numberprivate final ITextOutput
private final Stack
<TextLocation> -
Constructor Summary
ConstructorsConstructorDescriptionTextOutputFormatter
(ITextOutput output, TextOutputFormatter.LineNumberMode lineNumberMode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
closeBrace
(BraceStyle style) void
private Object
private Object
private Object
private MemberReference
private ModuleReference
private PackageReference
private MemberReference
Returns the mapping from original to decompiler-emitted line numbers.void
indent()
private static boolean
isDefinition
(AstNode node) private boolean
isImportDeclaration
(AstNode node) void
newLine()
void
openBrace
(BraceStyle style) void
resetLineNumberOffsets
(OffsetToLineNumberConverter offset2LineNumber) instructs 'this' formatter to forget what it used to know about the sequence of line number offsets in the source codevoid
space()
void
void
unindent()
void
writeComment
(CommentType commentType, String content) void
writeDelimiter
(String token) void
writeIdentifier
(String identifier) void
writeKeyword
(String keyword) void
writeLabel
(String label) void
writeLiteral
(String value) void
writeOperator
(String token) void
writeTextBlock
(String value) void
writeTextLiteral
(String value) void
writeToken
(String token)
-
Field Details
-
output
-
nodeStack
-
braceLevelWithinType
private int braceLevelWithinType -
inDocumentationComment
private boolean inDocumentationComment -
firstUsingDeclaration
private boolean firstUsingDeclaration -
lastUsingDeclaration
private boolean lastUsingDeclaration -
lineNumberMode
-
lastObservedLineNumber
private int lastObservedLineNumberwhen writing out line numbers, keeps track of the most recently used one to avoid redundancy -
offset2LineNumber
converts from bytecode offset to line number -
lineNumberPositions
maps original line numbers to decompiler-emitted line numbers and columns -
startLocations
-
-
Constructor Details
-
TextOutputFormatter
-
-
Method Details
-
startNode
- Specified by:
startNode
in interfaceIOutputFormatter
-
endNode
- Specified by:
endNode
in interfaceIOutputFormatter
-
writeLabel
- Specified by:
writeLabel
in interfaceIOutputFormatter
-
writeIdentifier
- Specified by:
writeIdentifier
in interfaceIOutputFormatter
-
writeKeyword
- Specified by:
writeKeyword
in interfaceIOutputFormatter
-
writeOperator
- Specified by:
writeOperator
in interfaceIOutputFormatter
-
writeDelimiter
- Specified by:
writeDelimiter
in interfaceIOutputFormatter
-
writeToken
- Specified by:
writeToken
in interfaceIOutputFormatter
-
writeLiteral
- Specified by:
writeLiteral
in interfaceIOutputFormatter
-
writeTextLiteral
- Specified by:
writeTextLiteral
in interfaceIOutputFormatter
-
writeTextBlock
- Specified by:
writeTextBlock
in interfaceIOutputFormatter
-
space
public void space()- Specified by:
space
in interfaceIOutputFormatter
-
openBrace
- Specified by:
openBrace
in interfaceIOutputFormatter
-
closeBrace
- Specified by:
closeBrace
in interfaceIOutputFormatter
-
indent
public void indent()- Specified by:
indent
in interfaceIOutputFormatter
-
unindent
public void unindent()- Specified by:
unindent
in interfaceIOutputFormatter
-
newLine
public void newLine()- Specified by:
newLine
in interfaceIOutputFormatter
-
writeComment
- Specified by:
writeComment
in interfaceIOutputFormatter
-
getCurrentDefinition
-
getCurrentTypeReference
-
getCurrentModuleReference
-
getCurrentPackageReference
-
getCurrentMemberReference
-
getCurrentLocalReference
-
getCurrentLocalDefinition
-
isDefinition
-
isImportDeclaration
-
resetLineNumberOffsets
Description copied from interface:IOutputFormatter
instructs 'this' formatter to forget what it used to know about the sequence of line number offsets in the source code- Specified by:
resetLineNumberOffsets
in interfaceIOutputFormatter
-
getLineNumberPositions
Returns the mapping from original to decompiler-emitted line numbers.
-