Interface ClassPrinter.Node

All Known Subinterfaces:
ClassPrinter.LeafNode, ClassPrinter.ListNode, ClassPrinter.MapNode
Enclosing class:
ClassPrinter

public static sealed interface ClassPrinter.Node permits ClassPrinter.LeafNode, ClassPrinter.ListNode, ClassPrinter.MapNode
Named, traversable, and printable node parent.
Since:
24
  • Method Details

    • name

      ConstantDesc name()
      Printable name of the node.
      Returns:
      name of the node
    • walk

      Walks through the underlying tree.
      Returns:
      ordered stream of nodes
    • toJson

      default void toJson(Consumer<String> out)
      Prints the node and its sub-tree into JSON format.
      Parameters:
      out - consumer of the printed fragments
    • toXml

      default void toXml(Consumer<String> out)
      Prints the node and its sub-tree into XML format.
      Parameters:
      out - consumer of the printed fragments
    • toYaml

      default void toYaml(Consumer<String> out)
      Prints the node and its sub-tree into YAML format.
      Parameters:
      out - consumer of the printed fragments