Class TextOutputFormatter
java.lang.Object
com.strobel.decompiler.languages.java.TextOutputFormatter
- All Implemented Interfaces:
IOutputFormatter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumwhether or not to emit debug line number comments into the source code -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate booleanprivate booleanprivate intwhen writing out line numbers, keeps track of the most recently used one to avoid redundancyprivate booleanprivate final List<LineNumberPosition> maps original line numbers to decompiler-emitted line numbers and columnsprivate OffsetToLineNumberConverterconverts from bytecode offset to line numberprivate final ITextOutputprivate final Stack<TextLocation> -
Constructor Summary
ConstructorsConstructorDescriptionTextOutputFormatter(ITextOutput output, TextOutputFormatter.LineNumberMode lineNumberMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseBrace(BraceStyle style) voidprivate Objectprivate Objectprivate Objectprivate MemberReferenceprivate ModuleReferenceprivate PackageReferenceprivate MemberReferenceReturns the mapping from original to decompiler-emitted line numbers.voidindent()private static booleanisDefinition(AstNode node) private booleanisImportDeclaration(AstNode node) voidnewLine()voidopenBrace(BraceStyle style) voidresetLineNumberOffsets(OffsetToLineNumberConverter offset2LineNumber) instructs 'this' formatter to forget what it used to know about the sequence of line number offsets in the source codevoidspace()voidvoidunindent()voidwriteComment(CommentType commentType, String content) voidwriteDelimiter(String token) voidwriteIdentifier(String identifier) voidwriteKeyword(String keyword) voidwriteLabel(String label) voidwriteLiteral(String value) voidwriteOperator(String token) voidwriteTextBlock(String value) voidwriteTextLiteral(String value) voidwriteToken(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:
startNodein interfaceIOutputFormatter
-
endNode
- Specified by:
endNodein interfaceIOutputFormatter
-
writeLabel
- Specified by:
writeLabelin interfaceIOutputFormatter
-
writeIdentifier
- Specified by:
writeIdentifierin interfaceIOutputFormatter
-
writeKeyword
- Specified by:
writeKeywordin interfaceIOutputFormatter
-
writeOperator
- Specified by:
writeOperatorin interfaceIOutputFormatter
-
writeDelimiter
- Specified by:
writeDelimiterin interfaceIOutputFormatter
-
writeToken
- Specified by:
writeTokenin interfaceIOutputFormatter
-
writeLiteral
- Specified by:
writeLiteralin interfaceIOutputFormatter
-
writeTextLiteral
- Specified by:
writeTextLiteralin interfaceIOutputFormatter
-
writeTextBlock
- Specified by:
writeTextBlockin interfaceIOutputFormatter
-
space
public void space()- Specified by:
spacein interfaceIOutputFormatter
-
openBrace
- Specified by:
openBracein interfaceIOutputFormatter
-
closeBrace
- Specified by:
closeBracein interfaceIOutputFormatter
-
indent
public void indent()- Specified by:
indentin interfaceIOutputFormatter
-
unindent
public void unindent()- Specified by:
unindentin interfaceIOutputFormatter
-
newLine
public void newLine()- Specified by:
newLinein interfaceIOutputFormatter
-
writeComment
- Specified by:
writeCommentin interfaceIOutputFormatter
-
getCurrentDefinition
-
getCurrentTypeReference
-
getCurrentModuleReference
-
getCurrentPackageReference
-
getCurrentMemberReference
-
getCurrentLocalReference
-
getCurrentLocalDefinition
-
isDefinition
-
isImportDeclaration
-
resetLineNumberOffsets
Description copied from interface:IOutputFormatterinstructs 'this' formatter to forget what it used to know about the sequence of line number offsets in the source code- Specified by:
resetLineNumberOffsetsin interfaceIOutputFormatter
-
getLineNumberPositions
Returns the mapping from original to decompiler-emitted line numbers.
-