Class LexicalPreservingPrinter
- java.lang.Object
-
- com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter
-
public class LexicalPreservingPrinter extends Object
A Lexical Preserving Printer is used to capture all the lexical information while parsing, update them when operating on the AST and then used them to reproduce the source code in its original formatting including the AST changes.
-
-
Constructor Summary
Constructors Constructor Description LexicalPreservingPrinter(Node node)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
print(Node node)
Print a Node into a String, preserving the lexical information.void
print(Node node, Writer writer)
Print a Node into a Writer, preserving the lexical information.static <N extends Node>
Pair<ParseResult<N>,LexicalPreservingPrinter>setup(ParseStart<N> parseStart, Provider provider)
Deprecated.just use the other constructor.String
toString()
-
-
-
Constructor Detail
-
LexicalPreservingPrinter
public LexicalPreservingPrinter(Node node)
-
-
Method Detail
-
setup
public static <N extends Node> Pair<ParseResult<N>,LexicalPreservingPrinter> setup(ParseStart<N> parseStart, Provider provider)
Deprecated.just use the other constructor.Parse the code and setup the LexicalPreservingPrinter.
-
print
public String print(Node node)
Print a Node into a String, preserving the lexical information.
-
print
public void print(Node node, Writer writer) throws IOException
Print a Node into a Writer, preserving the lexical information.- Throws:
IOException
-
-