Class DefaultJsonNodeReader

java.lang.Object
com.networknt.schema.serialization.DefaultJsonNodeReader
All Implemented Interfaces:
JsonNodeReader

public class DefaultJsonNodeReader extends Object implements JsonNodeReader
  • 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

    • DefaultJsonNodeReader

      protected DefaultJsonNodeReader(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: JsonNodeReader
      Deserialize content as a tree.
      Specified by:
      readTree in interface JsonNodeReader
      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: JsonNodeReader
      Deserialize content as a tree.
      Specified by:
      readTree in interface JsonNodeReader
      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 DefaultJsonNodeReader.Builder builder()
      Gets the builder for DefaultJsonNodeReader.
      Returns:
      the builder