Home / Class/ BindValidationException Class — spring-boot Architecture

BindValidationException Class — spring-boot Architecture

Architecture documentation for the BindValidationException class in BindValidationException.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/BindValidationException.java lines 32–59

public class BindValidationException extends RuntimeException {

	private final ValidationErrors validationErrors;

	BindValidationException(ValidationErrors validationErrors) {
		super(getMessage(validationErrors));
		Assert.notNull(validationErrors, "'validationErrors' must not be null");
		this.validationErrors = validationErrors;
	}

	/**
	 * Return the validation errors that caused the exception.
	 * @return the validationErrors the validation errors
	 */
	public ValidationErrors getValidationErrors() {
		return this.validationErrors;
	}

	private static String getMessage(@Nullable ValidationErrors errors) {
		StringBuilder message = new StringBuilder("Binding validation errors");
		if (errors != null) {
			message.append(" on ").append(errors.getName());
			errors.getAllErrors().forEach((error) -> message.append(String.format("%n   - %s", error)));
		}
		return message.toString();
	}

}

Domain

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free