Package org.openrewrite.java
Class TreeVisitingPrinter
java.lang.Object
org.openrewrite.TreeVisitor<org.openrewrite.Tree,org.openrewrite.ExecutionContext>
org.openrewrite.java.TreeVisitingPrinter
public class TreeVisitingPrinter
extends org.openrewrite.TreeVisitor<org.openrewrite.Tree,org.openrewrite.ExecutionContext>
A visitor to print a tree visiting order and hierarchy in format like below.
----J.CompilationUnit |-------J.Import | "..." | \---J.FieldAccess | "..." | ... \---J.ClassDeclaration |---J.Identifier | "..." \---J.Block ...
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
printTree
(org.openrewrite.Cursor cursor) print the entire LST tree with skip unvisited elements by given any cursor in this tree.static String
printTree
(org.openrewrite.Tree tree) print tree with skip unvisited elementsstatic String
printTreeAll
(org.openrewrite.Cursor cursor) print entire tree including all unvisited elements by given any cursor in this tree.static String
printTreeAll
(org.openrewrite.Tree tree) print tree including all unvisited elements@Nullable org.openrewrite.Tree
visit
(@Nullable org.openrewrite.Tree tree, org.openrewrite.ExecutionContext ctx) Methods inherited from class org.openrewrite.TreeVisitor
adapt, collect, collect, defaultValue, doAfterVisit, getAfterVisit, getCursor, getLanguage, isAcceptable, isAdaptableTo, noop, postVisit, preVisit, reduce, reduce, reduce, setCursor, stopAfterPreVisit, updateCursor, visit, visit, visitAndCast, visitAndCast, visitMarker, visitMarkers, visitNonNull, visitNonNull, visitorTreeType
-
Constructor Details
-
TreeVisitingPrinter
protected TreeVisitingPrinter(boolean skipUnvisitedElement)
-
-
Method Details
-
printTree
print the entire LST tree with skip unvisited elements by given any cursor in this tree. -
printTree
print tree with skip unvisited elements -
printTreeAll
print entire tree including all unvisited elements by given any cursor in this tree. -
printTreeAll
print tree including all unvisited elements -
visit
public @Nullable org.openrewrite.Tree visit(@Nullable org.openrewrite.Tree tree, org.openrewrite.ExecutionContext ctx) - Overrides:
visit
in classorg.openrewrite.TreeVisitor<org.openrewrite.Tree,
org.openrewrite.ExecutionContext>
-