Class HtmlParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.oorian.html.parser.HtmlParseException
All Implemented Interfaces:
Serializable

public class HtmlParseException extends Exception
Exception thrown when HTML5 parsing fails.

This exception is thrown by the HTML5 parser when it encounters invalid HTML structure, null/empty input, or other parsing errors. It optionally captures line and column information to help identify the location of the error in the source HTML.

See Also:
  • Constructor Details

    • HtmlParseException

      public HtmlParseException(String message)
      Creates a new parse exception with an error message.
      Parameters:
      message - the error message describing what went wrong.
    • HtmlParseException

      public HtmlParseException(String message, Throwable cause)
      Creates a new parse exception with an error message and underlying cause.
      Parameters:
      message - the error message describing what went wrong.
      cause - the underlying exception that caused the parse failure.
    • HtmlParseException

      public HtmlParseException(String message, int line, int column)
      Creates a new parse exception with message and position information.
      Parameters:
      message - the error message describing what went wrong.
      line - the line number where the error occurred (1-based).
      column - the column number where the error occurred (1-based).
    • HtmlParseException

      public HtmlParseException(String message, int line, int column, Throwable cause)
      Creates a new parse exception with message, position, and underlying cause.
      Parameters:
      message - the error message describing what went wrong.
      line - the line number where the error occurred (1-based).
      column - the column number where the error occurred (1-based).
      cause - the underlying exception that caused the parse failure.
  • Method Details

    • getLine

      public int getLine()
      Gets the line number where the parsing error occurred.
      Returns:
      the line number (1-based), or -1 if line information is not available.
    • getColumn

      public int getColumn()
      Gets the column number where the parsing error occurred.
      Returns:
      the column number (1-based), or -1 if column information is not available.