Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util.regex

Class PatternSyntaxException

java.lang.Object
|
+--java.lang.Throwable
   |
   +--java.lang.Exception
      |
      +--java.lang.RuntimeException
         |
         +--java.lang.IllegalArgumentException
            |
            +--java.util.regex.PatternSyntaxException


public class PatternSyntaxException

extends IllegalArgumentException

Indicates illegal pattern for regular expression. Includes state to inspect the pattern and what and where the expression was not valid regular expression.

Constructor Summary

PatternSyntaxException(java.lang.String description, java.lang.String pattern, int index)

Creates a new PatternSyntaxException.

Method Summary

java.lang.StringgetDescription()

Returns a human readable escription of the syntax error.
intgetIndex()

Returns the index of the first character in the String that was probably invalid, or -1 when unknown.
java.lang.StringgetMessage()

Returns a string containing a line with the description, a line with the original pattern and a line indicating with a ^ which character is probably the first invalid character in the pattern if the index is not negative.
java.lang.StringgetPattern()

Returns the original pattern that contained the syntax error.

Constructor Details

PatternSyntaxException

public PatternSyntaxException(java.lang.String description, java.lang.String pattern, int index)

Creates a new PatternSyntaxException.

Parameters:


Method Details

getDescription

public String getDescription()

Returns a human readable escription of the syntax error.


getIndex

public int getIndex()

Returns the index of the first character in the String that was probably invalid, or -1 when unknown.


getMessage

public String getMessage()

Returns a string containing a line with the description, a line with the original pattern and a line indicating with a ^ which character is probably the first invalid character in the pattern if the index is not negative.


getPattern

public String getPattern()

Returns the original pattern that contained the syntax error.