@ThreadSafe 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.
| Constructor and Description |
|---|
SchemaLoader()
Create a new schema loader with the default loading configuration
|
SchemaLoader(LoadingConfiguration cfg)
Create a new schema loader with a given loading configuration
|
| Modifier and Type | Method and Description |
|---|---|
SchemaTree |
get(URI uri)
Get a schema tree from the given URI
|
SchemaTree |
load(JsonNode schema)
Create a new tree from a schema
|
String |
toString() |
public SchemaLoader(LoadingConfiguration cfg)
cfg - the configurationLoadingConfiguration,
LoadingConfigurationBuilderpublic SchemaLoader()
public SchemaTree load(JsonNode schema)
Note that it will always create an "anonymous" tree, that is a tree with an empty loading URI.
schema - the schemaProcessingError - schema is nullDereferencing.newTree(JsonNode)public SchemaTree 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 - URI is not an absolute JSON reference, or
failed to dereference this URINullPointerException - URI is nullCopyright © 2013. All Rights Reserved.