org.xml.sax
Class SAXParseException

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable 
      extended by java.lang.Exception sample code for java.lang.Exception definition code for java.lang.Exception 
          extended by org.xml.sax.SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException 
              extended by org.xml.sax.SAXParseException
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class SAXParseException
extends SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException

Encapsulate an XML parse error or warning.

This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.

This exception may include information for locating the error in the original XML document, as if it came from a Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator object. Note that although the application will receive a SAXParseException as the argument to the handlers in the ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.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 sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException , it inherits the ability to wrap another exception.

Since:
SAX 1.0
See Also:
SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException , Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator , ErrorHandler sample code for org.xml.sax.ErrorHandler definition code for org.xml.sax.ErrorHandler , Serialized Form

Constructor Summary
SAXParseException sample code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, org.xml.sax.Locator) definition code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, org.xml.sax.Locator) (String sample code for java.lang.String definition code for java.lang.String  message, Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator  locator)
          Create a new SAXParseException from a message and a Locator.
SAXParseException sample code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, org.xml.sax.Locator, java.lang.Exception) definition code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, org.xml.sax.Locator, java.lang.Exception) (String sample code for java.lang.String definition code for java.lang.String  message, Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator  locator, Exception sample code for java.lang.Exception definition code for java.lang.Exception  e)
          Wrap an existing exception in a SAXParseException.
SAXParseException sample code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int) definition code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int) (String sample code for java.lang.String definition code for java.lang.String  message, String sample code for java.lang.String definition code for java.lang.String  publicId, String sample code for java.lang.String definition code for java.lang.String  systemId, int lineNumber, int columnNumber)
          Create a new SAXParseException.
SAXParseException sample code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int, java.lang.Exception) definition code for org.xml.sax.SAXParseException.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int, java.lang.Exception) (String sample code for java.lang.String definition code for java.lang.String  message, String sample code for java.lang.String definition code for java.lang.String  publicId, String sample code for java.lang.String definition code for java.lang.String  systemId, int lineNumber, int columnNumber, Exception sample code for java.lang.Exception definition code for java.lang.Exception  e)
          Create a new SAXParseException with an embedded exception.
 
Method Summary
 int getColumnNumber sample code for org.xml.sax.SAXParseException.getColumnNumber() definition code for org.xml.sax.SAXParseException.getColumnNumber() ()
          The column number of the end of the text where the exception occurred.
 int getLineNumber sample code for org.xml.sax.SAXParseException.getLineNumber() definition code for org.xml.sax.SAXParseException.getLineNumber() ()
          The line number of the end of the text where the exception occurred.
 String sample code for java.lang.String definition code for java.lang.String getPublicId sample code for org.xml.sax.SAXParseException.getPublicId() definition code for org.xml.sax.SAXParseException.getPublicId() ()
          Get the public identifier of the entity where the exception occurred.
 String sample code for java.lang.String definition code for java.lang.String getSystemId sample code for org.xml.sax.SAXParseException.getSystemId() definition code for org.xml.sax.SAXParseException.getSystemId() ()
          Get the system identifier of the entity where the exception occurred.
 
Methods inherited from class org.xml.sax.SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException
getException sample code for org.xml.sax.SAXException.getException() definition code for org.xml.sax.SAXException.getException() , getMessage sample code for org.xml.sax.SAXException.getMessage() definition code for org.xml.sax.SAXException.getMessage() , toString sample code for org.xml.sax.SAXException.toString() definition code for org.xml.sax.SAXException.toString()
 
Methods inherited from class java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable
fillInStackTrace sample code for java.lang.Throwable.fillInStackTrace() definition code for java.lang.Throwable.fillInStackTrace() , getCause sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause() , getLocalizedMessage sample code for java.lang.Throwable.getLocalizedMessage() definition code for java.lang.Throwable.getLocalizedMessage() , getStackTrace sample code for java.lang.Throwable.getStackTrace() definition code for java.lang.Throwable.getStackTrace() , initCause sample code for java.lang.Throwable.initCause(java.lang.Throwable) definition code for java.lang.Throwable.initCause(java.lang.Throwable) , printStackTrace sample code for java.lang.Throwable.printStackTrace() definition code for java.lang.Throwable.printStackTrace() , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintStream) definition code for java.lang.Throwable.printStackTrace(java.io.PrintStream) , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) definition code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) , setStackTrace sample code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) definition code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[])
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

SAXParseException sample code for org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator) definition code for org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator)

