Package com.logicaldoc.core.metadata.validation

# Class ValidationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
com.logicaldoc.core.PersistenceException
com.logicaldoc.core.metadata.validation.ValidationException

All Implemented Interfaces:
  `Serializable`, `Iterable<Throwable>`

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 errors
`ValidationException(Collection<ValidationError> errors, Throwable cause)`
Creates a new session with the map of errors

## Method Summary

Modifier and Type
Method
Description
`void`
`addError(ValidationError error)`
`Map<String,ValidationError>`
`getErrors()`
Retrieves the map with the errors descriptions
`String`
`getMessage()`

### Methods inherited from class java.sql.SQLException

`getErrorCode, getNextException, getSQLState, iterator, setNextException`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Constructor Details

### 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 descriptions
  `cause` - origin of the error

### ValidationException

public ValidationException(String message, Throwable cause)

### ValidationException

public ValidationException(String message)

## Method Details

### 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 class `Throwable`