public final class Example4 extends ExampleBase
This demonstrates two capabilities of JsonSchemaFactory
:
The implementation provides a resource
scheme which allows to load
JSON from files in the classpath. It is strictly equivalent to calling Class.getResourceAsStream(String)
.
The URI used is resource:/org/eel/kitchen/jsonschema/examples/fstab-sub.json
. Because we
want to validate against the fstab
subschema, we use JsonSchemaFactory.getJsonSchema(String)
to load the actual schema; the URI
used as an argument also has a JSON Pointer as a fragment.
Files validated, and the validation outputs, are the same as for Example2
.
Constructor and Description |
---|
Example4() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String... args) |
loadResource, printReport
public static void main(String... args) throws IOException, com.github.fge.jsonschema.exceptions.ProcessingException
IOException
com.github.fge.jsonschema.exceptions.ProcessingException
Copyright © 2014. All Rights Reserved.