Package com.logicaldoc.core.validation
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.logicaldoc.core.PersistenceException
-
- com.logicaldoc.core.validation.ValidationException
-
- All Implemented Interfaces:
Serializable
public class ValidationException extends PersistenceException
Raised when the content being stored are not logically valid.- Since:
- 8.8.1
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationException(String message)
ValidationException(String message, Throwable cause)
ValidationException(Collection<ValidationError> errors)
Creates a new session with the map of errorsValidationException(Collection<ValidationError> errors, Throwable cause)
Creates a new session with the map of errors
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(ValidationError error)
Map<String,ValidationError>
getErrors()
Retrieves the map with the errors descriptionsString
getMessage()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ValidationException
public ValidationException(Collection<ValidationError> errors)
Creates a new session with the map of errors- Parameters:
errors
- map of error descriptions
-
ValidationException
public ValidationException(Collection<ValidationError> errors, Throwable cause)
Creates a new session with the map of errors- Parameters:
errors
- collection of error descriptionscause
- origin of the error
-
ValidationException
public ValidationException(String message)
-
-
Method Detail
-
getErrors
public Map<String,ValidationError> getErrors()
Retrieves the map with the errors descriptions- Returns:
- the map attribute_name - error_description
-
addError
public void addError(ValidationError error)
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-