Top Description Fields Constructors Methods
java.util.regex

public Class PatternSyntaxException

extends IllegalArgumentException
Class Inheritance

Unchecked exception thrown to indicate a syntax error in a regular-expression pattern.
Since
1.4

Field Summary

Modifier and TypeField and Description
private final String
private final int
private final String
private static final long

Constructor Summary

AccessConstructor and Description
public
PatternSyntaxException(String
A description of the error
desc
,
String
The erroneous pattern
regex
,
int
The approximate index in the pattern of the error, or -1 if the index is not known
index
)

Constructs a new instance of this class.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The description of the error
getDescription
()

Retrieves the description of the error.

public int

Returns:

The approximate index in the pattern of the error, or -1 if the index is not known
getIndex
()

Retrieves the error index.

public String

Returns:

The full detail message
getMessage
()

Overrides java.lang.Throwable.getMessage.

Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.

public String

Returns:

The erroneous pattern
getPattern
()

Retrieves the erroneous regular-expression pattern.

Field Detail

descback to summary
private final String desc
indexback to summary
private final int index
patternback to summary
private final String pattern
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.IllegalArgumentException.serialVersionUID.

Annotations
@Serial

Constructor Detail

PatternSyntaxExceptionback to summary
public PatternSyntaxException(String desc, String regex, int index)

Constructs a new instance of this class.

Parameters
desc:String

A description of the error

regex:String

The erroneous pattern

index:int

The approximate index in the pattern of the error, or -1 if the index is not known

Method Detail

getDescriptionback to summary
public String getDescription()

Retrieves the description of the error.

Returns:String

The description of the error

getIndexback to summary
public int getIndex()

Retrieves the error index.

Returns:int

The approximate index in the pattern of the error, or -1 if the index is not known

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.

Returns:String

The full detail message

getPatternback to summary
public String getPattern()

Retrieves the erroneous regular-expression pattern.

Returns:String

The erroneous pattern