public class LexicalPreservingPrinter extends Object
| Modifier and Type | Field and Description |
|---|---|
static DataKey<com.github.javaparser.printer.lexicalpreservation.NodeText> |
NODE_TEXT_DATA
The nodetext for a node is stored in the node's data field.
|
| Constructor and Description |
|---|
LexicalPreservingPrinter() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isAvailableOn(Node node) |
static String |
print(Node node)
Prints the given node to a string while preserving the original formatting
where possible and applying changes where the AST has been modified.
|
static <N extends Node> |
setup(N node)
Initializes lexical preservation for the given CompilationUnit.
|
public static final DataKey<com.github.javaparser.printer.lexicalpreservation.NodeText> NODE_TEXT_DATA
public static <N extends Node> N setup(N node)
cu - The CompilationUnit to setup for lexical preservationpublic static boolean isAvailableOn(Node node)
public static String print(Node node)
node - The node to print (typically a CompilationUnit)Copyright © 2007–2026. All rights reserved.