Class DefaultNodeReader

java.lang.Object
com.networknt.schema.serialization.DefaultNodeReader
All Implemented Interfaces:
NodeReader

public class DefaultNodeReader extends Object implements NodeReader
Default NodeReader.
  • Field Details

    • jsonMapper

      protected final com.fasterxml.jackson.databind.ObjectMapper jsonMapper
    • yamlMapper

      protected final com.fasterxml.jackson.databind.ObjectMapper yamlMapper
    • jsonNodeFactoryFactory

      protected final JsonNodeFactoryFactory jsonNodeFactoryFactory
  • Constructor Details

    • DefaultNodeReader

      protected DefaultNodeReader(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper yamlMapper, JsonNodeFactoryFactory jsonNodeFactoryFactory)
      Constructor.
      Parameters:
      jsonMapper - the json mapper
      yamlMapper - the yaml mapper
      jsonNodeFactoryFactory - the json node factory factory
  • Method Details

    • readTree

      public com.fasterxml.jackson.databind.JsonNode readTree(String content, InputFormat inputFormat) throws IOException
      Description copied from interface: NodeReader
      Deserialize content as a tree.
      Specified by:
      readTree in interface NodeReader
      Parameters:
      content - the content
      inputFormat - the input format
      Returns:
      the node
      Throws:
      IOException - IOException
    • readTree

      public com.fasterxml.jackson.databind.JsonNode readTree(InputStream content, InputFormat inputFormat) throws IOException
      Description copied from interface: NodeReader
      Deserialize content as a tree.
      Specified by:
      readTree in interface NodeReader
      Parameters:
      content - input stream
      inputFormat - input format
      Returns:
      the node
      Throws:
      IOException - IOException
    • getYamlMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getYamlMapper()
      Gets the yaml mapper.
      Returns:
      the yaml mapper
    • getJsonMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
      Gets the json mapper.
      Returns:
      the json mapper
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper(InputFormat inputFormat)
      Gets the object mapper for the input format.
      Parameters:
      inputFormat - the input format
      Returns:
      the object mapper
    • builder

      public static DefaultNodeReader.Builder builder()
      Gets the builder for DefaultNodeReader.
      Returns:
      the builder