- All Known Subinterfaces:
ClassPrinter.LeafNode,ClassPrinter.ListNode,ClassPrinter.MapNode
- All Known Implementing Classes:
ClassPrinterImpl.LeafNodeImpl,ClassPrinterImpl.ListNodeImpl,ClassPrinterImpl.MapNodeImpl
- Enclosing class:
ClassPrinter
public static sealed interface ClassPrinter.Node
permits ClassPrinter.MapNode, ClassPrinter.LeafNode, ClassPrinter.ListNode
Named, traversable, and printable node parent.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionname()Printable name of the node.default voidPrints the node and its sub-tree into JSON format.default voidPrints the node and its sub-tree into XML format.default voidPrints the node and its sub-tree into YAML format.walk()Walks through the underlying tree.
-
Method Details
-
name
ConstantDesc name()Printable name of the node.- Returns:
- name of the node
-
walk
Stream<ClassPrinter.Node> walk()Walks through the underlying tree.- Returns:
- ordered stream of nodes
-
toJson
Prints the node and its sub-tree into JSON format.- Parameters:
out- consumer of the printed fragments
-
toXml
Prints the node and its sub-tree into XML format.- Parameters:
out- consumer of the printed fragments
-
toYaml
Prints the node and its sub-tree into YAML format.- Parameters:
out- consumer of the printed fragments
-