📄 emailerrorhandler.java
字号:
/*
* WebLogic Server Unleashed
*/
package com.wlsunleashed.xml.sax;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
public class EMailErrorHandler implements ErrorHandler {
/**
* Invoked when a "warning" occurs
*
* @param warn instance of SAXParseException
* @throws Instance of SAXException
*/
public void warning(SAXParseException warn) throws SAXException {
// We shall print out all warnings and ignore them
printException(warn);
}
/**
* Invoked when an "error" occurs
*
* @param warn instance of SAXParseException
* @throws Instance of SAXException
*/
public void error(SAXParseException error) throws SAXException {
// print out the error & exit
printException(error);
throw new SAXException(error);
}
/**
* Invoked when a "warning" occurs
*
* @param warn instance of SAXParseException
* @throws Instance of SAXException
*/
public void fatalError(SAXParseException error) throws SAXException {
// print out the error & exit
printException(error);
throw new SAXException(error);
}
private void printException(SAXParseException exception) {
System.out.println("Error occurred while parsing the XML document");
System.out.println("Line # = " + exception.getLineNumber());
System.out.println("Column # = " + exception.getColumnNumber());
System.out.println(exception.getMessage());
System.out.println("Stack Trace");
exception.getCause().printStackTrace();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -