Stay organized with collections
Save and categorize content based on your preferences.
URISyntaxException
open class URISyntaxException : Exception
Checked exception thrown to indicate that a string could not be parsed as a URI reference.
Summary
Public constructors |
Constructs an instance from the given input string and reason.
|
Constructs an instance from the given input string, reason, and error index.
|
Public methods |
open Int |
Returns an index into the input string of the position at which the parse error occurred, or -1 if this position is not known.
|
open String! |
Returns the input string.
|
open String! |
Returns a string explaining why the input string could not be parsed.
|
Properties |
open String? |
Returns a string describing the parse error.
|
Public constructors
URISyntaxException
URISyntaxException(
input: String!,
reason: String!)
Constructs an instance from the given input string and reason. The resulting object will have an error index of -1
.
Parameters |
input |
String!: The input string |
reason |
String!: A string explaining why the input could not be parsed |
Exceptions |
java.lang.NullPointerException |
If either the input or reason strings are null |
URISyntaxException
URISyntaxException(
input: String!,
reason: String!,
index: Int)
Constructs an instance from the given input string, reason, and error 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 |
Exceptions |
java.lang.NullPointerException |
If either the input or reason strings are null |
java.lang.IllegalArgumentException |
If the error index is less than -1 |
Public methods
getIndex
open fun getIndex(): Int
Returns an index into the input string of the position at which the parse error occurred, or -1
if this position is not known.
Return |
Int |
The error index |
open fun getInput(): String!
Returns the input string.
Return |
String! |
The input string |
getReason
open fun getReason(): String!
Returns a string explaining why the input string could not be parsed.
Return |
String! |
The reason string |
Properties
message
open val message: String?
Returns a string describing the parse error. The resulting string consists of the reason string followed by a colon character (':'
), a space, and the input string. If the error index is defined then the string " at index "
followed by the index, in decimal, is inserted after the reason string and before the colon character.
Return |
String? |
A string describing the parse error |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# URISyntaxException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nURISyntaxException\n==================\n\n```\nopen class URISyntaxException : Exception\n```\n\n|---|---|---|----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||\n| | ↳ | [java.lang.Exception](../lang/Exception.html#) ||\n| | | ↳ | [java.net.URISyntaxException](#) |\n\nChecked exception thrown to indicate that a string could not be parsed as a URI reference.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [URISyntaxException](#URISyntaxException(kotlin.String,%20kotlin.String))`(`input:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `reason:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs an instance from the given input string and reason. |\n| [URISyntaxException](#URISyntaxException(kotlin.String,%20kotlin.String,%20kotlin.Int))`(`input:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `reason:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs an instance from the given input string, reason, and error index. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getIndex](#getIndex())`()` Returns an index into the input string of the position at which the parse error occurred, or `-1` if this position is not known. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getInput](#getInput())`()` Returns the input string. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getReason](#getReason())`()` Returns a string explaining why the input string could not be parsed. |\n\n| Properties ||\n|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [message](#message:kotlin.String) Returns a string describing the parse error. |\n\nPublic constructors\n-------------------\n\n### URISyntaxException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nURISyntaxException(\n input: String!, \n reason: String!)\n```\n\nConstructs an instance from the given input string and reason. The resulting object will have an error index of `-1`.\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `input` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The input string |\n| `reason` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: A string explaining why the input could not be parsed |\n\n| Exceptions ||\n|----------------------------------|--------------------------------------------------|\n| `java.lang.NullPointerException` | If either the input or reason strings are `null` |\n\n### URISyntaxException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nURISyntaxException(\n input: String!, \n reason: String!, \n index: Int)\n```\n\nConstructs an instance from the given input string, reason, and error index.\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `input` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The input string |\n| `reason` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: A string explaining why the input could not be parsed |\n| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The index at which the parse error occurred, or `-1` if the index is not known |\n\n| Exceptions ||\n|--------------------------------------|--------------------------------------------------|\n| `java.lang.NullPointerException` | If either the input or reason strings are `null` |\n| `java.lang.IllegalArgumentException` | If the error index is less than `-1` |\n\nPublic methods\n--------------\n\n### getIndex\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getIndex(): Int\n```\n\nReturns an index into the input string of the position at which the parse error occurred, or `-1` if this position is not known.\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The error index |\n\n### getInput\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getInput(): String!\n```\n\nReturns the input string.\n\n| Return ||\n|-----------------------------------------------------------------------------------|------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The input string |\n\n### getReason\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getReason(): String!\n```\n\nReturns a string explaining why the input string could not be parsed.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The reason string |\n\nProperties\n----------\n\n### message\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen val message: String?\n```\n\nReturns a string describing the parse error. The resulting string consists of the reason string followed by a colon character (`':'`), a space, and the input string. If the error index is defined then the string `\" at index \"` followed by the index, in decimal, is inserted after the reason string and before the colon character.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | A string describing the parse error |"]]