Package net.sf.eBus.util
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- net.sf.eBus.util.ValidationException
-
- All Implemented Interfaces:
Serializable
public final class ValidationException extends RuntimeException
This exception is thrown when message build fails due to an incorrectly configured message. This will be due to either required fields not being set or two or more fields set to incompatible values. That is setting one field to a given value restricts the values allowed for one or more other fields. This method is "fail slow" meaning that it should contain all theConfigException.ValidationProblems found with the configured message and not the first problem.This exception should not be thrown if a single field is set to an invalid value. Instead an exception is thrown by the setter method when given that invalid value.
- Author:
- Charles W. Rapp
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationException(Class<?> tc, List<MultiKey2<String,String>> problems)Creates a new instance ofValidationExceptionfor the given class and validation problems.ValidationException(Class<?> tc, List<MultiKey2<String,String>> problems, Throwable cause)Creates a new instance ofValidationExceptionfor the given class and validation problems.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MultiKey2<String,String>>problems()Returns the validation problems as a read-only list.Class<?>targetClass()Returns builder's target class experiencing the validation problems.StringtoString()Returns text displaying the message validation problems.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
ValidationException
public ValidationException(Class<?> tc, List<MultiKey2<String,String>> problems)
Creates a new instance ofValidationExceptionfor the given class and validation problems.- Parameters:
tc- validation exception applies to building this class.problems- discovered message class problems.
-
ValidationException
public ValidationException(Class<?> tc, List<MultiKey2<String,String>> problems, Throwable cause)
Creates a new instance ofValidationExceptionfor the given class and validation problems.- Parameters:
tc- validation exception applies to building this class.problems- discovered message class problems.cause- underlying cause for this validation exception.
-
-