public final class SchemaLoader extends Object
All schema registering and downloading is done through this class.
Note that if the id of a schema is not absolute (that is, the URI itself is absolute and it has no fragment part, or an empty fragment), then the whole schema will be considered anonymous.
This class is thread safe.
Constructor and Description |
---|
SchemaLoader(URIManager manager,
URI namespace,
Dereferencing dereferencing)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addBundle(SchemaBundle bundle)
Load a schema bundle into this registry
|
JsonSchemaTree |
get(URI uri)
Get a schema tree from the given URI
|
JsonSchemaTree |
load(JsonNode schema) |
String |
toString() |
public SchemaLoader(URIManager manager, URI namespace, Dereferencing dereferencing)
manager
- the URI manager to usenamespace
- this registry's namespacedereferencing
- our Dereferencing
modepublic JsonSchemaTree load(JsonNode schema)
public JsonSchemaTree get(URI uri) throws ProcessingException
Note that if the URI is relative, it will be resolved against this registry's namespace, if any.
uri
- the URIProcessingException
public void addBundle(SchemaBundle bundle)
As a schema bundle is guaranteed to have well-formed locators, schemas from a bundle can be directly injected into the cache.
Copyright © 2013. All Rights Reserved.