org.axonframework.commandhandling.interceptors
Class JSR303ViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.common.AxonException
org.axonframework.common.AxonNonTransientException
org.axonframework.commandhandling.StructuralCommandValidationFailedException
org.axonframework.commandhandling.interceptors.JSR303ViolationException
- All Implemented Interfaces:
- Serializable
public class JSR303ViolationException
- extends StructuralCommandValidationFailedException
Specialized version of the StructuralCommandValidationFailedException that provides a set of JSR303 constraint
violations that provide details about the exact failure of the command.
- Since:
- 1.1
- Author:
- Allard Buijze
- See Also:
- Serialized Form
Constructor Summary |
JSR303ViolationException(Set<javax.validation.ConstraintViolation<Object>> violations)
Initializes an exception with the given message and violations . |
Method Summary |
protected static String |
convert(Set<javax.validation.ConstraintViolation<Object>> violations)
Convert the violations to a human readable format, sorted by class and property e.g. |
Set<javax.validation.ConstraintViolation<Object>> |
getViolations()
Returns the violations that were detected when this exception was thrown. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
JSR303ViolationException
public JSR303ViolationException(Set<javax.validation.ConstraintViolation<Object>> violations)
- Initializes an exception with the given
message
and violations
.
- Parameters:
violations
- The violations that were detected
getViolations
public Set<javax.validation.ConstraintViolation<Object>> getViolations()
- Returns the violations that were detected when this exception was thrown.
- Returns:
- the violations that were detected when this exception was thrown
convert
protected static String convert(Set<javax.validation.ConstraintViolation<Object>> violations)
- Convert the violations to a human readable format, sorted by class and property e.g.
property ab in class my.some.Klass may not be null
property cd in class my.some.OtherClass length must be between 0 and 3
property cd in class my.some.OtherClass must match "ab.*"
property notNull in class my.some.TheClass may not be null
Copyright © 2010-2016. All Rights Reserved.