Class DefaultNodeReader
java.lang.Object
com.networknt.schema.serialization.DefaultNodeReader
- All Implemented Interfaces:
NodeReader
Default
NodeReader.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forDefaultNodeReader.static classBuilder support forNodeReader. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.ObjectMapperprotected final JsonNodeFactoryFactoryprotected final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultNodeReader(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, com.fasterxml.jackson.databind.ObjectMapper yamlMapper, JsonNodeFactoryFactory jsonNodeFactoryFactory) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultNodeReader.Builderbuilder()Gets the builder forDefaultNodeReader.protected com.fasterxml.jackson.databind.ObjectMapperGets the json mapper.protected com.fasterxml.jackson.databind.ObjectMappergetObjectMapper(InputFormat inputFormat) Gets the object mapper for the input format.protected com.fasterxml.jackson.databind.ObjectMapperGets 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 Details
-
jsonMapper
protected final com.fasterxml.jackson.databind.ObjectMapper jsonMapper -
yamlMapper
protected final com.fasterxml.jackson.databind.ObjectMapper yamlMapper -
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 mapperyamlMapper- the yaml mapperjsonNodeFactoryFactory- 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:NodeReaderDeserialize content as a tree.- Specified by:
readTreein interfaceNodeReader- 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:NodeReaderDeserialize content as a tree.- Specified by:
readTreein interfaceNodeReader- 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
Gets the object mapper for the input format.- Parameters:
inputFormat- the input format- Returns:
- the object mapper
-
builder
Gets the builder forDefaultNodeReader.- Returns:
- the builder
-