public final class Example7 extends ExampleBase
This demonstrates JsonSchemaFactory's ability to register a
custom URI scheme. In this example, the scheme is foobar, and it is
simply an alias to fetch a resource from the current package.
Two things are needed:
URIDownloader for this scheme,LoadingConfigurationBuilder.addScheme(String, URIDownloader).Once this is done, this scheme, when encountered anywhere in JSON
References, will use this downloader, and you are also able to use it when
loading schemas using JsonSchemaFactory.getJsonSchema(String), which
is what this example does.
The schema and files used are the same as for Example2.
| Constructor and Description |
|---|
Example7() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String... args) |
loadResource, printReportpublic static void main(String... args) throws IOException, com.github.fge.jsonschema.exceptions.ProcessingException
IOExceptioncom.github.fge.jsonschema.exceptions.ProcessingExceptionCopyright © 2014. All Rights Reserved.