Stay organized with collections
Save and categorize content based on your preferences.
open class IllformedLocaleException : RuntimeException
Thrown by methods in ULocale
and ULocale.Builder
to indicate that an argument is not a well-formed BCP 47 tag.
Summary
Public constructors |
Constructs a new IllformedLocaleException with no detail message and -1 as the error index.
|
Constructs a new IllformedLocaleException with the given message and -1 as the error index.
|
Constructs a new IllformedLocaleException with the given message and the error index.
|
Public methods |
open Int |
Returns the index where the error was found.
|
Public constructors
IllformedLocaleException()
Constructs a new IllformedLocaleException
with no detail message and -1 as the error index.
IllformedLocaleException(message: String!)
Constructs a new IllformedLocaleException
with the given message and -1 as the error index.
Parameters |
message |
String!: the message |
IllformedLocaleException(
message: String!,
errorIndex: Int)
Constructs a new IllformedLocaleException
with the given message and the error index. The error index is the approximate offset from the start of the ill-formed value to the point where the parse first detected an error. A negative error index value indicates either the error index is not applicable or unknown.
Parameters |
message |
String!: the message |
errorIndex |
Int: the index |
Public methods
getErrorIndex
open fun getErrorIndex(): Int
Returns the index where the error was found. A negative value indicates either the error index is not applicable or unknown.
Return |
Int |
the error index |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# IllformedLocaleException\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nIllformedLocaleException\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/util/IllformedLocaleException \"View this page in Java\") \n\n```\nopen class IllformedLocaleException : RuntimeException\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](../../../java/lang/Exception.html#) |||\n| | | ↳ | [java.lang.RuntimeException](../../../java/lang/RuntimeException.html#) ||\n| | | | ↳ | [android.icu.util.IllformedLocaleException](#) |\n\nThrown by methods in [ULocale](/reference/kotlin/android/icu/util/ULocale) and [ULocale.Builder](/reference/kotlin/android/icu/util/ULocale.Builder) to indicate that an argument is not a well-formed BCP 47 tag.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [IllformedLocaleException](#IllformedLocaleException())`()` Constructs a new `IllformedLocaleException` with no detail message and -1 as the error index. |\n| [IllformedLocaleException](#IllformedLocaleException(kotlin.String))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs a new `IllformedLocaleException` with the given message and -1 as the error index. |\n| [IllformedLocaleException](#IllformedLocaleException(kotlin.String,%20kotlin.Int))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `errorIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a new `IllformedLocaleException` with the given message and the error index. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getErrorIndex](#getErrorIndex())`()` Returns the index where the error was found. |\n\nPublic constructors\n-------------------\n\n### IllformedLocaleException\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIllformedLocaleException()\n```\n\nConstructs a new `IllformedLocaleException` with no detail message and -1 as the error index. \n\n### IllformedLocaleException\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIllformedLocaleException(message: String!)\n```\n\nConstructs a new `IllformedLocaleException` with the given message and -1 as the error index.\n\n| Parameters ||\n|-----------|------------------------------------------------------------------------------------------------|\n| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the message |\n\n### IllformedLocaleException\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIllformedLocaleException(\n message: String!, \n errorIndex: Int)\n```\n\nConstructs a new `IllformedLocaleException` with the given message and the error index. The error index is the approximate offset from the start of the ill-formed value to the point where the parse first detected an error. A negative error index value indicates either the error index is not applicable or unknown.\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------|\n| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the message |\n| `errorIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the index |\n\nPublic methods\n--------------\n\n### getErrorIndex\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getErrorIndex(): Int\n```\n\nReturns the index where the error was found. A negative value indicates either the error index is not applicable or unknown.\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the error index |"]]