|
|||||||||
| 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
This class is the central loading point for generating a SchemaTree out of a "raw" JSON Schema (ie, a JsonNode); it handles
the creation of both anonymous (ie, no loading URI) and non anonymous JSON
schemas.
Depending on your configuration, you may, or may not, be able to use
relative URIs to load your schemas; see URITranslator and LoadingConfigurationBuilder.setURITranslatorConfiguration(URITranslatorConfiguration)
for more details.
| 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 | ||||||||