Class HasSchemeValidatorForUri

java.lang.Object
dev.learning.xapi.model.validation.disableable.DisableableValidator<HasScheme,URI>
dev.learning.xapi.model.validation.internal.validators.HasSchemeValidatorForUri
All Implemented Interfaces:
jakarta.validation.ConstraintValidator<HasScheme,URI>

public class HasSchemeValidatorForUri extends DisableableValidator<HasScheme,URI>
The URI being validated must have a schema.
Author:
Thomas Turrell-Croft
  • Constructor Details

    • HasSchemeValidatorForUri

      public HasSchemeValidatorForUri()
  • Method Details

    • isValidIfEnabled

      public boolean isValidIfEnabled(URI value, jakarta.validation.ConstraintValidatorContext context)
      Description copied from class: DisableableValidator

      Convenient method for implementing the validation logic independently from the disabled/enabled logic.

      If some more complex validation logic is needed (eg. some partial validation is needed even if the validator is disabled), then the DisableableValidator.isDisabled() method can be used directly from the ConstraintValidator.isValid(Object, ConstraintValidatorContext) method.
      Overrides:
      isValidIfEnabled in class DisableableValidator<HasScheme,URI>
      Parameters:
      value - object to validate
      context - context in which the constraint is evaluated
      Returns:
      false if value does not pass the constraint