io.vertx.ext.json.schema.common

## Class BaseFormatValidatorFactory

- java.lang.Object
- - io.vertx.ext.json.schema.common.BaseFormatValidatorFactory

- All Implemented Interfaces:
    ValidatorFactory
  Direct Known Subclasses:
    FormatValidatorFactory, FormatValidatorFactory, FormatValidatorFactory

      public abstract class BaseFormatValidatorFactory
      extends Object
      implements ValidatorFactory

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `BaseFormatValidatorFactory()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### URI_VALIDATOR

          protected static final java.util.function.Predicate<String> URI_VALIDATOR

    - #### URI_REFERENCE_VALIDATOR

          protected static final java.util.function.Predicate<String> URI_REFERENCE_VALIDATOR

    - #### REGEX_VALIDATOR

          protected static final java.util.function.Predicate<String> REGEX_VALIDATOR

    - #### IDN_HOSTNAME_VALIDATOR

          protected static final java.util.function.Predicate<String> IDN_HOSTNAME_VALIDATOR

    - #### IDN_EMAIL_VALIDATOR

          protected static final java.util.function.Predicate<String> IDN_EMAIL_VALIDATOR

    - #### UUID_VALIDATOR

          protected static final java.util.function.Predicate<String> UUID_VALIDATOR

    - #### formats

          protected Map<String,java.util.function.Predicate<String>> formats

    - #### ignoringFormats

          protected List<String> ignoringFormats

  - ### Constructor Detail

    - #### BaseFormatValidatorFactory

          public BaseFormatValidatorFactory()

  - ### Method Detail

    - #### initIgnoringFormats

          protected List<String> initIgnoringFormats()

    - #### initFormatsMap

          public abstract Map<String,java.util.function.Predicate<String>> initFormatsMap()

    - #### addStringFormatValidator

          public void addStringFormatValidator(String formatName,
                                               java.util.function.Predicate<String> validator)

    - #### createPredicateFromPattern

          protected java.util.function.Predicate<String> createPredicateFromPattern(Pattern pattern)

    - #### createValidator

          public Validator createValidator(JsonObject schema,
                                           JsonPointer scope,
                                           SchemaParserInternal parser,
                                           MutableStateValidator parent)

      Description copied from interface: `ValidatorFactory`
      This method consume the schema eventually creating a new `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`

      Specified by:
        `createValidator` in interface `ValidatorFactory`
      Parameters:
        `schema` - JsonObject representing the schema
        `scope` - scope of the parsed schema
        `parser` - caller parser
        `parent` - parent of this schema
      Returns:
        the created validator.

    - #### canConsumeSchema

          public boolean canConsumeSchema(JsonObject schema)

      Description copied from interface: `ValidatorFactory`
      Returns true if this factory can consume the provided schema, eventually returning an instance of `Validator`
      Specified by:
        `canConsumeSchema` in interface `ValidatorFactory`
      Returns:

Copyright © 2020 Eclipse. All rights reserved.