Class XMLParseException


public class XMLParseException extends IllegalArgumentException

Thrown by an XMLParser refusing malformed input (see XMLParser.setRejectMalformed(boolean)) when the document is not well formed, nests deeper than XMLParser.setMaxDepth(int), or references an entity the parser does not define.

It extends IllegalArgumentException, which is what the parser has always thrown when a ParserCallback asks it to stop, so code that catches that keeps working.

  • Constructor Details

    • XMLParseException

      public XMLParseException(String message)

      Creates an exception with no position.

      Parameters
      • message: what is wrong
    • XMLParseException

      public XMLParseException(String message, int line, int column)

      Creates an exception at a position, which the message names as "line 3, column 7: ...".

      Parameters
      • message: what is wrong

      • line: the line of the offending character, from 1

      • column: its column, from 1 (0 before the first character of a line)

  • Method Details

    • getLine

      public int getLine()

      The line of the error, from 1, or -1 when it has no position.

      Returns

      the line

    • getColumn

      public int getColumn()

      The column of the error, from 1, or -1 when it has no position.

      Returns

      the column