Class ParseException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    NoRootHandlerException

    public class ParseException
    extends org.xml.sax.SAXException
    A parse exception. This does the same as the SAXParseException, but it also prints the parent exception.
    Author:
    Thomas Morgner
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseException​(java.lang.Exception e)
      Creates a new ParseException with the given root exception.
      ParseException​(java.lang.Exception e, org.xml.sax.Locator locator)
      Creates a new ParseException with the given root exception and the locator.
      ParseException​(java.lang.String message)
      Creates a new ParseException with the given message.
      ParseException​(java.lang.String message, java.lang.Exception e)
      Creates a new ParseException with the given message and root exception.
      ParseException​(java.lang.String message, java.lang.Exception e, org.xml.sax.Locator locator)
      Creates a new ParseException with the given message, root exception and the locator.
      ParseException​(java.lang.String message, org.xml.sax.Locator locator)
      Creates a new ParseException with the given message and the locator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getColumn()
      Returns the column of the parse position where the error occured.
      int getLine()
      Returns the line of the parse position where the error occured.
      java.lang.String getMessage()
      Modifies the message to give more detailed location information.
      void printStackTrace​(java.io.PrintStream stream)
      Prints the stack trace to the specified stream.
      void printStackTrace​(java.io.PrintWriter writer)
      Prints the stack trace to the specified writer.
      java.lang.String toString()
      Override toString to pick up any embedded exception.
      • Methods inherited from class org.xml.sax.SAXException

        getCause, getException
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ParseException

        public ParseException​(java.lang.String message)
        Creates a new ParseException with the given message.
        Parameters:
        message - the message
      • ParseException

        public ParseException​(java.lang.Exception e)
        Creates a new ParseException with the given root exception.
        Parameters:
        e - the exception
      • ParseException

        public ParseException​(java.lang.String message,
                              java.lang.Exception e)
        Creates a new ParseException with the given message and root exception.
        Parameters:
        message - the message
        e - the exception
      • ParseException

        public ParseException​(java.lang.String message,
                              org.xml.sax.Locator locator)
        Creates a new ParseException with the given message and the locator.
        Parameters:
        message - the message
        locator - the locator of the parser
      • ParseException

        public ParseException​(java.lang.Exception e,
                              org.xml.sax.Locator locator)
        Creates a new ParseException with the given root exception and the locator.
        Parameters:
        e - the exception
        locator - the locator of the parser
      • ParseException

        public ParseException​(java.lang.String message,
                              java.lang.Exception e,
                              org.xml.sax.Locator locator)
        Creates a new ParseException with the given message, root exception and the locator.
        Parameters:
        message - the message
        e - the exception
        locator - the locator of the parser
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Modifies the message to give more detailed location information.
        Overrides:
        getMessage in class org.xml.sax.SAXException
        Returns:
        the modified exception message.
      • getLine

        public int getLine()
        Returns the line of the parse position where the error occured.
        Returns:
        the line number or -1 if not known.
      • getColumn

        public int getColumn()
        Returns the column of the parse position where the error occured.
        Returns:
        the column number or -1 if not known.
      • printStackTrace

        public void printStackTrace​(java.io.PrintStream stream)
        Prints the stack trace to the specified stream.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        stream - the output stream.
      • toString

        public java.lang.String toString()
        Override toString to pick up any embedded exception.
        Overrides:
        toString in class org.xml.sax.SAXException
        Returns:
        A string representation of this exception.
      • printStackTrace

        public void printStackTrace​(java.io.PrintWriter writer)
        Prints the stack trace to the specified writer.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        writer - the writer.