Interface ConfigurationRule


public interface ConfigurationRule
Service Provider Interface (SPI) that allows modules to extend configuration validation with custom logic that goes beyond JSON Schema keywords.

Implementations are discovered via ServiceLoader.

  • Method Details

    • supportsPrefix

      boolean supportsPrefix(String prefix)
      Whether this rule supports the given configuration prefix.

      This is used to avoid executing rules for unrelated prefixes.

      Parameters:
      prefix - The prefix being validated
      Returns:
      True if this rule should be executed for the prefix
    • validate

      Perform custom validation for a configuration prefix (or a single @EachProperty entry) and return any additional ConfigurationErrors.
      Parameters:
      context - The validation context
      Returns:
      A set of additional validation errors/warnings (may be empty)