public class URISyntaxException
extends 异常
| java.lang.Object | |||
| java.lang.Throwable | |||
| java.lang.Exception | |||
| java.net.URISyntaxException | |||
检查的异常抛出,表明一个字符串不能被解析为一个URI引用。
也可以看看:
Public constructors |
|
|---|---|
URISyntaxException(String input, String reason, int index) 根据给定的输入字符串,原因和错误索引构造一个实例。 |
|
URISyntaxException(String input, String reason) 根据给定的输入字符串和原因构造一个实例。 |
|
公共方法(Public methods) |
|
|---|---|
int |
getIndex() 返回发生解析错误的位置的输入字符串的索引,或者如果此位置 未知,则 返回-1 。 |
String |
getInput() 返回输入字符串。 |
String |
getMessage() 返回描述解析错误的字符串。 |
String |
getReason() 返回一个字符串,解释为什么无法分析输入字符串。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Throwable
|
|
java.lang.Object
|
|
URISyntaxException (String input, String reason, int index)
根据给定的输入字符串,原因和错误索引构造一个实例。
| 参数(Parameters) | |
|---|---|
input |
String: The input string |
reason |
String: A string explaining why the input could not be parsed |
index |
int: The index at which the parse error occurred, or -1 if the index is not known |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
If either the input or reason strings are null |
IllegalArgumentException |
If the error index is less than -1 |
URISyntaxException (String input, String reason)
根据给定的输入字符串和原因构造一个实例。 结果对象的错误索引为-1 。
| 参数(Parameters) | |
|---|---|
input |
String: The input string |
reason |
String: A string explaining why the input could not be parsed |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
If either the input or reason strings are null |
int getIndex ()
返回发生解析错误的位置的输入字符串的索引,或者如果此位置 未知,则 返回-1 。
| 返回(Returns) | |
|---|---|
int |
The error index |
String getMessage ()
返回描述解析错误的字符串。 结果字符串由原因字符串,后跟冒号字符( ':' ),空格和输入字符串组成。 如果定义了错误索引,则字符串" at index "后跟索引(十进制)插入到原因字符串之后和冒号字符之前。
| 返回(Returns) | |
|---|---|
String |
A string describing the parse error |
String getReason ()
返回一个字符串,解释为什么无法分析输入字符串。
| 返回(Returns) | |
|---|---|
String |
The reason string |