Package java.net
Class URISyntaxException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.net.URISyntaxException
- All Implemented Interfaces:
Serializable
public class URISyntaxException extends Exception
A
URISyntaxException will be thrown if some information could not be parsed
while creating a URI.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description URISyntaxException(String input, String reason)Constructs a newURISyntaxExceptioninstance containing the string that caused the exception and a description of the problem.URISyntaxException(String input, String reason, int index)Constructs a newURISyntaxExceptioninstance containing the string that caused the exception, a description of the problem and the index at which the error occurred. -
Method Summary
Modifier and Type Method Description intgetIndex()Gets the index at which the syntax error was found or-1if the index is unknown/unavailable.StringgetInput()Gets the initial string that contains an invalid syntax.StringgetMessage()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.StringgetReason()Gets a description of the syntax error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
URISyntaxException
Constructs a newURISyntaxExceptioninstance containing the string that caused the exception, a description of the problem and the index at which the error occurred.- Parameters:
input- the string that caused the exception.reason- the reason why the exception occurred.index- the position where the exception occurred.- Throws:
NullPointerException- if one of the argumentsinputorreasonisnull.IllegalArgumentException- if the value forindexis lesser than-1.
-
URISyntaxException
Constructs a newURISyntaxExceptioninstance containing the string that caused the exception and a description of the problem.- Parameters:
input- the string that caused the exception.reason- the reason why the exception occurred.- Throws:
NullPointerException- if one of the argumentsinputorreasonisnull.
-
-
Method Details
-
getIndex
public int getIndex()Gets the index at which the syntax error was found or-1if the index is unknown/unavailable.- Returns:
- the index of the syntax error.
-
getReason
Gets a description of the syntax error.- Returns:
- the string describing the syntax error.
-
getInput
Gets the initial string that contains an invalid syntax.- Returns:
- the string that caused the exception.
-
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.- Overrides:
getMessagein classThrowable- Returns:
- a sting containing information about the exception.
- See Also:
Throwable.getMessage()
-