Name
SAXParseException
Synopsis
An
exception
of this type signals an XML parsing error or warning.
SAXParseException
includes methods to return the
system and public identifiers of the document in which the error or
warning occurred, as well as methods to return the approximate line
number and column number at which it occurred. A parser is not
required to obtain or track all of this information, and the methods
may return null
or -1 if the information is not
available. (See Locator
for more information.)
Exceptions of this type are usually thrown by the application from
the methods of the ErrorHandler
interface. The
parser never throws a SAXParseException
itself,
but does pass an appropriately initialized instance of this class to
each of the ErrorHandler
methods. It is up to the
application’s ErrorHandler
object
to decide whether to actually throw the exception, however.
Figure 22-5. org.xml.sax.SAXParseException
public class SAXParseException extends SAXException { // Public Constructors public SAXParseException(String message, Locator locator); public SAXParseException(String message, Locator locator, Exception e); public SAXParseException(String message, String publicId, String systemId, int lineNumber, int columnNumber); public SAXParseException(String message, String publicId, String systemId, int lineNumber, int columnNumber, Exception e); // Public Instance Methods public int ...
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.