public class SchemaLoader extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SchemaLoader.SchemaLoaderBuilder
Builder class for
SchemaLoader . |
Constructor and Description |
---|
SchemaLoader(SchemaLoader.SchemaLoaderBuilder builder)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static SchemaLoader.SchemaLoaderBuilder |
builder() |
Schema.Builder<?> |
load()
Populates a
Schema.Builder instance from the schemaJson schema definition. |
static Schema |
load(org.json.JSONObject schemaJson)
Loads a JSON schema to a schema validator using a
default HTTP
client . |
static Schema |
load(org.json.JSONObject schemaJson,
SchemaClient schemaClient)
Creates Schema instance from its JSON representation.
|
public SchemaLoader(SchemaLoader.SchemaLoaderBuilder builder)
builder
- the builder containing the properties. Only SchemaLoader.SchemaLoaderBuilder.id
is
nullable.NullPointerException
- if any of the builder properties except id
is
null
.public static SchemaLoader.SchemaLoaderBuilder builder()
public static Schema load(org.json.JSONObject schemaJson)
default HTTP
client
.schemaJson
- the JSON representation of the schema.public static Schema load(org.json.JSONObject schemaJson, SchemaClient schemaClient)
schemaJson
- the JSON representation of the schema.schemaClient
- the HTTP client to be used for resolving remote JSON references.public Schema.Builder<?> load()
Schema.Builder
instance from the schemaJson
schema definition.Schema.Builder#build()
can be immediately used to acquire the Schema
instance to be used for validationCopyright © 2019 Everit Kft.. All rights reserved.