Most visited

Recently visited

Added in API level 1

PatternSyntaxException

public class PatternSyntaxException
extends IllegalArgumentException

java.lang.Object
    java.lang.Throwable
      java.lang.Exception
        java.lang.RuntimeException
          java.lang.IllegalArgumentException
            java.util.regex.PatternSyntaxException


抛出未经检查的异常,以指示正则表达式模式中的语法错误。

摘要(Summary)

Public constructors

PatternSyntaxException(String desc, String regex, int index)

构造这个类的新实例。

公共方法(Public methods)

String getDescription()

检索错误的描述。

int getIndex()

检索错误索引。

String getMessage()

返回一个多行字符串,其中包含语法错误及其索引的描述,错误的正则表达式模式以及模式中错误索引的可视指示。

String getPattern()

检索错误的正则表达式模式。

继承方法(Inherited methods)

From class java.lang.Throwable
From class java.lang.Object

Public constructors

PatternSyntaxException

Added in API level 1
PatternSyntaxException (String desc, 
                String regex, 
                int index)

构造这个类的新实例。

参数(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

公共方法(Public methods)

getDescription

Added in API level 1
String getDescription ()

检索错误的描述。

返回(Returns)
String The description of the error

getIndex

Added in API level 1
int getIndex ()

检索错误索引。

返回(Returns)
int The approximate index in the pattern of the error, or -1 if the index is not known

getMessage

Added in API level 1
String getMessage ()

返回一个多行字符串,其中包含语法错误及其索引的描述,错误的正则表达式模式以及模式中错误索引的可视指示。

返回(Returns)
String The full detail message

getPattern

Added in API level 1
String getPattern ()

检索错误的正则表达式模式。

返回(Returns)
String The erroneous pattern

Hooray!