Package com.identity4j.util.validator
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.identity4j.util.validator.ValidationException
-
- All Implemented Interfaces:
Serializable
public class ValidationException extends RuntimeException
Exception thrown when a field fails to validate.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationException(ValidationContext context, String bundle, String message, Object... args)ConstructorValidationException(ValidationContext context, String bundle, String message, Throwable cause, Object... args)ConstructorValidationException(ValidationContext context, Map<String,Collection<ValidationError>> validatorErrors, Object... args)Constructor for creating an exception from a collection ofValidationError.ValidationException(ValidationError validationError)Constructor for creating an exception from a singleValidationError.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLocalizedMessage(ClassLoader classLoader)StringgetLocalizedMessage(ClassLoader classLoader, Locale locale)StringgetMessage()ValidationErrorgetValidationError()Returns the validation error associated with this exceptionMap<String,Collection<ValidationError>>getValidatorErrors()Returns the validation errors associated with this exception-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ValidationException
public ValidationException(ValidationError validationError)
Constructor for creating an exception from a singleValidationError.- Parameters:
validationError- error
-
ValidationException
public ValidationException(ValidationContext context, String bundle, String message, Object... args)
Constructor- Parameters:
bundle- resource bundle namemessage- message keyargs- message arguments
-
ValidationException
public ValidationException(ValidationContext context, String bundle, String message, Throwable cause, Object... args)
Constructor- Parameters:
bundle- resource bundle namemessage- message keycause- causeargs- message arguments
-
ValidationException
public ValidationException(ValidationContext context, Map<String,Collection<ValidationError>> validatorErrors, Object... args)
Constructor for creating an exception from a collection ofValidationError.- Parameters:
validatorErrors- list of errors
-
-
Method Detail
-
getLocalizedMessage
public String getLocalizedMessage(ClassLoader classLoader)
-
getLocalizedMessage
public String getLocalizedMessage(ClassLoader classLoader, Locale locale)
-
getMessage
public String getMessage()
- Overrides:
getMessagein classThrowable
-
getValidationError
public final ValidationError getValidationError()
Returns the validation error associated with this exception- Returns:
- the validation error
-
getValidatorErrors
public Map<String,Collection<ValidationError>> getValidatorErrors()
Returns the validation errors associated with this exception- Returns:
- the validation errors
-
-