This exception may include information for locating the error
in the original XML document, as if it came from a Locator
object. Note that although the application
will receive a SAXParseException as the argument to the handlers
in the ErrorHandler
interface,
the application is not actually required to throw the exception;
instead, it can simply read the information in it and take a
different action.
Since this exception is a subclass of SAXException
, it inherits the ability to wrap another exception.
org.xml.sax.SAXException
, org.xml.sax.Locator
, org.xml.sax.ErrorHandler
Modifier and Type | Field and Description |
---|---|
private int | |
private int | |
private String | |
pack-priv static final long | |
private String |
Access | Constructor and Description |
---|---|
public | SAXParseException(String
The error or warning message. message, Locator The locator object for the error or warning (may be
null). locator)Create a new SAXParseException from a message and a Locator. |
public | SAXParseException(String
The error or warning message, or null to
use the message from the embedded exception. message, Locator The locator object for the error or warning (may be
null). locator, Exception Any exception. e)Wrap an existing exception in a SAXParseException. |
public | SAXParseException(String
The error or warning message. message, String The public identifier of the entity that generated
the error or warning. publicId, String The system identifier of the entity that generated
the error or warning. systemId, int The line number of the end of the text that
caused the error or warning. lineNumber, int The column number of the end of the text that
cause the error or warning. columnNumber)Create a new SAXParseException. |
public | SAXParseException(String
The error or warning message, or null to use
the message from the embedded exception. message, String The public identifier of the entity that generated
the error or warning. publicId, String The system identifier of the entity that generated
the error or warning. systemId, int The line number of the end of the text that
caused the error or warning. lineNumber, int The column number of the end of the text that
cause the error or warning. columnNumber, Exception Another exception to embed in this one. e)Create a new SAXParseException with an embedded exception. |
Modifier and Type | Method and Description |
---|---|
public int | Returns: An integer representing the column number, or -1 if none is available.The column number of the end of the text where the exception occurred. |
public int | Returns: An integer representing the line number, or -1 if none is available.The line number of the end of the text where the exception occurred. |
public String | Returns: A string containing the public identifier, or null if none is available.Get the public identifier of the entity where the exception occurred. |
public String | Returns: A string containing the system identifier, or null if none is available.Get the system identifier of the entity where the exception occurred. |
private void | init(String
The public identifier of the entity which generated the exception,
or null. publicId, String The system identifier of the entity which generated the exception,
or null. systemId, int The line number of the error, or -1. lineNumber, int The column number of the error, or -1. columnNumber)Internal initialization method. |
public String | Returns: A string representation of this exception.Overrides org. |
columnNumber | back to summary |
---|---|
private int columnNumber
|
lineNumber | back to summary |
---|---|
private int lineNumber
|
publicId | back to summary |
---|---|
private String publicId
|
serialVersionUID | back to summary |
---|---|
pack-priv static final long serialVersionUID |
systemId | back to summary |
---|---|
private String systemId
|
SAXParseException | back to summary |
---|---|
public SAXParseException(String message, Locator locator) Create a new SAXParseException from a message and a Locator. This constructor is especially useful when an application is
creating its own exception from within a
|
SAXParseException | back to summary |
---|---|
public SAXParseException(String message, Locator locator, Exception e) Wrap an existing exception in a SAXParseException. This constructor is especially useful when an application is
creating its own exception from within a
|
SAXParseException | back to summary |
---|---|
public SAXParseException(String message, String publicId, String systemId, int lineNumber, int columnNumber) Create a new SAXParseException. This constructor is most useful for parser writers. All parameters except the message are as if
they were provided by a
|
SAXParseException | back to summary |
---|---|
public SAXParseException(String message, String publicId, String systemId, int lineNumber, int columnNumber, Exception e) Create a new SAXParseException with an embedded exception. This constructor is most useful for parser writers who
need to wrap an exception that is not a subclass of
All parameters except the message and exception are as if
they were provided by a
|
getColumnNumber | back to summary |
---|---|
public int getColumnNumber() The column number of the end of the text where the exception occurred. The first column in a line is position 1.
|
getLineNumber | back to summary |
---|---|
public int getLineNumber() The line number of the end of the text where the exception occurred. The first line is line 1.
|
getPublicId | back to summary |
---|---|
public String getPublicId() Get the public identifier of the entity where the exception occurred.
|
getSystemId | back to summary |
---|---|
public String getSystemId() Get the system identifier of the entity where the exception occurred. If the system identifier is a URL, it will have been resolved fully.
|
init | back to summary |
---|---|
private void init(String publicId, String systemId, int lineNumber, int columnNumber) Internal initialization method. |
toString | back to summary |
---|---|
public String toString() Overrides org. Override toString to provide more detailed error message.
|