public final class Example10 extends ExampleBase
In this example, we register a custom schema into our factory with a given URI, and initiate the schema instance using that URI.
The only necessary condition for the URI is for it to be an absolute JSON
reference (see JsonRef.isAbsolute()
), and you can register as many
schemas as you want. Here, we register both schemas from Example5
.
You will notice that the scheme for these URIs is xxx
: it does not
matter in the slightest that it is not a supported scheme by default, the
schema is registered all the same.
This also shows that reference resolution still works in such a case,
since the mntent
schema is referred to via a relative URI from the
fstab
schema.
Constructor and Description |
---|
Example10() |
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.