public class JsonSchemaLoader extends Object
JsonLoader
to fetch JSON schemas from URIs and cache them.
Usage:
JsonSchemaLoader schemaLoader = JsonSchemaLoader(schemaBaseURLs);
JsonNode schema = schemaLoader.load("http://my.schemas.org/schemas/test/event/schema/0.0.2")
Constructor and Description |
---|
JsonSchemaLoader(JsonLoader loader)
Make a new JsonSchemaLoader using
JsonLoader . |
Modifier and Type | Method and Description |
---|---|
static JsonSchemaLoader |
build(ResourceLoader resourceLoader)
Creates a new JsonLoader using resourceLoader and uses that to create a new JsonSchemaLoader.
|
com.fasterxml.jackson.databind.JsonNode |
cacheGet(URI schemaUri)
Proxy method to get a schema by schemaUri directly from the local cache.
|
com.fasterxml.jackson.databind.JsonNode |
cachePut(URI schemaUri,
com.fasterxml.jackson.databind.JsonNode schema)
Proxy method to put a schema by schemaUri directly in the local cache.
|
JsonLoader |
getJsonLoader()
Return the underlying JsonLoader.
|
boolean |
isCached(URI schemaUri)
Proxy method to see if the schemaUri is currently cached.
|
com.fasterxml.jackson.databind.JsonNode |
load(URI schemaUri)
Given a schemaUri, this will request the JSON or YAML content at that URI and
parse it into a JsonNode.
|
com.fasterxml.jackson.databind.JsonNode |
parse(String data)
Parses the JSON or YAML string into a JsonNode.
|
public JsonSchemaLoader(JsonLoader loader)
JsonLoader
.public static JsonSchemaLoader build(ResourceLoader resourceLoader)
public com.fasterxml.jackson.databind.JsonNode load(URI schemaUri) throws JsonLoadingException
JsonLoadingException
public com.fasterxml.jackson.databind.JsonNode parse(String data) throws JsonLoadingException
data
- JSON or YAML string to parse into a JsonNode.JsonLoadingException
public boolean isCached(URI schemaUri)
public com.fasterxml.jackson.databind.JsonNode cacheGet(URI schemaUri)
public com.fasterxml.jackson.databind.JsonNode cachePut(URI schemaUri, com.fasterxml.jackson.databind.JsonNode schema)
public JsonLoader getJsonLoader()
Copyright © 2025. All rights reserved.