URISyntaxExceptionpublic class URISyntaxException extends Exception A {@code URISyntaxException} will be thrown if some information could not be parsed
while creating a URI. |
Fields Summary |
---|
private static final long | serialVersionUID | private String | input | private int | index |
Constructors Summary |
---|
public URISyntaxException(String input, String reason, int index)Constructs a new {@code URISyntaxException} instance containing the
string that caused the exception, a description of the problem and the
index at which the error occurred.
super(reason);
if (input == null || reason == null) {
throw new NullPointerException();
}
if (index < -1) {
throw new IllegalArgumentException();
}
this.input = input;
this.index = index;
| public URISyntaxException(String input, String reason)Constructs a new {@code URISyntaxException} instance containing the
string that caused the exception and a description of the problem.
super(reason);
if (input == null || reason == null) {
throw new NullPointerException();
}
this.input = input;
index = -1;
|
Methods Summary |
---|
public int | getIndex()Gets the index at which the syntax error was found or {@code -1} if the
index is unknown/unavailable.
return index;
| public java.lang.String | getInput()Gets the initial string that contains an invalid syntax.
return input;
| public java.lang.String | getMessage()Gets a description of the exception, including the reason, the string
that caused the syntax error and the position of the syntax error if
available.
String reason = super.getMessage();
if (index != -1) {
return Msg.getString("K0326", //$NON-NLS-1$
new String[] { reason, Integer.toString(index), input });
}
return Msg.getString("K0327", //$NON-NLS-1$
new String[] { reason, input });
| public java.lang.String | getReason()Gets a description of the syntax error.
return super.getMessage();
|
|