Class TreeVisitingPrinter

java.lang.Object
org.openrewrite.TreeVisitor<J,P>
org.openrewrite.java.JavaVisitor<P>
org.openrewrite.java.JavaIsoVisitor<org.openrewrite.ExecutionContext>
org.openrewrite.java.TreeVisitingPrinter

public class TreeVisitingPrinter extends JavaIsoVisitor<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 Details

    • TreeVisitingPrinter

      protected TreeVisitingPrinter(boolean skipUnvisitedElement)
  • Method Details

    • printTree

      public static String printTree(J j)
      print tree with skip unvisited elements
    • printTreeAll

      public static String printTreeAll(J j)
      print tree including all unvisited elements
    • visit

      @Nullable public @Nullable J visit(@Nullable @Nullable org.openrewrite.Tree tree, org.openrewrite.ExecutionContext ctx)
      Overrides:
      visit in class org.openrewrite.TreeVisitor<J,org.openrewrite.ExecutionContext>