Stay organized with collections
Save and categorize content based on your preferences.
AnnotationTypeMismatchException
open class AnnotationTypeMismatchException : RuntimeException
Thrown to indicate that a program has attempted to access an element of an annotation whose type has changed after the annotation was compiled (or serialized). This exception can be thrown by the .
Summary
Public constructors |
Constructs an AnnotationTypeMismatchException for the specified annotation type element and found data type.
|
Public methods |
open Method! |
Returns the Method object for the incorrectly typed element.
|
open String! |
Returns the type of data found in the incorrectly typed element.
|
Public constructors
AnnotationTypeMismatchException
AnnotationTypeMismatchException(
element: Method!,
foundType: String!)
Constructs an AnnotationTypeMismatchException for the specified annotation type element and found data type.
Parameters |
element |
Method!: the Method object for the annotation element, may be null |
foundType |
String!: the (erroneous) type of data found in the annotation. This string may, but is not required to, contain the value as well. The exact format of the string is unspecified, may be null . |
Public methods
element
open fun element(): Method!
Returns the Method
object for the incorrectly typed element. The value may be unavailable if this exception has been serialized and then read back in.
Return |
Method! |
the Method object for the incorrectly typed element, or null if unavailable |
foundType
open fun foundType(): String!
Returns the type of data found in the incorrectly typed element. The returned string may, but is not required to, contain the value as well. The exact format of the string is unspecified and the string may be null
.
Return |
String! |
the type of data found in the incorrectly typed element |
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,["# AnnotationTypeMismatchException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAnnotationTypeMismatchException\n===============================\n\n```\nopen class AnnotationTypeMismatchException : 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](../Exception.html#) |||\n| | | ↳ | [java.lang.RuntimeException](../RuntimeException.html#) ||\n| | | | ↳ | [java.lang.annotation.AnnotationTypeMismatchException](#) |\n\nThrown to indicate that a program has attempted to access an element of an annotation whose type has changed after the annotation was compiled (or serialized). This exception can be thrown by the .\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [AnnotationTypeMismatchException](#AnnotationTypeMismatchException(java.lang.reflect.Method,%20kotlin.String))`(`element:` `[Method](../reflect/Method.html#)!`, `foundType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs an AnnotationTypeMismatchException for the specified annotation type element and found data type. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|\n| open [Method](../reflect/Method.html#)! | [element](#element())`()` Returns the `Method` object for the incorrectly typed element. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [foundType](#foundType())`()` Returns the type of data found in the incorrectly typed element. |\n\nPublic constructors\n-------------------\n\n### AnnotationTypeMismatchException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nAnnotationTypeMismatchException(\n element: Method!, \n foundType: String!)\n```\n\nConstructs an AnnotationTypeMismatchException for the specified annotation type element and found data type.\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `element` | [Method](../reflect/Method.html#)!: the `Method` object for the annotation element, may be `null` |\n| `foundType` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the (erroneous) type of data found in the annotation. This string may, but is not required to, contain the value as well. The exact format of the string is unspecified, may be `null`. |\n\nPublic methods\n--------------\n\n### element\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun element(): Method!\n```\n\nReturns the `Method` object for the incorrectly typed element. The value may be unavailable if this exception has been serialized and then read back in.\n\n| Return ||\n|------------------------------------|---------------------------------------------------------------------------------|\n| [Method](../reflect/Method.html#)! | the `Method` object for the incorrectly typed element, or `null` if unavailable |\n\n### foundType\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun foundType(): String!\n```\n\nReturns the type of data found in the incorrectly typed element. The returned string may, but is not required to, contain the value as well. The exact format of the string is unspecified and the string may be `null`.\n\n| Return ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | the type of data found in the incorrectly typed element |"]]