public class JsonSchemaValidatorSettings extends Object
| Constructor and Description |
|---|
JsonSchemaValidatorSettings()
Initializes JsonSchemaValidatorSettings with a default
JsonSchemaFactory (generated by JsonSchemaFactory.byDefault())
and using checked validation and treating uri's and url's as Strings. |
JsonSchemaValidatorSettings(com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory)
Initializes JsonSchemaValidatorSettings with a specific
JsonSchemaFactory. |
JsonSchemaValidatorSettings(com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory,
boolean checkedValidation)
Initializes JsonSchemaValidatorSettings with a specific
JsonSchemaFactory and checked validation. |
| Modifier and Type | Method and Description |
|---|---|
JsonSchemaValidatorSettings |
and()
Syntactic sugar.
|
JsonSchemaValidatorSettings |
checkedValidation(boolean shouldUseCheckedValidation)
Instruct the JsonSchemaValidator to use checked validation or not.
|
com.github.fge.jsonschema.main.JsonSchemaFactory |
jsonSchemaFactory() |
JsonSchemaValidatorSettings |
jsonSchemaFactory(com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory)
Set a
JsonSchemaFactory instance that will be used when creating the validator. |
JsonSchemaValidatorSettings |
parseUriAndUrlsAsJsonNode(boolean parseUriAndUrlsAsJsonNode)
Instruct the JsonSchemaValidator to parse URI's and URL's as JsonNode before they are passed to validation.
|
static JsonSchemaValidatorSettings |
settings()
Create a new instance of
JsonSchemaValidatorSettings. |
boolean |
shouldParseUriAndUrlsAsJsonNode() |
boolean |
shouldUseCheckedValidation() |
JsonSchemaValidatorSettings |
with()
Syntactic sugar.
|
public JsonSchemaValidatorSettings(com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory,
boolean checkedValidation)
JsonSchemaFactory and checked validation.
It will also use checked validation and treating uri's and url's as Strings. To change the latter refer to parseUriAndUrlsAsJsonNode(boolean).public JsonSchemaValidatorSettings(com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory)
JsonSchemaFactory. The settings will also use checked validation and treating uri's and url's as Strings.public JsonSchemaValidatorSettings()
JsonSchemaFactory (generated by JsonSchemaFactory.byDefault())
and using checked validation and treating uri's and url's as Strings.public com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory()
public boolean shouldParseUriAndUrlsAsJsonNode()
public boolean shouldUseCheckedValidation()
public JsonSchemaValidatorSettings checkedValidation(boolean shouldUseCheckedValidation)
shouldUseCheckedValidation - true to use checked validation, false otherwise.public JsonSchemaValidatorSettings parseUriAndUrlsAsJsonNode(boolean parseUriAndUrlsAsJsonNode)
true then JsonSchemaValidator.matchesJsonSchema(url) handled like this:
instanceSettings.jsonSchemaFactory().getJsonSchema(JsonLoader.fromURL(url))If
false then JsonSchemaValidator.matchesJsonSchema(url) handled like this:
instanceSettings.jsonSchemaFactory().getJsonSchema(url)The latter is good for you need to resolve relative ref in a parent schema because the validator does not know what is the base URI of the parent schema if first having parsed it as a JsonNode.
Default is false.
parseUriAndUrlsAsJsonNode - true to parse URI's and URL's as JsonNode's, false otherwise.public JsonSchemaValidatorSettings jsonSchemaFactory(com.github.fge.jsonschema.main.JsonSchemaFactory jsonSchemaFactory)
JsonSchemaFactory instance that will be used when creating the validator.jsonSchemaFactory - The JsonSchemaFactory instance to use.public JsonSchemaValidatorSettings and()
public JsonSchemaValidatorSettings with()
public static JsonSchemaValidatorSettings settings()
JsonSchemaValidatorSettings. Same as calling JsonSchemaValidatorSettings().JsonSchemaValidatorSettings.Copyright © 2010–2024. All rights reserved.