# Uses of Interface
org.springframework.validation.Errors

Packages that use Errors
Package
Description
org.springframework.validation
Provides data binding and validation functionality, for usage in business and/or UI layers.
org.springframework.validation.beanvalidation
Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.
org.springframework.validation.method
Abstractions and support classes for method validation, independent of the underlying validation library.

## Uses of Errors in org.springframework.validation

Subinterfaces of Errors in org.springframework.validation
Modifier and Type
Interface
Description
`interface`
`BindingResult`
General interface that represents binding results.
Classes in org.springframework.validation that implement Errors
Modifier and Type
Class
Description
`class`
`AbstractBindingResult`
Abstract implementation of the `BindingResult` interface and its super-interface `Errors`.
`class`
`AbstractErrors`
Abstract implementation of the `Errors` interface.
`class`
`AbstractPropertyBindingResult`
Abstract base class for `BindingResult` implementations that work with Spring's `PropertyAccessor` mechanism.
`class`
`BeanPropertyBindingResult`
Default implementation of the `Errors` and `BindingResult` interfaces, for the registration and evaluation of binding errors on JavaBean objects.
`class`
`BindException`
Thrown when binding errors are considered fatal.
`class`
`DirectFieldBindingResult`
Special implementation of the Errors and BindingResult interfaces, supporting registration and evaluation of binding errors on value objects.
`class`
`MapBindingResult`
Map-based implementation of the BindingResult interface, supporting registration and evaluation of binding errors on Map attributes.
`class`
`SimpleErrors`
A simple implementation of the `Errors` interface, managing global errors and field errors for a top-level target object.
Methods in org.springframework.validation that return Errors
Modifier and Type
Method
Description
`default Errors`
Validator.`validateObject(Object target)`
Validate the given `target` object individually.
Methods in org.springframework.validation with parameters of type Errors
Modifier and Type
Method
Description
`void`
AbstractBindingResult.`addAllErrors(Errors errors)`
`void`
BindException.`addAllErrors(Errors errors)`
`default void`
Errors.`addAllErrors(Errors errors)`
Add all errors from the given `Errors` instance to this `Errors` instance.
`void`
SimpleErrors.`addAllErrors(Errors errors)`
`static void`
ValidationUtils.`invokeValidator(Validator validator, Object target, Errors errors)`
Invoke the given `Validator` for the supplied object and `Errors` instance.
`static void`
ValidationUtils.`invokeValidator(Validator validator, Object target, Errors errors, Object... validationHints)`
Invoke the given `Validator`/`SmartValidator` for the supplied object and `Errors` instance.
`static void`
ValidationUtils.`rejectIfEmpty(Errors errors, String field, String errorCode)`
Reject the given field with the given error code if the value is empty.
`static void`
ValidationUtils.`rejectIfEmpty(Errors errors, String field, String errorCode, Object[] errorArgs)`
Reject the given field with the given error code and error arguments if the value is empty.
`static void`
ValidationUtils.`rejectIfEmpty(Errors errors, String field, String errorCode, Object[] errorArgs, String defaultMessage)`
Reject the given field with the given error code, error arguments and default message if the value is empty.
`static void`
ValidationUtils.`rejectIfEmpty(Errors errors, String field, String errorCode, String defaultMessage)`
Reject the given field with the given error code and default message if the value is empty.
`static void`
ValidationUtils.`rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode)`
Reject the given field with the given error code if the value is empty or just contains whitespace.
`static void`
ValidationUtils.`rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode, Object[] errorArgs)`
Reject the given field with the given error code and error arguments if the value is empty or just contains whitespace.
`static void`
ValidationUtils.`rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode, Object[] errorArgs, String defaultMessage)`
Reject the given field with the given error code, error arguments and default message if the value is empty or just contains whitespace.
`static void`
ValidationUtils.`rejectIfEmptyOrWhitespace(Errors errors, String field, String errorCode, String defaultMessage)`
Reject the given field with the given error code and default message if the value is empty or just contains whitespace.
`void`
SmartValidator.`validate(Object target, Errors errors, Object... validationHints)`
Validate the supplied `target` object, which must be of a type of `Class` for which the `Validator.supports(Class)` method typically returns `true`.
`void`
Validator.`validate(Object target, Errors errors)`
Validate the given `target` object which must be of a `Class` for which the `Validator.supports(Class)` method typically has returned (or would return) `true`.
`default void`
SmartValidator.`validateValue(Class<?> targetType, String fieldName, Object value, Errors errors, Object... validationHints)`
Validate the supplied value for the specified field on the target type, reporting the same validation errors as if the value would be bound to the field on an instance of the target class.
Method parameters in org.springframework.validation with type arguments of type Errors
Modifier and Type
Method
Description
`static <T> Validator`
Validator.`forInstanceOf(Class<T> targetClass, BiConsumer<T,Errors> delegate)`
Return a `Validator` that checks whether the target object is an instance of `targetClass`, applying the given `delegate` to populate `Errors` if it is.
`static <T> Validator`
Validator.`forType(Class<T> targetClass, BiConsumer<T,Errors> delegate)`
Return a `Validator` that checks whether the target object's class is identical to `targetClass`, applying the given `delegate` to populate `Errors` if it is.

## Uses of Errors in org.springframework.validation.beanvalidation

Methods in org.springframework.validation.beanvalidation with parameters of type Errors
Modifier and Type
Method
Description
`protected void`
SpringValidatorAdapter.`processConstraintViolations(Set<ConstraintViolation<Object>> violations, Errors errors)`
Process the given JSR-303 ConstraintViolations, adding corresponding errors to the provided Spring `Errors` object.
`void`
SpringValidatorAdapter.`validate(Object target, Errors errors)`
`void`
SpringValidatorAdapter.`validate(Object target, Errors errors, Object... validationHints)`
`void`
SpringValidatorAdapter.`validateValue(Class<?> targetType, String fieldName, Object value, Errors errors, Object... validationHints)`

## Uses of Errors in org.springframework.validation.method

Classes in org.springframework.validation.method that implement Errors
Modifier and Type
Class
Description
`class`
`ParameterErrors`
Extension of `ParameterValidationResult` created for Object method parameters or return values with nested errors on their properties.
Methods in org.springframework.validation.method with parameters of type Errors
Modifier and Type
Method
Description
`void`
ParameterErrors.`addAllErrors(Errors errors)`
Constructors in org.springframework.validation.method with parameters of type Errors
Modifier
Constructor
Description
``
`ParameterErrors(org.springframework.core.MethodParameter parameter, Object argument, Errors errors, Object container, Integer index, Object key)`
Create a `ParameterErrors`.