Class DefaultJsonNodeReader
- java.lang.Object
-
- com.networknt.schema.serialization.DefaultJsonNodeReader
-
- All Implemented Interfaces:
JsonNodeReader
public class DefaultJsonNodeReader extends Object implements JsonNodeReader
DefaultJsonNodeReader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultJsonNodeReader.BuilderBuilder forDefaultJsonNodeReader.static classDefaultJsonNodeReader.BuilderSupport<T>Builder support forJsonNodeReader.
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.ObjectMapperjsonMapperprotected JsonNodeFactoryFactoryjsonNodeFactoryFactoryprotected com.fasterxml.jackson.databind.ObjectMapperyamlMapper
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultJsonNodeReader(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper yamlMapper, JsonNodeFactoryFactory jsonNodeFactoryFactory)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultJsonNodeReader.Builderbuilder()Gets the builder forDefaultJsonNodeReader.protected com.fasterxml.jackson.databind.ObjectMappergetJsonMapper()Gets the json mapper.protected com.fasterxml.jackson.databind.ObjectMappergetObjectMapper(InputFormat inputFormat)Gets the object mapper for the input format.protected com.fasterxml.jackson.databind.ObjectMappergetYamlMapper()Gets the yaml mapper.com.fasterxml.jackson.databind.JsonNodereadTree(InputStream content, InputFormat inputFormat)Deserialize content as a tree.com.fasterxml.jackson.databind.JsonNodereadTree(String content, InputFormat inputFormat)Deserialize content as a tree.
-
-
-
Field Detail
-
jsonMapper
protected final com.fasterxml.jackson.databind.ObjectMapper jsonMapper
-
yamlMapper
protected final com.fasterxml.jackson.databind.ObjectMapper yamlMapper
-
jsonNodeFactoryFactory
protected final JsonNodeFactoryFactory jsonNodeFactoryFactory
-
-
Constructor Detail
-
DefaultJsonNodeReader
protected DefaultJsonNodeReader(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper yamlMapper, JsonNodeFactoryFactory jsonNodeFactoryFactory)Constructor.- Parameters:
jsonMapper- the json mapperyamlMapper- the yaml mapperjsonNodeFactoryFactory- the json node factory factory
-
-
Method Detail
-
readTree
public com.fasterxml.jackson.databind.JsonNode readTree(String content, InputFormat inputFormat) throws IOException
Description copied from interface:JsonNodeReaderDeserialize content as a tree.- Specified by:
readTreein interfaceJsonNodeReader- Parameters:
content- the contentinputFormat- 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:JsonNodeReaderDeserialize content as a tree.- Specified by:
readTreein interfaceJsonNodeReader- Parameters:
content- input streaminputFormat- 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 forDefaultJsonNodeReader.- Returns:
- the builder
-
-