|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.load.SchemaLoader
@ThreadSafe public final class SchemaLoader
JSON Schema loader
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 Summary | |
|---|---|
SchemaLoader()
Create a new schema loader with the default loading configuration |
|
SchemaLoader(LoadingConfiguration cfg)
Create a new schema loader with a given loading configuration |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SchemaLoader(LoadingConfiguration cfg)
cfg - the configurationLoadingConfiguration,
LoadingConfigurationBuilderpublic SchemaLoader()
| Method Detail |
|---|
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 schema
NullPointerException - 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 URI
ProcessingException - URI is not an absolute JSON reference, or
failed to dereference this URI
NullPointerException - URI is nullpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||