Package org.everit.json.schema.loader
Class SchemaLoader.SchemaLoaderBuilder
- java.lang.Object
-
- org.everit.json.schema.loader.SchemaLoader.SchemaLoaderBuilder
-
- Enclosing class:
- SchemaLoader
public static class SchemaLoader.SchemaLoaderBuilder extends Object
Builder class forSchemaLoader
.
-
-
Constructor Summary
Constructors Constructor Description SchemaLoaderBuilder()
-
Method Summary
-
-
-
Method Detail
-
addFormatValidator
public SchemaLoader.SchemaLoaderBuilder addFormatValidator(FormatValidator formatValidator)
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 thisformatValidator
formatValidator
- the object performing the validation for schemas which use theformatName
format- Returns:
this
-
draftV6Support
public SchemaLoader.SchemaLoaderBuilder draftV6Support()
-
draftV7Support
public SchemaLoader.SchemaLoaderBuilder draftV7Support()
-
build
public SchemaLoader build()
-
getRootSchemaJson
@Deprecated public org.json.JSONObject getRootSchemaJson()
Deprecated.
-
httpClient
@Deprecated public SchemaLoader.SchemaLoaderBuilder httpClient(SchemaClient httpClient)
Deprecated.useschemaClient(SchemaClient)
instead
-
schemaClient
public SchemaLoader.SchemaLoaderBuilder schemaClient(SchemaClient schemaClient)
-
resolutionScope
public SchemaLoader.SchemaLoaderBuilder resolutionScope(String id)
Sets the initial resolution scope of the schema.id
and$ref
attributes accuring in the schema will be resolved against this value.- Parameters:
id
- the initial (absolute) URI, used as the resolution scope.- Returns:
this
-
resolutionScope
public SchemaLoader.SchemaLoaderBuilder resolutionScope(URI id)
-
schemaJson
public SchemaLoader.SchemaLoaderBuilder schemaJson(org.json.JSONObject schemaJson)
-
schemaJson
public SchemaLoader.SchemaLoaderBuilder schemaJson(Object schema)
-
useDefaults
public SchemaLoader.SchemaLoaderBuilder useDefaults(boolean 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
public SchemaLoader.SchemaLoaderBuilder nullableSupport(boolean nullableSupport)
-
regexpFactory
public SchemaLoader.SchemaLoaderBuilder regexpFactory(RegexpFactory regexpFactory)
-
registerSchemaByURI
public SchemaLoader.SchemaLoaderBuilder registerSchemaByURI(URI uri, Object schema)
-
enableOverrideOfBuiltInFormatValidators
public SchemaLoader.SchemaLoaderBuilder enableOverrideOfBuiltInFormatValidators()
-
-