io.vertx.json.schema.common

## Interface ValidatorFactory

- All Known Implementing Classes:
    AllOfValidatorFactory, AnyOfValidatorFactory, BaseCombinatorsValidatorFactory, BaseFormatValidatorFactory, BaseSingleSchemaValidatorFactory, ConstValidatorFactory, ContainsValidatorFactory, ContainsValidatorFactory, DefinitionsValidatorFactory, DependenciesValidatorFactory, DependentRequiredValidatorFactory, DependentSchemasValidatorFactory, EnumValidatorFactory, ExclusiveMaximumValidatorFactory, ExclusiveMinimumValidatorFactory, FormatValidatorFactory, FormatValidatorFactory, FormatValidatorFactory, IfThenElseValidatorFactory, ItemsValidatorFactory, ItemsValidatorFactory, MaximumValidatorFactory, MaximumValidatorFactory, MaxItemsValidatorFactory, MaxLengthValidatorFactory, MaxPropertiesValidatorFactory, MinimumValidatorFactory, MinimumValidatorFactory, MinItemsValidatorFactory, MinLengthValidatorFactory, MinPropertiesValidatorFactory, MultipleOfValidatorFactory, NotValidatorFactory, NullableValidatorFactory, OneOfValidatorFactory, PatternValidatorFactory, PropertiesValidatorFactory, PropertyNamesValidatorFactory, RequiredValidatorFactory, TypeValidatorFactory, TypeValidatorFactory, UnevaluatedItemsValidatorFactory, UnevaluatedPropertiesValidatorFactory, UniqueItemsValidatorFactory

      public interface ValidatorFactory

  Factory for `Validator`. This is the entrypoint if you want to create a new custom keyword

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canConsumeSchema(JsonObject schema)` Returns true if this factory can consume the provided schema, eventually returning an instance of `Validator`
    `Validator` | `createValidator(JsonObject schema, JsonPointer scope, SchemaParserInternal parser, MutableStateValidator parent)` This method consume the schema eventually creating a new `Validator`.

- - ### Method Detail

    - #### createValidator

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

      This method consume the schema eventually creating a new `Validator`. The schema parser calls it during schema parsing only if `canConsumeSchema(JsonObject)` returns true

      You can return any of `SyncValidator`, `AsyncValidator` or `MutableStateValidator`

      Parameters:
        `schema` - JsonObject representing the schema
        `scope` - scope of the parsed schema
        `parser` - caller parser
        `parent` - parent of this schema
      Returns:
        the created validator.
      Throws:
        `SchemaException` - if the keyword(s) handled by this ValidatorFactory are invalid

    - #### canConsumeSchema

          boolean canConsumeSchema(JsonObject schema)

      Returns true if this factory can consume the provided schema, eventually returning an instance of `Validator`
      Parameters:
        `schema` -
      Returns:

Copyright © 2025 Eclipse. All rights reserved.