public class URISyntaxException extends 异常
URI , Serialized Form
| Constructor and Description |
|---|
URISyntaxException(String input, String reason)
从给定的输入字符串构造一个实例和原因。
|
URISyntaxException(String input, String reason, int index)
从给定的输入字符串,原因和错误索引构造一个实例。
|
| Modifier and Type | Method and Description |
|---|---|
int |
getIndex()
将索引返回到发生解析错误的位置的输入字符串,如果此位置不知道,则返回
-1 。
|
String |
getInput()
返回输入字符串。
|
String |
getMessage()
返回描述解析错误的字符串。
|
String |
getReason()
返回一个字符串,解释为什么无法解析输入字符串。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic URISyntaxException(String input, String reason, int index)
input - 输入字符串
reason - 一个解释为什么无法解析输入的字符串
index - 发生解析错误的索引,如果索引未知,
-1
NullPointerException - 如果输入或原因字符串都是
null
IllegalArgumentException - 如果错误指数小于
-1
public URISyntaxException(String input, String reason)
-1 。
input - 输入字符串
reason - 一个解释为什么无法解析输入的字符串
NullPointerException - 如果输入或原因字符串都是
null
public String getInput()
public String getReason()
public int getIndex()
-1则
-1 。
public String getMessage()
':' ),空格和输入字符串组成。
如果定义了错误索引,那么字符串" at index "后跟索引(以十进制)插入原因字符串之后和冒号字符之前。
getMessage在
Throwable
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.