Package org.everit.json.schema.loader
Class SchemaLoader
java.lang.Object
org.everit.json.schema.loader.SchemaLoader
Loads a JSON schema's JSON representation into schema validator instances.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()load()Populates aSchema.Builderinstance from theschemaJsonschema definition.static Schemaload(org.json.JSONObject schemaJson) Loads a JSON schema to a schema validator using adefault HTTP client.static Schemaload(org.json.JSONObject schemaJson, SchemaClient schemaClient) Creates Schema instance from its JSON representation.
-
Constructor Details
-
SchemaLoader
Constructor.- Parameters:
builder- the builder containing the properties. OnlySchemaLoader.SchemaLoaderBuilder.idis nullable.- Throws:
NullPointerException- if any of the builder properties exceptidisnull.
-
-
Method Details
-
builder
-
load
Loads a JSON schema to a schema validator using adefault HTTP client.- Parameters:
schemaJson- the JSON representation of the schema.- Returns:
- the schema validator object
-
load
Creates Schema instance from its JSON representation.- Parameters:
schemaJson- the JSON representation of the schema.schemaClient- the HTTP client to be used for resolving remote JSON references.- Returns:
- the created schema
-
load
Populates aSchema.Builderinstance from theschemaJsonschema definition.- Returns:
- the builder which already contains the validation criteria of the schema, therefore
Schema.Builder.build()can be immediately used to acquire theSchemainstance to be used for validation
-