Class SchemaRegistryConfig.BuilderSupport<T>
- Direct Known Subclasses:
SchemaRegistryConfig.Builder
- Enclosing class:
SchemaRegistryConfig
SchemaRegistryConfig.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected ExecutionContextCustomizerprotected booleanprotected Booleanprotected Localeprotected booleanprotected MessageSourceprotected PathTypeprotected booleanprotected RegularExpressionFactoryprotected SchemaIdValidatorprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()cacheRefs(boolean cacheRefs) Sets if schemas loaded from refs will be cached and reused for subsequent runs.errorMessageKeyword(String errorMessageKeyword) Sets the error message keyword for setting custom messages in the schema.executionContextCustomizer(ExecutionContextCustomizer executionContextCustomizer) Sets the execution context customizer that is run before each run.failFast(boolean failFast) Sets if the validation should immediately return once a validation error has occurred.formatAssertionsEnabled(Boolean formatAssertionsEnabled) Sets if format assertions are enabled.Set the locale to consider when generating localized messages.losslessNarrowing(boolean losslessNarrowing) Sets whether lossless narrowing of other numeric types to integer is performed.messageSource(MessageSource messageSource) Sets the message source to use for generating localised messages.Sets the path type to use when reporting the instance location of errors.preloadSchema(boolean preloadSchema) Sets if the schema should be preloaded.regularExpressionFactory(RegularExpressionFactory regularExpressionFactory) Sets the regular expression factory.schemaIdValidator(SchemaIdValidator schemaIdValidator) Sets the schema id validator to use.protected abstract Tself()typeLoose(boolean typeLoose)
-
Field Details
-
cacheRefs
protected boolean cacheRefs -
errorMessageKeyword
-
executionContextCustomizer
-
failFast
protected boolean failFast -
formatAssertionsEnabled
-
locale
-
losslessNarrowing
protected boolean losslessNarrowing -
messageSource
-
pathType
-
preloadSchema
protected boolean preloadSchema -
regularExpressionFactory
-
schemaIdValidator
-
strictness
-
typeLoose
protected boolean typeLoose
-
-
Constructor Details
-
BuilderSupport
public BuilderSupport()
-
-
Method Details
-
self
-
cacheRefs
Sets if schemas loaded from refs will be cached and reused for subsequent runs.Defaults to true.
- Parameters:
cacheRefs- true to cache- Returns:
- the builder
-
errorMessageKeyword
Sets the error message keyword for setting custom messages in the schema.Defaults to null meaning custom messages are not enabled.
- Parameters:
errorMessageKeyword- to use for custom messages in the schema- Returns:
- the builder
-
executionContextCustomizer
Sets the execution context customizer that is run before each run.- Parameters:
executionContextCustomizer- the customizer- Returns:
- the builder
-
failFast
Sets if the validation should immediately return once a validation error has occurred. This can improve performance if inputs are invalid but cannot return all error messages to the caller.Defaults to false.
- Parameters:
failFast- true to enable- Returns:
- the builder
-
formatAssertionsEnabled
Sets if format assertions are enabled. If format assertions are not enabled the format keyword will behave like an annotation and not attempt to validate if the inputs are valid.Defaults to not enabling format assertions for Draft 2019-09 and above and enabling format assertions for Draft 7 and below.
- Parameters:
formatAssertionsEnabled- true to enable- Returns:
- the builder
-
locale
Set the locale to consider when generating localized messages.Note that this locale is set on a schema registry basis. To configure the schema on a per execution basis use
ExecutionConfig.BuilderSupport.locale(Locale).Defaults to use
Locale.getDefault().- Parameters:
locale- The locale.- Returns:
- the builder
-
losslessNarrowing
Sets whether lossless narrowing of other numeric types to integer is performed.Note that this likely only has a visible effect for dialects written before Draft 6.
Since Draft 6 for example 1.0 is treated as an integer even without this enabled.
- Parameters:
losslessNarrowing- true to enable- Returns:
- the builder
-
messageSource
Sets the message source to use for generating localised messages.- Parameters:
messageSource- the message source- Returns:
- the builder
-
pathType
Sets the path type to use when reporting the instance location of errors.Defaults to
PathType.JSON_POINTER.- Parameters:
pathType- the path type- Returns:
- the path type
-
preloadSchema
Sets if the schema should be preloaded.Defaults to true.
- Parameters:
preloadSchema- true to preload- Returns:
- the builder
-
regularExpressionFactory
Sets the regular expression factory.Defaults to the
JDKRegularExpressionFactoryThe
ECMAScriptRegularExpressionFactoryrequires the inclusion of optional org.jruby.joni:joni or org.graalvm.js:js dependencies.- Parameters:
regularExpressionFactory- the factory- Returns:
- the builder
- See Also:
-
schemaIdValidator
Sets the schema id validator to use.Defaults to
SchemaIdValidator.DEFAULT.- Parameters:
schemaIdValidator- the builder- Returns:
- the builder
-
strict
-
strict
-
typeLoose
-
build
-