org.apache.trax
Class ProcessorException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.xml.sax.SAXException
                    |
                    +--org.xml.sax.SAXParseException
                          |
                          +--org.apache.trax.ProcessorException

public class ProcessorException
extends SAXParseException

This exception serves as a root exception of TRaX exception, and is thrown in raw form when an exceptional condition occurs in the Processor object.

Open issues:

Abstract exception root?

Should the root TRaX exception be abstract?

Derive from SAXException?

Keith Visco writes: I don't think these exceptions should extend SAXException, but could nest a SAXException if necessary.

See Also:
Serialized Form

Constructor Summary
ProcessorException(java.lang.String message)
          Create a new ProcessorException from a message.
ProcessorException(java.lang.String message, java.lang.Exception e)
          Wrap an existing exception in a ProcessorException.
ProcessorException(java.lang.String message, Locator locator)
          Create a new ProcessorException from a message and a Locator.
ProcessorException(java.lang.String message, Locator locator, java.lang.Exception e)
          Wrap an existing exception in a ProcessorException.
ProcessorException(java.lang.String message, java.lang.String publicId, java.lang.String systemId, int lineNumber, int columnNumber)
          Create a new ProcessorException.
ProcessorException(java.lang.String message, java.lang.String publicId, java.lang.String systemId, int lineNumber, int columnNumber, java.lang.Exception e)
          Create a new ProcessorException with an embedded exception.
 
Method Summary
 java.lang.String getMessage()
          Find the most contained message.
 void printStackTrace(java.io.PrintStream s)
          Print the the trace of methods from where the error originated.
 void printStackTrace(java.io.PrintWriter s)
          Print the the trace of methods from where the error originated.
 
Methods inherited from class org.xml.sax.SAXParseException
getColumnNumber, getLineNumber, getPublicId, getSystemId
 
Methods inherited from class org.xml.sax.SAXException
getException, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessorException

public ProcessorException(java.lang.String message)
Create a new ProcessorException from a message.

This constructor is especially useful when an application is creating its own exception from within a DocumentHandler callback.

Parameters:
message - The error or warning message.
See Also:
Locator, Parser.setLocale(java.util.Locale)

ProcessorException

public ProcessorException(java.lang.String message,
                          Locator locator)
Create a new ProcessorException from a message and a Locator.

This constructor is especially useful when an application is creating its own exception from within a DocumentHandler callback.

Parameters:
message - The error or warning message.
locator - The locator object for the error or warning.
See Also:
Locator, Parser.setLocale(java.util.Locale)

ProcessorException

public ProcessorException(java.lang.String message,
                          Locator locator,
                          java.lang.Exception e)
Wrap an existing exception in a ProcessorException.

This constructor is especially useful when an application is creating its own exception from within a DocumentHandler callback, and needs to wrap an existing exception that is not a subclass of 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.
e - Any exception
See Also:
Locator, Parser.setLocale(java.util.Locale)

ProcessorException

public ProcessorException(java.lang.String message,
                          java.lang.Exception e)
Wrap an existing exception in a ProcessorException.

This is used for throwing processor exceptions before the processing has started.

Parameters:
message - The error or warning message, or null to use the message from the embedded exception.
e - Any exception
See Also:
Locator, Parser.setLocale(java.util.Locale)

ProcessorException

public ProcessorException(java.lang.String message,
                          java.lang.String publicId,
                          java.lang.String systemId,
                          int lineNumber,
                          int columnNumber)
Create a new ProcessorException.

This constructor is most useful for parser writers.

If the system identifier is a URL, the parser must resolve it fully before creating the exception.

Parameters:
message - The error or warning message.
publicId - The public identifer of the entity that generated the error or warning.
systemId - The system identifer 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.
See Also:
Parser.setLocale(java.util.Locale)

ProcessorException

public ProcessorException(java.lang.String message,
                          java.lang.String publicId,
                          java.lang.String systemId,
                          int lineNumber,
                          int columnNumber,
                          java.lang.Exception e)
Create a new ProcessorException 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.

If the system identifier is a URL, the parser 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 identifer of the entity that generated the error or warning.
systemId - The system identifer 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.
See Also:
Parser.setLocale(java.util.Locale)
Method Detail

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object.
Parameters:
s - The stream where the dump will be sent to.
Overrides:
printStackTrace in class java.lang.Throwable

getMessage

public java.lang.String getMessage()
Find the most contained message.
Overrides:
getMessage in class SAXException

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Print the the trace of methods from where the error originated. This will trace all nested exception objects, as well as this object.
Parameters:
s - The writer where the dump will be sent to.
Overrides:
printStackTrace in class java.lang.Throwable


Copyright © 2000 Apache XML Project. All Rights Reserved.