public SAXParseException(String sample code for java.lang.String definition code for java.lang.String  message,
                         Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.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 ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler callback.

Parameters:
message - The error or warning message.
locator - The locator object for the error or warning (may be null).
See Also:
Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator

SAXParseException sample code for org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator, java.lang.Exception) definition code for org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator, java.lang.Exception)

public SAXParseException(String sample code for java.lang.String definition code for java.lang.String  message,
                         Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator  locator,
                         Exception sample code for java.lang.Exception definition code for java.lang.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 ContentHandler sample code for org.xml.sax.ContentHandler definition code for org.xml.sax.ContentHandler callback, and needs to wrap an existing exception that is not a subclass of SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException .

Parameters:
message - The error or warning message, or null to use the message from the embedded exception.
locator - The locator object for the error or warning (may be null).
e - Any exception.
See Also:
Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator

SAXParseException sample code for org.xml.sax.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int) definition code for org.xml.sax.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int)

public SAXParseException(String sample code for java.lang.String definition code for java.lang.String  message,
                         String sample code for java.lang.String definition code for java.lang.String  publicId,
                         String sample code for java.lang.String definition code for java.lang.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 Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator . For example, if the system identifier is a URL (including relative filename), the caller must resolve it fully before creating the exception.

Parameters:
message - The error or warning message.
publicId - The public identifier of the entity that generated the error or warning.
systemId - The system identifier of the entity that generated the error or warning.
lineNumber - The line number of the end of the text that caused the error or warning.
columnNumber - The column number of the end of the text that cause the error or warning.

SAXParseException sample code for org.xml.sax.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int, java.lang.Exception) definition code for org.xml.sax.SAXParseException(java.lang.String, java.lang.String, java.lang.String, int, int, java.lang.Exception)

public SAXParseException(String sample code for java.lang.String definition code for java.lang.String  message,
                         String sample code for java.lang.String definition code for java.lang.String  publicId,
                         String sample code for java.lang.String definition code for java.lang.String  systemId,
                         int lineNumber,
                         int columnNumber,
                         Exception sample code for java.lang.Exception definition code for java.lang.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 SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException .

All parameters except the message and exception are as if they were provided by a Locator sample code for org.xml.sax.Locator definition code for org.xml.sax.Locator . For example, if the system identifier is a URL (including relative filename), the caller must resolve it fully before creating the exception.

Parameters:
message - The error or warning message, or null to use the message from the embedded exception.
publicId - The public identifier of the entity that generated the error or warning.
systemId - The system identifier of the entity that generated the error or warning.
lineNumber - The line number of the end of the text that caused the error or warning.
columnNumber - The column number of the end of the text that cause the error or warning.
e - Another exception to embed in this one.
Method Detail

getPublicId sample code for org.xml.sax.SAXParseException.getPublicId() definition code for org.xml.sax.SAXParseException.getPublicId()

public String sample code for java.lang.String definition code for java.lang.String  getPublicId()
Get the public identifier of the entity where the exception occurred.

Returns:
A string containing the public identifier, or null if none is available.
See Also:
Locator.getPublicId() sample code for org.xml.sax.Locator.getPublicId() definition code for org.xml.sax.Locator.getPublicId()

getSystemId sample code for org.xml.sax.SAXParseException.getSystemId() definition code for org.xml.sax.SAXParseException.getSystemId()

public String sample code for java.lang.String definition code for java.lang.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.

Returns:
A string containing the system identifier, or null if none is available.
See Also:
Locator.getSystemId() sample code for org.xml.sax.Locator.getSystemId() definition code for org.xml.sax.Locator.getSystemId()

getLineNumber sample code for org.xml.sax.SAXParseException.getLineNumber() definition code for org.xml.sax.SAXParseException.getLineNumber()

public int getLineNumber()
The line number of the end of the text where the exception occurred.

The first line is line 1.

Returns:
An integer representing the line number, or -1 if none is available.
See Also:
Locator.getLineNumber() sample code for org.xml.sax.Locator.getLineNumber() definition code for org.xml.sax.Locator.getLineNumber()

getColumnNumber sample code for org.xml.sax.SAXParseException.getColumnNumber() definition code for org.xml.sax.SAXParseException.getColumnNumber()

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.

Returns:
An integer representing the column number, or -1 if none is available.
See Also:
Locator.getColumnNumber() sample code for org.xml.sax.Locator.getColumnNumber() definition code for org.xml.sax.Locator.getColumnNumber()