📄 saxerrorhandler.java
字号:
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file. */package org.butor.config.lowlevel;import java.util.ArrayList;import java.util.List;import org.butor.helper.Message;import org.xml.sax.ErrorHandler;import org.xml.sax.SAXParseException;/** * This is a SAX parser errors handler. * * @author Aiman SAWAN */public class SaxErrorHandler implements ErrorHandler { protected ArrayList f_errorList; /** * Constructor */ public SaxErrorHandler() { f_errorList = new ArrayList(); } /** * Add an xml parse warning * * @param e SAXParseException. */ public void warning(SAXParseException e) { Message msg = new Message(); msg.setSeverity(Message.SEVERITY_WARN); msg.setText(e.getMessage()); msg.setSource(this); f_errorList.add(msg); } /** * Add an xml parse error * * @param e SAXParseException. */ public void error(SAXParseException e) { Message msg = new Message(); msg.setSeverity(Message.SEVERITY_ERROR); msg.setText(e.getMessage()); msg.setSource(this); f_errorList.add(msg); } /** * Add an xml parse fatal error * * @param e SAXParseException. */ public void fatalError(SAXParseException e) { Message msg = new Message(); msg.setSeverity(Message.SEVERITY_ERROR); msg.setText(e.getMessage()); msg.setSource(this); f_errorList.add(msg); } /** * tells if errors occured. * * @return boolean, true if errors occured, false otherwise. */ public boolean isError() { return (f_errorList.size() > 0); } /** * Get error list. * * @return List, this list contain As04Message objects */ public List getErrorList() { return f_errorList; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -