Package org.everit.json.schema.loader
Class SchemaLoader.SchemaLoaderBuilder
java.lang.Object
org.everit.json.schema.loader.SchemaLoader.SchemaLoaderBuilder
- Enclosing class:
- SchemaLoader
Builder class for
SchemaLoader.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFormatValidator(String formatName, FormatValidator formatValidator) Deprecated.addFormatValidator(FormatValidator formatValidator) Registers a format validator with the name returned byFormatValidator.formatName().build()org.json.JSONObjectDeprecated.httpClient(SchemaClient httpClient) Deprecated.useschemaClient(SchemaClient)insteadnullableSupport(boolean nullableSupport) regexpFactory(RegexpFactory regexpFactory) registerSchemaByURI(URI uri, Object schema) Sets the initial resolution scope of the schema.resolutionScope(URI id) schemaClient(SchemaClient schemaClient) schemaJson(Object schema) schemaJson(org.json.JSONObject schemaJson) useDefaults(boolean useDefaults) With this flag set to false, the validator ignores the default keyword inside the json schema.
-
Constructor Details
-
SchemaLoaderBuilder
public SchemaLoaderBuilder()
-
-
Method Details
-
addFormatValidator
Registers a format validator with the name returned byFormatValidator.formatName().- Parameters:
formatValidator- the format validator to be registered with its name- Returns:
this
-
addFormatValidator
@Deprecated public SchemaLoader.SchemaLoaderBuilder addFormatValidator(String formatName, FormatValidator formatValidator) Deprecated.instead it is better to overrideFormatValidator.formatName()and useaddFormatValidator(FormatValidator)- Parameters:
formatName- the name which will be used in the schema JSON files to refer to thisformatValidatorformatValidator- the object performing the validation for schemas which use theformatNameformat- Returns:
this
-
draftV6Support
-
draftV7Support
-
build
-
getRootSchemaJson
Deprecated. -
httpClient
Deprecated.useschemaClient(SchemaClient)instead -
schemaClient
-
resolutionScope
Sets the initial resolution scope of the schema.idand$refattributes accuring in the schema will be resolved against this value.- Parameters:
id- the initial (absolute) URI, used as the resolution scope.- Returns:
this
-
resolutionScope
-
schemaJson
-
schemaJson
-
useDefaults
With this flag set to false, the validator ignores the default keyword inside the json schema. If is true, validator applies default values when it's needed- Parameters:
useDefaults- if true, validator doesn't ignore default values- Returns:
this
-
nullableSupport
-
regexpFactory
-
registerSchemaByURI
-
enableOverrideOfBuiltInFormatValidators
-
FormatValidator.formatName()and useaddFormatValidator(FormatValidator)