Class XmlParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.libxmq.imp.xml.XmlParseException
All Implemented Interfaces:
Serializable

public class XmlParseException extends Exception
Thrown when xml cannot be parsed. The message is formatted like the libxml2 error output, ie:
file.xml:1: parser error : Entity 'foo' not defined
<a>&foo;</a>
        ^
See Also:
  • Field Details

    • line

      public final int line
      The line where the error was found, starting at 1.
    • error

      public final String error
      The error message without the source context.
    • bytes

      public final byte[] bytes
      The full formatted message as bytes, print these to get exactly the C output.
  • Constructor Details

    • XmlParseException

      public XmlParseException(String full, String error, int line)
      Create an exception.
      Parameters:
      full - The full formatted message, with the source context.
      error - The error message itself.
      line - The line number.
    • XmlParseException

      public XmlParseException(byte[] full, String error, int line)
      Create an exception from a message formatted as bytes. Like the C version the source context is cut at a byte position, which can split a UTF-8 character.
      Parameters:
      full - The full formatted message, with the source context.
      error - The error message itself.
      line - The line number.
  • Method Details

    • print

      public void print()
      Print the message bytes unchanged to stderr.