com.clickntap.hub.XMLErrorResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of click_framework Show documentation
Show all versions of click_framework Show documentation
Java Framework based on Spring Framework, Freemarker and Simplicity
The newest version!
package com.clickntap.hub;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.BindException;
import org.springframework.validation.FieldError;
public class XMLErrorResponse extends BO {
public Throwable exception;
public String stackTrace;
private List errorCodes;
public List getErrorCodes() {
return errorCodes;
}
public void setErrorCodes(List errorCodes) {
this.errorCodes = errorCodes;
}
public Throwable getException() {
return exception;
}
public void setException(Throwable throwable) {
this.exception = throwable;
if (throwable instanceof BindException) {
BindException e = (BindException) throwable;
List errorCodes = new ArrayList();
for (FieldError error : (List) e.getFieldErrors()) {
errorCodes.add(error.getField() + "." + error.getCode());
}
setErrorCodes(errorCodes);
}
}
public String getStackTrace() {
return stackTrace;
}
public void setStackTrace(String stackTrace) {
this.stackTrace = stackTrace;
}
}