no message

main
이범준 1 year ago
parent 1a16c3b73e
commit a2d801789e

@ -1,35 +0,0 @@
package cokr.xit.fims.framework.support.util.xml;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.ValidationEventLocator;
/**
* JAXB API
* ValidationEvent.WARNING( 0),
* ValidationEvent.ERROR( 1),
* ValidationEvent.FATAL_ERROR( 2)
*/
@Slf4j
public class JAXCustomEventHandler implements ValidationEventHandler {
public boolean handleEvent(ValidationEvent event) {
if (event.getSeverity() == ValidationEvent.FATAL_ERROR
|| event.getSeverity() == ValidationEvent.ERROR) {
ValidationEventLocator locator = event.getLocator();
String message = event.getMessage();
log.error("Severity: " + event.getSeverity());
log.error("Line Number: " + locator.getLineNumber());
log.error("Column Number: " + locator.getColumnNumber());
log.error("Event Message: " + message);
//log.error("{}", event);
log.error("{}", locator);
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, message);
}
// 이벤트 에러 발생시 중단 : true - 계속 진행
return false;
}
}
Loading…
Cancel
Save