Interface ClassPrinter.Node
- All Known Subinterfaces:
ClassPrinter.LeafNodePREVIEW
,ClassPrinter.ListNodePREVIEW
,ClassPrinter.MapNodePREVIEW
- Enclosing class:
ClassPrinterPREVIEW
public static sealed interface ClassPrinter.Node
permits ClassPrinter.LeafNodePREVIEW, ClassPrinter.ListNodePREVIEW, ClassPrinter.MapNodePREVIEW
Node
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Named, traversable, and printable node parent.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionname()
Printable name of the node.default void
Prints the node and its sub-tree into JSON format.default void
Prints the node and its sub-tree into XML format.default void
Prints the node and its sub-tree into YAML format.walk()
Walks through the underlying tree.
-
Method Details
-
name
-
walk
Stream<ClassPrinter.NodePREVIEW> walk()Walks through the underlying tree.- Returns:
- ordered stream of nodes
-
toJson
-
toXml
-
toYaml
-
Node
when preview features are enabled.