com.smallx.xml.infoset
Class XMLException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.smallx.xml.infoset.XMLException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NamespaceScope.NotDeclared, XPathException

public class XMLException
extends java.lang.Exception

This exception encapsulates XML runtime errors. Although it does not need to be caught, it has been declared where it is thrown. In addition, it provides a data structure for encapsulating errors and allows multiple errors to be associated with one exception.

See Also:
Serialized Form

Nested Class Summary
static class XMLException.Error
          A data structure that encapsulates an error.
 
Constructor Summary
XMLException(java.lang.String detail)
          Constructs an exception with message.
XMLException(java.lang.String detail, java.util.List errors)
          Constructs an exception with a list of errors.
XMLException(java.lang.String detail, Location node)
          Constructs an exception with message and location.
XMLException(java.lang.String detail, java.lang.Throwable exception)
          Constructs an exception with message and cause
XMLException(java.lang.String detail, java.lang.Throwable exception, Location node)
          Constructs an exception with message, cause, and location
XMLException(java.lang.Throwable exception)
          Constructs an exception with message, cause, and location
XMLException(java.lang.Throwable exception, Location node)
          Constructs an exception with message, cause, and location
 
Method Summary
 void addError(java.lang.String message, Item location)
           
 void addError(java.lang.String message, Item location, java.lang.Throwable cause)
           
 java.util.Iterator getErrors()
          Returns an iteration of the errors.
 Location getLocation()
          Returns the location of the error.
 boolean hasErrorList()
          Indicates that the exception has an error list.
 void write(java.io.PrintWriter pw)
          Writes the exception to a print stream.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLException

public XMLException(java.lang.String detail,
                    Location node)
Constructs an exception with message and location.

Parameters:
detail - The exception message.
node - The exception location.

XMLException

public XMLException(java.lang.String detail)
Constructs an exception with message.

Parameters:
detail - The exception message.

XMLException

public XMLException(java.lang.String detail,
                    java.lang.Throwable exception)
Constructs an exception with message and cause

Parameters:
detail - The exception message.
exception - The cause of the exception

XMLException

public XMLException(java.lang.String detail,
                    java.lang.Throwable exception,
                    Location node)
Constructs an exception with message, cause, and location

Parameters:
detail - The exception message.
exception - The cause of the exception
node - The exception location.

XMLException

public XMLException(java.lang.Throwable exception)
Constructs an exception with message, cause, and location

Parameters:
exception - The cause of the exception

XMLException

public XMLException(java.lang.Throwable exception,
                    Location node)
Constructs an exception with message, cause, and location

Parameters:
exception - The cause of the exception
node - The exception location.

XMLException

public XMLException(java.lang.String detail,
                    java.util.List errors)
Constructs an exception with a list of errors.

Parameters:
detail - The exception message.
errors - The list of error instances.
Method Detail

getLocation

public Location getLocation()
Returns the location of the error.


hasErrorList

public boolean hasErrorList()
Indicates that the exception has an error list.


getErrors

public java.util.Iterator getErrors()
Returns an iteration of the errors.


addError

public void addError(java.lang.String message,
                     Item location)

addError

public void addError(java.lang.String message,
                     Item location,
                     java.lang.Throwable cause)

write

public void write(java.io.PrintWriter pw)
Writes the exception to a print stream.