From db1d15a6213e2494b6bd9a7bdc3f78f15bfdcab1 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Thu, 5 Jan 2023 19:09:50 +0800 Subject: [PATCH] Update api-exception documentation --- docs-source/src/en/config/api-exception.md | 6 ++++-- docs-source/src/zh-cn/config/api-exception.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs-source/src/en/config/api-exception.md b/docs-source/src/en/config/api-exception.md index 6c3add51..db168e83 100644 --- a/docs-source/src/en/config/api-exception.md +++ b/docs-source/src/en/config/api-exception.md @@ -1947,7 +1947,9 @@ Target Class type cannot cast to **TYPE** **Abnormal** -Wrong type declared when converting a string class name to the target `Class` using the `toClass` method. +Wrong type declared when converting string class name to target `Class` using `Class.toClass`, `Class.toClassOrNull`, `GenericClass.argument` methods. + +The following uses the `Class.toClass` method as an example. > The following example @@ -1967,4 +1969,4 @@ val clazz1 = "android.app.Activity".toClass() val clazz2 = "android.app.Activity".toClass() ``` -Please ensure that the generic type declared after the `toClass` method is the specified target `Class` type, and you do not need to fill in the generic declaration if the target type is not sure. \ No newline at end of file +Please ensure that the generic type declared after executing the method is the specified target `Class` type, and you do not need to fill in the generic declaration if the target type is not sure. \ No newline at end of file diff --git a/docs-source/src/zh-cn/config/api-exception.md b/docs-source/src/zh-cn/config/api-exception.md index 09bef1b0..5bf38096 100644 --- a/docs-source/src/zh-cn/config/api-exception.md +++ b/docs-source/src/zh-cn/config/api-exception.md @@ -1876,7 +1876,9 @@ Target Class type cannot cast to **TYPE** **异常原因** -使用 `toClass` 方法将字符串类名转换为目标 `Class` 时声明了错误的类型。 +使用 `Class.toClass`、`Class.toClassOrNull`、`GenericClass.argument` 方法将字符串类名转换为目标 `Class` 时声明了错误的类型。 + +以下使用 `Class.toClass` 方法来进行示例。 > 示例如下 @@ -1896,4 +1898,4 @@ val clazz1 = "android.app.Activity".toClass() val clazz2 = "android.app.Activity".toClass() ``` -请确保 `toClass` 方法后声明的泛型是指定的目标 `Class` 类型,在不确定目标类型的情况下你可以不需要填写泛型声明。 \ No newline at end of file +请确保执行方法后声明的泛型是指定的目标 `Class` 类型,在不确定目标类型的情况下你可以不需要填写泛型声明。 \ No newline at end of file