public abstract class BaseFormatValidatorFactory extends Object implements ValidatorFactory
Modifier and Type | Field and Description |
---|---|
protected Map<String,java.util.function.Predicate<String>> |
formats |
protected static java.util.function.Predicate<String> |
IDN_EMAIL_VALIDATOR |
protected static java.util.function.Predicate<String> |
IDN_HOSTNAME_VALIDATOR |
protected List<String> |
ignoringFormats |
protected static java.util.function.Predicate<String> |
REGEX_VALIDATOR |
protected static java.util.function.Predicate<String> |
URI_REFERENCE_VALIDATOR |
protected static java.util.function.Predicate<String> |
URI_VALIDATOR |
protected static java.util.function.Predicate<String> |
UUID_VALIDATOR |
Constructor and Description |
---|
BaseFormatValidatorFactory() |
Modifier and Type | Method and Description |
---|---|
void |
addStringFormatValidator(String formatName,
java.util.function.Predicate<String> validator) |
boolean |
canConsumeSchema(JsonObject schema)
Returns true if this factory can consume the provided schema, eventually returning an instance of
Validator |
protected java.util.function.Predicate<String> |
createPredicateFromPattern(Pattern pattern) |
Validator |
createValidator(JsonObject schema,
JsonPointer scope,
SchemaParserInternal parser,
MutableStateValidator parent)
This method consume the schema eventually creating a new
Validator . |
abstract Map<String,java.util.function.Predicate<String>> |
initFormatsMap() |
protected List<String> |
initIgnoringFormats() |
protected static final java.util.function.Predicate<String> URI_VALIDATOR
protected static final java.util.function.Predicate<String> URI_REFERENCE_VALIDATOR
protected static final java.util.function.Predicate<String> REGEX_VALIDATOR
protected static final java.util.function.Predicate<String> IDN_HOSTNAME_VALIDATOR
protected static final java.util.function.Predicate<String> IDN_EMAIL_VALIDATOR
protected static final java.util.function.Predicate<String> UUID_VALIDATOR
protected final Map<String,java.util.function.Predicate<String>> formats
public abstract Map<String,java.util.function.Predicate<String>> initFormatsMap()
public void addStringFormatValidator(String formatName, java.util.function.Predicate<String> validator)
protected java.util.function.Predicate<String> createPredicateFromPattern(Pattern pattern)
public Validator createValidator(JsonObject schema, JsonPointer scope, SchemaParserInternal parser, MutableStateValidator parent)
ValidatorFactory
Validator
. The schema parser calls it during schema parsing only if ValidatorFactory.canConsumeSchema(JsonObject)
returns true
You can return any of SyncValidator
, AsyncValidator
or MutableStateValidator
createValidator
in interface ValidatorFactory
schema
- JsonObject representing the schemascope
- scope of the parsed schemaparser
- caller parserparent
- parent of this schemapublic boolean canConsumeSchema(JsonObject schema)
ValidatorFactory
Validator
canConsumeSchema
in interface ValidatorFactory
Copyright © 2024 Eclipse. All rights reserved.