public class

URISyntaxException

extends Exception
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.net.URISyntaxException

Class Overview

A URISyntaxException will be thrown if some information could not be parsed while creating a URI.

Summary

Public Constructors
URISyntaxException(String input, String reason, int index)
Constructs a new URISyntaxException instance containing the string that caused the exception, a description of the problem and the index at which the error occurred.
URISyntaxException(String input, String reason)
Constructs a new URISyntaxException instance containing the string that caused the exception and a description of the problem.
Public Methods
int getIndex()
Gets the index at which the syntax error was found or -1 if the index is unknown/unavailable.
String getInput()
Gets the initial string that contains an invalid syntax.
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 getReason()
Gets a description of the syntax error.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public URISyntaxException (String input, String reason, int index)

Since: API Level 1

Constructs a new URISyntaxException instance 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 arguments input or reason is null.
IllegalArgumentException if the value for index is lesser than -1.

public URISyntaxException (String input, String reason)

Since: API Level 1

Constructs a new URISyntaxException instance 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 arguments input or reason is null.

Public Methods

public int getIndex ()

Since: API Level 1

Gets the index at which the syntax error was found or -1 if the index is unknown/unavailable.

Returns
  • the index of the syntax error.

public String getInput ()

Since: API Level 1

Gets the initial string that contains an invalid syntax.

Returns
  • the string that caused the exception.

public String getMessage ()

Since: API Level 1

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.

Returns
  • a sting containing information about the exception.
See Also

public String getReason ()

Since: API Level 1

Gets a description of the syntax error.

Returns
  • the string describing the syntax error.