Class TPatternSyntaxException

All Implemented Interfaces:
Serializable

public class TPatternSyntaxException extends IllegalArgumentException
Encapsulates a syntax error that occurred during the compilation of a TPattern. Might include a detailed description, the original regular expression, and the index at which the error occurred.
Author:
Nikolay A. Kuznetsov
See Also:
TPattern.compile(String), TPattern.compile(java.lang.String,int), Serialized Form
  • Constructor Details

    • TPatternSyntaxException

      public TPatternSyntaxException(String description, String pattern, int index)
      Creates a new PatternSyntaxException for a given message, pattern, and error index.
      Parameters:
      description - the description of the syntax error, or null if the description is not known.
      pattern - the syntactically incorrect regular expression, or null if the regular expression is not known.
      index - the character index around which the error occurred, or -1 if the index is not known.
  • Method Details

    • getPattern

      public String getPattern()
      Returns the syntactically incorrect regular expression.
      Returns:
      the regular expression.
    • getMessage

      public String getMessage()
      Returns a detailed error message for the exception. The message is potentially multi-line, and it might include a detailed description, the original regular expression, and the index at which the error occured.
      Overrides:
      getMessage in class Throwable
      Returns:
      the error message.
    • getDescription

      public String getDescription()
      Returns the description of the syntax error, or null if the description is not known.
      Returns:
      the description.
    • getIndex

      public int getIndex()
      Returns the character index around which the error occurred, or -1 if the index is not known.
      Returns:
      the index.