Class DefaultValidationResult

java.lang.Object
org.apache.sling.validation.spi.support.DefaultValidationResult
All Implemented Interfaces:
Serializable, ValidationResult

@ProviderType public final class DefaultValidationResult extends Object implements ValidationResult, Serializable
Default implementation of ValidationResult wrapping a list of ValidationFailures.
See Also:
  • Field Details

  • Constructor Details

    • DefaultValidationResult

      public DefaultValidationResult(@NotNull @NotNull ValidatorContext validationContext, @NotNull @NotNull String messageKey, Object... messageArguments)
      Constructs a result with one failure message. The message is constructed by looking up the given messageKey from a resourceBundle. and formatting it using the given messageArguments via MessageFormat.format(String, Object...).
      Parameters:
      validationContext - the context from which to take the location, severity and default resource bundle
      messageKey - the message key used for looking up a value in the resource bundle given in ValidationFailure.getMessage(java.util.ResourceBundle)
      messageArguments - optional number of arguments being used in MessageFormat.format(String, Object...)
    • DefaultValidationResult

      public DefaultValidationResult(@NotNull @NotNull String location, int severity, @NotNull @NotNull ResourceBundle defaultResourceBundle, @NotNull @NotNull String messageKey, Object... messageArguments)
      Constructs a result with one failure message. The message is constructed by looking up the given messageKey from a resourceBundle. and formatting it using the given messageArguments via MessageFormat.format(String, Object...).
      Parameters:
      location - the location
      severity - the severity of the embedded failure (may be null which leads to using the validator's default severity)
      defaultResourceBundle - the default resourceBundle which is used to resolve the messageKey if no other bundle is provided
      messageKey - the message key used for looking up a value in the resource bundle given in ValidationFailure.getMessage(java.util.ResourceBundle)
      messageArguments - optional number of arguments being used in MessageFormat.format(String, Object...)
    • DefaultValidationResult

      public DefaultValidationResult(ValidationFailure... failures)
  • Method Details