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. As with all
customizations, you must go through JsonSchemaFactory.Builder
to do this.
You can add a custom URI scheme by providing an implementation of URIDownloader
, and register it using JsonSchemaFactory.Builder.registerScheme(String,
URIDownloader)
. You are then able to fetch schemas via URIs (using JsonSchemaFactory.fromURI(URI)
or similar) using your custom scheme.
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, printReport
public static void main(String... args) throws IOException, JsonSchemaException
IOException
JsonSchemaException
Copyright © 2013. All Rights Reserved.