Class TreeIO

java.lang.Object
com.apicatalog.tree.io.TreeIO

public class TreeIO extends Object
Immutable representation of a tree node where the node and its descendants are accessed through a TreeAdapter.

A TreeIO instance binds a node with its adapter, providing a uniform way to traverse or compare trees of arbitrary underlying object models.

Pass a TreeIO from JSON, YAML, or CBOR into the tree to create polyformic tree composed of various different serializations, libraries, in order to uniformly prosses such a tree.

  • Field Details

  • Constructor Details

    • TreeIO

      public TreeIO(Object node, TreeAdapter adapter)
      Creates a new immutable tree with the given root node and adapter.
      Parameters:
      node - the root node of the tree, must not be null
      adapter - the adapter providing access to node types and values, must not be null
      Throws:
      NullPointerException - if root or adapter is null
  • Method Details