Class SelfValidationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.dellroad.stuff.validation.SelfValidationException
All Implemented Interfaces:
Serializable

public class SelfValidationException extends Exception
Exception that can be thrown by SelfValidating.checkValid(jakarta.validation.ConstraintValidatorContext).

Instances will be automatically caught and converted into a constraint violation using the exception's message if any, otherwise the default message.

Note that the message constructor parameter is a JSR 303 template string; to provide a plain text string, use SelfValidationException.escapeTemplate() or SelfValidationException.plain().

See Also:
  • Constructor Details

    • SelfValidationException

      public SelfValidationException()
      Constructor.
    • SelfValidationException

      public SelfValidationException(String message)
      Constructor.
      Parameters:
      message - validation error message template
    • SelfValidationException

      public SelfValidationException(Throwable cause)
      Constructor.
      Parameters:
      cause - underlying cause of this exception
    • SelfValidationException

      public SelfValidationException(String message, Throwable cause)
      Constructor.
      Parameters:
      message - validation error message template
      cause - underlying cause of this exception
  • Method Details