📄 errorhandler.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Wed Oct 31 22:26:26 PST 2001 --><TITLE>Java API for XML Processing Specification 1.1: Interface ErrorHandler</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ErrorHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/xml/sax/EntityResolver.html"><B>PREV CLASS</B></A> <A HREF="../../../org/xml/sax/Locator.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ErrorHandler.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.xml.sax</FONT><BR>Interface ErrorHandler</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/xml/sax/HandlerBase.html">HandlerBase</A>, <A HREF="../../../org/xml/sax/helpers/XMLFilterImpl.html">XMLFilterImpl</A>, <A HREF="../../../org/xml/sax/helpers/DefaultHandler.html">DefaultHandler</A></DD></DL><HR><DL><DT>public interface <B>ErrorHandler</B></DL><P>Basic interface for SAX error handlers. <blockquote> <em>This module, both source code and documentation, is in the Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> </blockquote> <p>If a SAX application needs to implement customized error handling, it must implement this interface and then register an instance with the XML reader using the <A HREF="../../../org/xml/sax/XMLReader.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>setErrorHandler</CODE></A> method. The parser will then report all errors and warnings through this interface.</p> <p><strong>WARNING:</strong> If an application does <em>not</em> register an ErrorHandler, XML parsing errors will go unreported and bizarre behaviour may result.</p> <p>For XML processing errors, a SAX driver must use this interface instead of throwing an exception: it is up to the application to decide whether to throw an exception for different types of errors and warnings. Note, however, that there is no requirement that the parser continue to provide useful information after a call to <A HREF="../../../org/xml/sax/ErrorHandler.html#fatalError(org.xml.sax.SAXParseException)"><CODE>fatalError</CODE></A> (in other words, a SAX driver class could catch an exception and report a fatalError).</p><P><DL><DT><B>Since: </B><DD>SAX 1.0</DD><DT><B>Version: </B><DD>2.0r2pre</DD><DT><B>Author: </B><DD>David Megginson, <a href="mailto:sax@megginson.com">sax@megginson.com</a></DD><DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/Parser.html#setErrorHandler(org.xml.sax.ErrorHandler)"><CODE>Parser.setErrorHandler(org.xml.sax.ErrorHandler)</CODE></A>, <A HREF="../../../org/xml/sax/SAXParseException.html"><CODE>SAXParseException</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/ErrorHandler.html#error(org.xml.sax.SAXParseException)">error</A></B>(<A HREF="../../../org/xml/sax/SAXParseException.html">SAXParseException</A> exception)</CODE><BR> Receive notification of a recoverable error.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/ErrorHandler.html#fatalError(org.xml.sax.SAXParseException)">fatalError</A></B>(<A HREF="../../../org/xml/sax/SAXParseException.html">SAXParseException</A> exception)</CODE><BR> Receive notification of a non-recoverable error.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/ErrorHandler.html#warning(org.xml.sax.SAXParseException)">warning</A></B>(<A HREF="../../../org/xml/sax/SAXParseException.html">SAXParseException</A> exception)</CODE><BR> Receive notification of a warning.</TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="warning(org.xml.sax.SAXParseException)"><!-- --></A><H3>warning</H3><PRE>public void <B>warning</B>(<A HREF="../../../org/xml/sax/SAXParseException.html">SAXParseException</A> exception) throws <A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></PRE><DL><DD>Receive notification of a warning. <p>SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.</p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.</p> <p>Filters may use this method to report other, non-XML warnings as well.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>exception</CODE> - The warning information encapsulated in a SAX parse exception.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></CODE> - Any SAX exception, possibly wrapping another exception.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/SAXParseException.html"><CODE>SAXParseException</CODE></A></DL></DD></DL><HR><A NAME="error(org.xml.sax.SAXParseException)"><!-- --></A><H3>error</H3><PRE>public void <B>error</B>(<A HREF="../../../org/xml/sax/SAXParseException.html">SAXParseException</A> exception) throws <A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></PRE><DL><DD>Receive notification of a recoverable error. <p>This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action.</p> <p>The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML 1.0 recommendation does not require it to do so.</p> <p>Filters may use this method to report other, non-XML errors as well.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>exception</CODE> - The error information encapsulated in a SAX parse exception.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></CODE> - Any SAX exception, possibly wrapping another exception.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/SAXParseException.html"><CODE>SAXParseException</CODE></A></DL></DD></DL><HR><A NAME="fatalError(org.xml.sax.SAXParseException)"><!-- --></A><H3>fatalError</H3><PRE>public void <B>fatalError</B>(<A HREF="../../../org/xml/sax/SAXParseException.html">SAXParseException</A> exception) throws <A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></PRE><DL><DD>Receive notification of a non-recoverable error. <p>This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a parser would use this callback to report the violation of a well-formedness constraint.</p> <p>The application must assume that the document is unusable after the parser has invoked this method, and should continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>exception</CODE> - The error information encapsulated in a SAX parse exception.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/xml/sax/SAXException.html">SAXException</A></CODE> - Any SAX exception, possibly wrapping another exception.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/SAXParseException.html"><CODE>SAXParseException</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ErrorHandler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/xml/sax/EntityResolver.html"><B>PREV CLASS</B></A> <A HREF="../../../org/xml/sax/Locator.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="ErrorHandler.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -