1 package com.fasterxml.jackson.core; 2 3 import java.io.IOException; 4 5 /** 6 * Interface that defines objects that can read and write 7 * {@link TreeNode} instances using Streaming API. 8 * 9 * @since 2.3 10 */ 11 public abstract class TreeCodec 12 { readTree(JsonParser p)13 public abstract <T extends TreeNode> T readTree(JsonParser p) throws IOException, JsonProcessingException; writeTree(JsonGenerator g, TreeNode tree)14 public abstract void writeTree(JsonGenerator g, TreeNode tree) throws IOException, JsonProcessingException; 15 16 /** 17 * @since 2.10 18 */ missingNode()19 public TreeNode missingNode() { 20 return null; 21 } 22 23 /** 24 * @since 2.10 25 */ nullNode()26 public TreeNode nullNode() { 27 return null; 28 } 29 createArrayNode()30 public abstract TreeNode createArrayNode(); createObjectNode()31 public abstract TreeNode createObjectNode(); treeAsTokens(TreeNode node)32 public abstract JsonParser treeAsTokens(TreeNode node); 33 } 34