public abstract class BaseFormatValidatorFactory extends Object implements ValidatorFactory
Modifier and Type | Field and Description |
---|---|
protected Map<String,Predicate<String>> |
formats |
protected static Predicate<String> |
IDN_EMAIL_VALIDATOR |
protected static Predicate<String> |
IDN_HOSTNAME_VALIDATOR |
protected List<String> |
ignoringFormats |
protected static Predicate<String> |
REGEX_VALIDATOR |
protected static Predicate<String> |
URI_REFERENCE_VALIDATOR |
protected static Predicate<String> |
URI_VALIDATOR |
protected static Predicate<String> |
UUID_VALIDATOR |
Constructor and Description |
---|
BaseFormatValidatorFactory() |
Modifier and Type | Method and Description |
---|---|
void |
addStringFormatValidator(String formatName,
Predicate<String> validator) |
boolean |
canConsumeSchema(io.vertx.core.json.JsonObject schema)
Returns true if this factory can consume the provided schema, eventually returning an instance of
Validator |
protected Predicate<String> |
createPredicateFromPattern(Pattern pattern) |
Validator |
createValidator(io.vertx.core.json.JsonObject schema,
io.vertx.core.json.pointer.JsonPointer scope,
SchemaParserInternal parser,
MutableStateValidator parent)
This method consume the schema eventually creating a new
Validator . |
abstract Map<String,Predicate<String>> |
initFormatsMap() |
protected List<String> |
initIgnoringFormats() |
public void addStringFormatValidator(String formatName, Predicate<String> validator)
public Validator createValidator(io.vertx.core.json.JsonObject schema, io.vertx.core.json.pointer.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(io.vertx.core.json.JsonObject schema)
ValidatorFactory
Validator
canConsumeSchema
in interface ValidatorFactory
Copyright © 2021 Eclipse. All rights reserved.