Package org.apache.johnzon.jsonschema
Class JsonSchemaValidatorFactory
- java.lang.Object
-
- org.apache.johnzon.jsonschema.JsonSchemaValidatorFactory
-
- All Implemented Interfaces:
AutoCloseable
public class JsonSchemaValidatorFactory extends Object implements AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JsonSchemaValidatorFactory.ChainedValueAccessor
private static class
JsonSchemaValidatorFactory.ValidationsFunction
-
Field Summary
Fields Modifier and Type Field Description private List<ValidationExtension>
extensions
private static Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>
NO_VALIDATION
private AtomicReference<Function<String,Predicate<CharSequence>>>
regexFactory
private static String[]
ROOT_PATH
-
Constructor Summary
Constructors Constructor Description JsonSchemaValidatorFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonSchemaValidatorFactory
appendExtensions(ValidationExtension... extensions)
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>
buildAdditionalPropertiesValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
private Stream<Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>>
buildDirectValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>
buildPatternPropertiesValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>
buildPropertiesValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>
buildValidator(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
void
close()
List<ValidationExtension>
createDefaultValidations()
JsonSchemaValidator
newInstance(jakarta.json.JsonObject schema)
private Predicate<CharSequence>
newRegexFactory(String regex)
JsonSchemaValidatorFactory
setExtensions(ValidationExtension... extensions)
JsonSchemaValidatorFactory
setRegexFactory(Function<String,Predicate<CharSequence>> factory)
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>
toFunction(List<Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>> validations)
-
-
-
Field Detail
-
ROOT_PATH
private static final String[] ROOT_PATH
-
NO_VALIDATION
private static final Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>> NO_VALIDATION
-
extensions
private final List<ValidationExtension> extensions
-
regexFactory
private final AtomicReference<Function<String,Predicate<CharSequence>>> regexFactory
-
-
Method Detail
-
newRegexFactory
private Predicate<CharSequence> newRegexFactory(String regex)
-
createDefaultValidations
public List<ValidationExtension> createDefaultValidations()
-
appendExtensions
public JsonSchemaValidatorFactory appendExtensions(ValidationExtension... extensions)
-
setExtensions
public JsonSchemaValidatorFactory setExtensions(ValidationExtension... extensions)
-
setRegexFactory
public JsonSchemaValidatorFactory setRegexFactory(Function<String,Predicate<CharSequence>> factory)
-
newInstance
public JsonSchemaValidator newInstance(jakarta.json.JsonObject schema)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
buildValidator
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>> buildValidator(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
-
buildDirectValidations
private Stream<Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>> buildDirectValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
-
buildPropertiesValidations
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>> buildPropertiesValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
-
buildPatternPropertiesValidations
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>> buildPatternPropertiesValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
-
buildAdditionalPropertiesValidations
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>> buildAdditionalPropertiesValidations(String[] path, jakarta.json.JsonObject schema, Function<jakarta.json.JsonValue,jakarta.json.JsonValue> valueProvider)
-
toFunction
private Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>> toFunction(List<Function<jakarta.json.JsonValue,Stream<ValidationResult.ValidationError>>> validations)
-
-