org.springframework.exception.BindingException Maven / Gradle / Ivy
package org.springframework.exception;
import org.springframework.validation.BindingResult;
/**
* @see org.springframework.http.HttpStatus
*/
public class BindingException extends AbstractException {
private static final long serialVersionUID = -5892971454078544892L;
public static final int DEFAULT_STATUS = 400;
public static final String DEFAULT_CODE = "javax.validation.constraints.Binding";
private final BindingResult bindingResult;
public BindingException(BindingResult bindingResult) {
this((String) null, bindingResult);
}
public BindingException(String message, BindingResult bindingResult) {
super(message);
this.bindingResult = bindingResult;
}
public BindingException(Throwable cause, BindingResult bindingResult) {
this((String) null, cause, bindingResult);
}
public BindingException(String message, Throwable cause, BindingResult bindingResult) {
super(message, cause);
this.bindingResult = bindingResult;
}
public BindingResult getBindingResult() {
return bindingResult;
}
@Override
public String getCode() {
return DEFAULT_CODE;
}
@Override
public int getStatus() {
return DEFAULT_STATUS;
}
@Override
public Object[] getArgs() {
return null;
}
}