diff --git a/docs-source/src/.vuepress/configs/template.ts b/docs-source/src/.vuepress/configs/template.ts index 75b3c0a..a5045bd 100644 --- a/docs-source/src/.vuepress/configs/template.ts +++ b/docs-source/src/.vuepress/configs/template.ts @@ -52,7 +52,7 @@ const navigationLinks = { export const configs = { dev: { - dest: '../docs/', + dest: 'dist', port: 9000 }, website: { diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 3ff91da..0000000 --- a/docs/404.html +++ /dev/null @@ -1,33 +0,0 @@ - - -
- - - - - -abstract class BaseFinder
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F
Class
\u4E0EMember
\u67E5\u627E\u7C7B\u529F\u80FD\u7684\u57FA\u672C\u7C7B\u5B9E\u73B0\u3002
inner class IndexTypeCondition internal constructor(private val type: IndexConfigType)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5B57\u8282\u7801\u4E0B\u6807\u7B5B\u9009\u5B9E\u73B0\u7C7B\u3002
fun index(num: Int)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u4E0B\u6807\u3002
\u82E5 index
\u5C0F\u4E8E\u96F6\u5219\u4E3A\u5012\u5E8F\uFF0C\u6B64\u65F6\u53EF\u4EE5\u4F7F\u7528 IndexTypeConditionSort.reverse
\u65B9\u6CD5\u5B9E\u73B0\u3002
\u53EF\u4F7F\u7528 IndexTypeConditionSort.first
\u548C IndexTypeConditionSort.last
\u8BBE\u7F6E\u9996\u4F4D\u548C\u672B\u4F4D\u7B5B\u9009\u6761\u4EF6\u3002
fun index(): IndexTypeConditionSort
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u4E0B\u6807\u3002
inner class IndexTypeConditionSort internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5B57\u8282\u7801\u4E0B\u6807\u6392\u5E8F\u5B9E\u73B0\u7C7B\u3002
fun first()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u6EE1\u8DB3\u6761\u4EF6\u7684\u7B2C\u4E00\u4E2A\u3002
fun last()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u6EE1\u8DB3\u6761\u4EF6\u7684\u6700\u540E\u4E00\u4E2A\u3002
fun reverse(num: Int)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,50),l=[p];function c(t,r){return n(),o("div",null,l)}const i=s(a,[["render",c],["__file","BaseFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/BaseFinder.html.d7748acf.js b/docs/assets/BaseFinder.html.d7748acf.js deleted file mode 100644 index 44a21ec..0000000 --- a/docs/assets/BaseFinder.html.d7748acf.js +++ /dev/null @@ -1,9 +0,0 @@ -import{_ as s,o as e,c as n,a as o}from"./app.2add9aa5.js";const a={},l=o(`\u8BBE\u7F6E\u5012\u5E8F\u4E0B\u6807\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
abstract class BaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F
Class
\u4E0EMember
\u67E5\u627E\u7C7B\u529F\u80FD\u7684\u57FA\u672C\u7C7B\u5B9E\u73B0\u3002
inner class IndexTypeCondition internal constructor(private val type: IndexConfigType)
-
Change Records
v1.0.0
first
Function Illustrate
\u5B57\u8282\u7801\u4E0B\u6807\u7B5B\u9009\u5B9E\u73B0\u7C7B\u3002
fun index(num: Int)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u4E0B\u6807\u3002
\u82E5 index
\u5C0F\u4E8E\u96F6\u5219\u4E3A\u5012\u5E8F\uFF0C\u6B64\u65F6\u53EF\u4EE5\u4F7F\u7528 IndexTypeConditionSort.reverse
\u65B9\u6CD5\u5B9E\u73B0\u3002
\u53EF\u4F7F\u7528 IndexTypeConditionSort.first
\u548C IndexTypeConditionSort.last
\u8BBE\u7F6E\u9996\u4F4D\u548C\u672B\u4F4D\u7B5B\u9009\u6761\u4EF6\u3002
fun index(): IndexTypeConditionSort
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u4E0B\u6807\u3002
inner class IndexTypeConditionSort internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
\u5B57\u8282\u7801\u4E0B\u6807\u6392\u5E8F\u5B9E\u73B0\u7C7B\u3002
fun first()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u6EE1\u8DB3\u6761\u4EF6\u7684\u7B2C\u4E00\u4E2A\u3002
fun last()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u6EE1\u8DB3\u6761\u4EF6\u7684\u6700\u540E\u4E00\u4E2A\u3002
fun reverse(num: Int)
-
Change Records
v1.0.0
first
Function Illustrate
`,51),t=[l];function p(c,r){return e(),n("div",null,t)}const i=s(a,[["render",p],["__file","BaseFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/BaseFinder.html.fb47fda7.js b/docs/assets/BaseFinder.html.fb47fda7.js deleted file mode 100644 index 697f03b..0000000 --- a/docs/assets/BaseFinder.html.fb47fda7.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-740d06da","path":"/en/api/public/com/highcapable/yukireflection/finder/base/BaseFinder.html","title":"BaseFinder - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"BaseFinder.IndexTypeCondition - class","slug":"basefinder-indextypecondition-class","link":"#basefinder-indextypecondition-class","children":[{"level":3,"title":"index - method","slug":"index-method","link":"#index-method","children":[]},{"level":3,"title":"index - method","slug":"index-method-1","link":"#index-method-1","children":[]},{"level":3,"title":"IndexTypeConditionSort - class","slug":"indextypeconditionsort-class","link":"#indextypeconditionsort-class","children":[]}]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/base/BaseFinder.md"}');export{e as data}; diff --git a/docs/assets/ComponentTypeFactory.html.01fa4f98.js b/docs/assets/ComponentTypeFactory.html.01fa4f98.js deleted file mode 100644 index 9b6d488..0000000 --- a/docs/assets/ComponentTypeFactory.html.01fa4f98.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as n,r as c,o as a,c as r,b as o,d as s,a as p,e}from"./app.2add9aa5.js";const d={},i=p('\u8BBE\u7F6E\u5012\u5E8F\u4E0B\u6807\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
',5),l=e("\u8BE6\u60C5\u53EF "),_={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ComponentTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},h=e("\u70B9\u51FB\u8FD9\u91CC"),m=e(" \u8FDB\u884C\u67E5\u770B\u3002");function f(y,k){const t=c("ExternalLinkIcon");return a(),r("div",null,[i,o("p",null,[l,o("a",_,[h,s(t)]),m])])}const b=n(d,[["render",f],["__file","ComponentTypeFactory.html.vue"]]);export{b as default}; diff --git a/docs/assets/ComponentTypeFactory.html.86fc30e1.js b/docs/assets/ComponentTypeFactory.html.86fc30e1.js deleted file mode 100644 index dd55989..0000000 --- a/docs/assets/ComponentTypeFactory.html.86fc30e1.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-6c58c435","path":"/zh-cn/api/public/com/highcapable/yukireflection/type/android/ComponentTypeFactory.html","title":"ComponentTypeFactory - kt","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/type/android/ComponentTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/ComponentTypeFactory.html.9f6eb483.js b/docs/assets/ComponentTypeFactory.html.9f6eb483.js deleted file mode 100644 index 5c3b038..0000000 --- a/docs/assets/ComponentTypeFactory.html.9f6eb483.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as n,r as a,o as c,c as r,b as o,d as s,a as i,e}from"./app.2add9aa5.js";const p={},l=i('\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Android
\u76F8\u5173\u7EC4\u4EF6\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
',6),d=e("\u8BE6\u60C5\u53EF "),h={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ComponentTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},_=e("\u70B9\u51FB\u8FD9\u91CC"),m=e(" \u8FDB\u884C\u67E5\u770B\u3002");function u(f,y){const t=a("ExternalLinkIcon");return c(),r("div",null,[l,o("p",null,[d,o("a",h,[_,s(t)]),m])])}const k=n(p,[["render",u],["__file","ComponentTypeFactory.html.vue"]]);export{k as default}; diff --git a/docs/assets/ComponentTypeFactory.html.f94d8b50.js b/docs/assets/ComponentTypeFactory.html.f94d8b50.js deleted file mode 100644 index 6b199ed..0000000 --- a/docs/assets/ComponentTypeFactory.html.f94d8b50.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-7f47f9f8","path":"/en/api/public/com/highcapable/yukireflection/type/android/ComponentTypeFactory.html","title":"ComponentTypeFactory - kt","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":3}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/type/android/ComponentTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/ConstructorFinder.html.372473c1.js b/docs/assets/ConstructorFinder.html.372473c1.js deleted file mode 100644 index 7c9030c..0000000 --- a/docs/assets/ConstructorFinder.html.372473c1.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-722cd474","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/members/ConstructorFinder.html","title":"ConstructorFinder - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"paramCount - field","slug":"paramcount-field","link":"#paramcount-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"emptyParam - method","slug":"emptyparam-method","link":"#emptyparam-method","children":[]},{"level":2,"title":"param - method","slug":"param-method","link":"#param-method","children":[]},{"level":2,"title":"param - method","slug":"param-method-1","link":"#param-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method","link":"#paramcount-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-1","link":"#paramcount-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-2","link":"#paramcount-method-2","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"RemedyPlan - class","slug":"remedyplan-class","link":"#remedyplan-class","children":[{"level":3,"title":"constructor - method","slug":"constructor-method","link":"#constructor-method","children":[]},{"level":3,"title":"Result - class","slug":"result-class","link":"#result-class","children":[]}]},{"level":2,"title":"Result - class","slug":"result-class-1","link":"#result-class-1","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"give - method","slug":"give-method","link":"#give-method","children":[]},{"level":3,"title":"giveAll - method","slug":"giveall-method","link":"#giveall-method","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"remedys - method","slug":"remedys-method","link":"#remedys-method","children":[]},{"level":3,"title":"onNoSuchConstructor - method","slug":"onnosuchconstructor-method","link":"#onnosuchconstructor-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]},{"level":3,"title":"Instance - class","slug":"instance-class","link":"#instance-class","children":[]}]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/members/ConstructorFinder.md"}');export{e as data}; diff --git a/docs/assets/ConstructorFinder.html.6608ff36.js b/docs/assets/ConstructorFinder.html.6608ff36.js deleted file mode 100644 index beccfb3..0000000 --- a/docs/assets/ConstructorFinder.html.6608ff36.js +++ /dev/null @@ -1,66 +0,0 @@ -import{_ as s,o as n,c as o,a}from"./app.2add9aa5.js";const e={},l=a(`\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Android
\u76F8\u5173\u7EC4\u4EF6\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
class ConstructorFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Constructor
\u67E5\u627E\u7C7B\u3002
\u53EF\u901A\u8FC7\u6307\u5B9A\u7C7B\u578B\u67E5\u627E\u6307\u5B9A Constructor
\u6216\u4E00\u7EC4 Constructor
\u3002
var paramCount: Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\uFF0C\u9ED8\u8BA4\u6A21\u7CCA\u67E5\u627E\u5E76\u53D6\u7B2C\u4E00\u4E2A\u5339\u914D\u7684 Constructor
\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun emptyParam(): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Constructor
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType \u6765\u66FF\u4EE3\u5B83\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(num: Int): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(numRange: IntRange): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun superClass(isOnlySuperClass: Boolean)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5728
classSet
\u7684\u6240\u6709\u7236\u7C7B\u4E2D\u67E5\u627E\u5F53\u524DConstructor
\u3002
\u6CE8\u610F
\u82E5\u5F53\u524D classSet \u7684\u7236\u7C7B\u8F83\u591A\u53EF\u80FD\u4F1A\u8017\u65F6\uFF0CAPI \u4F1A\u81EA\u52A8\u5FAA\u73AF\u5230\u7236\u7C7B\u7EE7\u627F\u662F Any \u524D\u7684\u6700\u540E\u4E00\u4E2A\u7C7B\u3002
inner class RemedyPlan internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Constructor
\u91CD\u67E5\u627E\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u7D2F\u8BA1\u5931\u8D25\u6B21\u6570\u76F4\u5230\u67E5\u627E\u6210\u529F\u3002
inline fun constructor(initiate: ConstructorConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u9700\u8981\u91CD\u65B0\u67E5\u627E\u7684
Constructor
\u3002
\u4F60\u53EF\u4EE5\u6DFB\u52A0\u591A\u4E2A\u5907\u9009 Constructor
\uFF0C\u76F4\u5230\u6210\u529F\u4E3A\u6B62\uFF0C\u82E5\u6700\u540E\u4F9D\u7136\u5931\u8D25\uFF0C\u5C06\u505C\u6B62\u67E5\u627E\u5E76\u8F93\u51FA\u9519\u8BEF\u65E5\u5FD7\u3002
inner class Result internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
RemedyPlan
\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u5728
RemedyPlan
\u4E2D\u627E\u5230\u7ED3\u679C\u65F6\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u65B9\u4FBF\u5730\u5BF9\u91CD\u67E5\u627E\u7684 Constructor
\u5B9E\u73B0 onFind
\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Constructor
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528 lambda
\u5F62\u5F0F\u521B\u5EFA Result
\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.result {
- get().call()
- all()
- remedys {}
- onNoSuchConstructor {}
-}
-
fun get(): Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
\u82E5\u6709\u591A\u4E2A Constructor
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u8BF7\u4F7F\u7528 wait \u56DE\u8C03\u7ED3\u679C\u65B9\u6CD5\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u901A\u8FC7\u83B7\u5F97\u65B9\u6CD5\u6240\u5728\u5B9E\u4F8B\u6765\u6267\u884C\u6784\u9020\u65B9\u6CD5\u521B\u5EFA\u65B0\u7684\u5B9E\u4F8B\u5BF9\u8C61\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.get().call()
-
\u4F60\u53EF\u4EE5 cast
\u6784\u9020\u65B9\u6CD5\u4E3A\u6307\u5B9A\u7C7B\u578B\u7684\u5B9E\u4F8B\u5BF9\u8C61\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.get().newInstance<TestClass>()
-
\u7279\u522B\u6CE8\u610F
\u82E5\u6784\u9020\u65B9\u6CD5\u542B\u6709\u53C2\u6570\u5219\u540E\u65B9\u53C2\u6570\u5FC5\u586B\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.get().newInstance<TestClass>("param1", "param2")
-
fun all(): ArrayList<Instance>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Constructor
\u5B9E\u4F8B\u7ED3\u679C\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u901A\u8FC7\u6B64\u65B9\u6CD5\u6765\u83B7\u5F97\u5F53\u524D\u6761\u4EF6\u7ED3\u679C\u4E2D\u5339\u914D\u7684\u5168\u90E8 Constructor
\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.all().forEach { instance ->
- instance.call(...)
-}
-
fun give(): Constructor<*>?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Constructor
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Constructor
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
fun giveAll(): HashSet<Constructor<*>>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Constructor
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Constructor
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
fun wait(initiate: Instance.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u82E5\u6709\u591A\u4E2A Constructor
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Constructor
\u5B9E\u4F8B\u7ED3\u679C\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA
Constructor
\u91CD\u67E5\u627E\u529F\u80FD\u3002
\u529F\u80FD\u793A\u4F8B
\u5F53\u4F60\u9047\u5230\u4E00\u79CD Constructor
\u53EF\u80FD\u5B58\u5728\u4E0D\u540C\u5F62\u5F0F\u7684\u5B58\u5728\u65F6\uFF0C\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u5B83\uFF0C\u800C\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528 onNoSuchConstructor
\u6355\u83B7\u5F02\u5E38\u4E8C\u6B21\u67E5\u627E Constructor
\u3002
\u82E5\u7B2C\u4E00\u6B21\u67E5\u627E\u5931\u8D25\u4E86\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u8FD9\u91CC\u7EE7\u7EED\u6DFB\u52A0\u6B64\u65B9\u6CD5\u4F53\u76F4\u5230\u6210\u529F\u4E3A\u6B62\u3002
\u793A\u4F8B\u5982\u4E0B
constructor {
- // Your code here.
-}.remedys {
- constructor {
- // Your code here.
- }
- constructor {
- // Your code here.
- }
-}
-
inline fun onNoSuchConstructor(result: (Throwable) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u76D1\u542C\u627E\u4E0D\u5230
Constructor
\u65F6\u3002
\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u6B21\u7684\u9519\u8BEF\u4FE1\u606F\uFF0C\u4E0D\u4F1A\u8FD4\u56DE RemedyPlan
\u7684\u9519\u8BEF\u4FE1\u606F\u3002
fun ignored(): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
\u6CE8\u610F
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoSuchConstructor \u65B9\u6CD5\u3002
inner class Instance internal constructor(private val constructor: Constructor<*>?)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
fun call(vararg args: Any?): Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Constructor
\u521B\u5EFA\u76EE\u6807\u5B9E\u4F8B\uFF0C\u4E0D\u6307\u5B9A\u76EE\u6807\u5B9E\u4F8B\u7C7B\u578B\u3002
fun <T> newInstance(vararg args: Any?): T?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,226),p=[l];function c(t,r){return n(),o("div",null,p)}const i=s(e,[["render",c],["__file","ConstructorFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/ConstructorFinder.html.91c23734.js b/docs/assets/ConstructorFinder.html.91c23734.js deleted file mode 100644 index e1f7c1e..0000000 --- a/docs/assets/ConstructorFinder.html.91c23734.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-b3220076","path":"/en/api/public/com/highcapable/yukireflection/finder/members/ConstructorFinder.html","title":"ConstructorFinder - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"paramCount - field","slug":"paramcount-field","link":"#paramcount-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"emptyParam - method","slug":"emptyparam-method","link":"#emptyparam-method","children":[]},{"level":2,"title":"param - method","slug":"param-method","link":"#param-method","children":[]},{"level":2,"title":"param - method","slug":"param-method-1","link":"#param-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method","link":"#paramcount-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-1","link":"#paramcount-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-2","link":"#paramcount-method-2","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"RemedyPlan - class","slug":"remedyplan-class","link":"#remedyplan-class","children":[{"level":3,"title":"constructor - method","slug":"constructor-method","link":"#constructor-method","children":[]},{"level":3,"title":"Result - class","slug":"result-class","link":"#result-class","children":[]}]},{"level":2,"title":"Result - class","slug":"result-class-1","link":"#result-class-1","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"give - method","slug":"give-method","link":"#give-method","children":[]},{"level":3,"title":"giveAll - method","slug":"giveall-method","link":"#giveall-method","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"remedys - method","slug":"remedys-method","link":"#remedys-method","children":[]},{"level":3,"title":"onNoSuchConstructor - method","slug":"onnosuchconstructor-method","link":"#onnosuchconstructor-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]},{"level":3,"title":"Instance - class","slug":"instance-class","link":"#instance-class","children":[]}]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/members/ConstructorFinder.md"}');export{e as data}; diff --git a/docs/assets/ConstructorFinder.html.a40584a1.js b/docs/assets/ConstructorFinder.html.a40584a1.js deleted file mode 100644 index 38319b1..0000000 --- a/docs/assets/ConstructorFinder.html.a40584a1.js +++ /dev/null @@ -1,66 +0,0 @@ -import{_ as s,o as n,c as o,a}from"./app.2add9aa5.js";const e={},l=a(`\u6267\u884C
Constructor
\u521B\u5EFA\u76EE\u6807\u5B9E\u4F8B \uFF0C\u6307\u5B9AT
\u76EE\u6807\u5B9E\u4F8B\u7C7B\u578B\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ConstructorFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
\u67E5\u627E\u7C7B\u3002
\u53EF\u901A\u8FC7\u6307\u5B9A\u7C7B\u578B\u67E5\u627E\u6307\u5B9A Constructor
\u6216\u4E00\u7EC4 Constructor
\u3002
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\uFF0C\u9ED8\u8BA4\u6A21\u7CCA\u67E5\u627E\u5E76\u53D6\u7B2C\u4E00\u4E2A\u5339\u914D\u7684 Constructor
\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun emptyParam(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Constructor
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType \u6765\u66FF\u4EE3\u5B83\u3002
Pay Attention
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u6761\u4EF6\u3002
Pay Attention
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(num: Int): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(numRange: IntRange): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun superClass(isOnlySuperClass: Boolean)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5728
classSet
\u7684\u6240\u6709\u7236\u7C7B\u4E2D\u67E5\u627E\u5F53\u524DConstructor
\u3002
Notice
\u82E5\u5F53\u524D classSet \u7684\u7236\u7C7B\u8F83\u591A\u53EF\u80FD\u4F1A\u8017\u65F6\uFF0CAPI \u4F1A\u81EA\u52A8\u5FAA\u73AF\u5230\u7236\u7C7B\u7EE7\u627F\u662F Any \u524D\u7684\u6700\u540E\u4E00\u4E2A\u7C7B\u3002
inner class RemedyPlan internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
\u91CD\u67E5\u627E\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u7D2F\u8BA1\u5931\u8D25\u6B21\u6570\u76F4\u5230\u67E5\u627E\u6210\u529F\u3002
inline fun constructor(initiate: ConstructorConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u9700\u8981\u91CD\u65B0\u67E5\u627E\u7684
Constructor
\u3002
\u4F60\u53EF\u4EE5\u6DFB\u52A0\u591A\u4E2A\u5907\u9009 Constructor
\uFF0C\u76F4\u5230\u6210\u529F\u4E3A\u6B62\uFF0C\u82E5\u6700\u540E\u4F9D\u7136\u5931\u8D25\uFF0C\u5C06\u505C\u6B62\u67E5\u627E\u5E76\u8F93\u51FA\u9519\u8BEF\u65E5\u5FD7\u3002
inner class Result internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
RemedyPlan
\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u5728
RemedyPlan
\u4E2D\u627E\u5230\u7ED3\u679C\u65F6\u3002
Function Example
\u4F60\u53EF\u4EE5\u65B9\u4FBF\u5730\u5BF9\u91CD\u67E5\u627E\u7684 Constructor
\u5B9E\u73B0 onFind
\u65B9\u6CD5\u3002
The following example
constructor {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528 lambda
\u5F62\u5F0F\u521B\u5EFA Result
\u7C7B\u3002
The following example
constructor {
- // Your code here.
-}.result {
- get().call()
- all()
- remedys {}
- onNoSuchConstructor {}
-}
-
fun get(): Instance
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
\u82E5\u6709\u591A\u4E2A Constructor
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u8BF7\u4F7F\u7528 wait \u56DE\u8C03\u7ED3\u679C\u65B9\u6CD5\u3002
Function Example
\u4F60\u53EF\u4EE5\u901A\u8FC7\u83B7\u5F97\u65B9\u6CD5\u6240\u5728\u5B9E\u4F8B\u6765\u6267\u884C\u6784\u9020\u65B9\u6CD5\u521B\u5EFA\u65B0\u7684\u5B9E\u4F8B\u5BF9\u8C61\u3002
The following example
constructor {
- // Your code here.
-}.get().call()
-
\u4F60\u53EF\u4EE5 cast
\u6784\u9020\u65B9\u6CD5\u4E3A\u6307\u5B9A\u7C7B\u578B\u7684\u5B9E\u4F8B\u5BF9\u8C61\u3002
The following example
constructor {
- // Your code here.
-}.get().newInstance<TestClass>()
-
Pay Attention
\u82E5\u6784\u9020\u65B9\u6CD5\u542B\u6709\u53C2\u6570\u5219\u540E\u65B9\u53C2\u6570\u5FC5\u586B\u3002
The following example
constructor {
- // Your code here.
-}.get().newInstance<TestClass>("param1", "param2")
-
fun all(): ArrayList<Instance>
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Constructor
\u5B9E\u4F8B\u7ED3\u679C\u3002
Function Example
\u4F60\u53EF\u4EE5\u901A\u8FC7\u6B64\u65B9\u6CD5\u6765\u83B7\u5F97\u5F53\u524D\u6761\u4EF6\u7ED3\u679C\u4E2D\u5339\u914D\u7684\u5168\u90E8 Constructor
\u3002
The following example
constructor {
- // Your code here.
-}.all().forEach { instance ->
- instance.call(...)
-}
-
fun give(): Constructor<*>?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Constructor
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Constructor
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
fun giveAll(): HashSet<Constructor<*>>
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Constructor
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Constructor
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
fun wait(initiate: Instance.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u82E5\u6709\u591A\u4E2A Constructor
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Constructor
\u5B9E\u4F8B\u7ED3\u679C\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA
Constructor
\u91CD\u67E5\u627E\u529F\u80FD\u3002
Function Example
\u5F53\u4F60\u9047\u5230\u4E00\u79CD Constructor
\u53EF\u80FD\u5B58\u5728\u4E0D\u540C\u5F62\u5F0F\u7684\u5B58\u5728\u65F6\uFF0C\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u5B83\uFF0C\u800C\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528 onNoSuchConstructor
\u6355\u83B7\u5F02\u5E38\u4E8C\u6B21\u67E5\u627E Constructor
\u3002
\u82E5\u7B2C\u4E00\u6B21\u67E5\u627E\u5931\u8D25\u4E86\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u8FD9\u91CC\u7EE7\u7EED\u6DFB\u52A0\u6B64\u65B9\u6CD5\u4F53\u76F4\u5230\u6210\u529F\u4E3A\u6B62\u3002
The following example
constructor {
- // Your code here.
-}.remedys {
- constructor {
- // Your code here.
- }
- constructor {
- // Your code here.
- }
-}
-
inline fun onNoSuchConstructor(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u76D1\u542C\u627E\u4E0D\u5230
Constructor
\u65F6\u3002
\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u6B21\u7684\u9519\u8BEF\u4FE1\u606F\uFF0C\u4E0D\u4F1A\u8FD4\u56DE RemedyPlan
\u7684\u9519\u8BEF\u4FE1\u606F\u3002
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
Notice
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoSuchConstructor \u65B9\u6CD5\u3002
inner class Instance internal constructor(private val constructor: Constructor<*>?)
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
fun call(vararg args: Any?): Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Constructor
\u521B\u5EFA\u76EE\u6807\u5B9E\u4F8B\uFF0C\u4E0D\u6307\u5B9A\u76EE\u6807\u5B9E\u4F8B\u7C7B\u578B\u3002
fun <T> newInstance(vararg args: Any?): T?
-
Change Records
v1.0.0
first
Function Illustrate
`,227),p=[l];function t(c,r){return n(),o("div",null,p)}const i=s(e,[["render",t],["__file","ConstructorFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/ConstructorRules.html.73382011.js b/docs/assets/ConstructorRules.html.73382011.js deleted file mode 100644 index b1b7ee9..0000000 --- a/docs/assets/ConstructorRules.html.73382011.js +++ /dev/null @@ -1,9 +0,0 @@ -import{_ as s,o,c as a,a as n}from"./app.2add9aa5.js";const e={},p=n(`\u6267\u884C
Constructor
\u521B\u5EFA\u76EE\u6807\u5B9E\u4F8B \uFF0C\u6307\u5B9AT
\u76EE\u6807\u5B9E\u4F8B\u7C7B\u578B\u3002
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Constructor
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
var paramCount: Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
fun modifiers(conditions: ModifierConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun emptyParam()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Constructor
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType
\u6765\u66FF\u4EE3\u5B83\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun param(conditions: ObjectsConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun paramCount(numRange: IntRange)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
fun paramCount(conditions: CountConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun emptyParam()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Constructor
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType
\u6765\u66FF\u4EE3\u5B83\u3002
Pay Attention
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun param(conditions: ObjectsConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u6761\u4EF6\u3002
Pay Attention
\u65E0\u53C2 Constructor \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Constructor \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun paramCount(numRange: IntRange)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
fun paramCount(conditions: CountConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Constructor
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class CountRules private constructor()
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A\u6A21\u7CCA
Class
\u3001Member
\u6570\u7EC4 (\u4E0B\u6807) \u4E2A\u6570\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
fun Int.isZero(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u4E3A 0\u3002
fun Int.moreThan(count: Int): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5927\u4E8E
count
\u3002
fun Int.lessThan(count: Int): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5C0F\u4E8E
count
\u3002
fun Int.inInterval(countRange: IntRange): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
`,32),l=[t];function c(p,r){return n(),o("div",null,l)}const d=s(a,[["render",c],["__file","CountRules.html.vue"]]);export{d as default}; diff --git a/docs/assets/CountRules.html.a8c6e084.js b/docs/assets/CountRules.html.a8c6e084.js deleted file mode 100644 index 12d9fb1..0000000 --- a/docs/assets/CountRules.html.a8c6e084.js +++ /dev/null @@ -1,6 +0,0 @@ -import{_ as s,o,c as n,a as e}from"./app.2add9aa5.js";const a={},l=e(`\u5728
countRange
\u533A\u95F4 A \u2264 this \u2264 B\u3002
class CountRules private constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A\u6A21\u7CCA
Class
\u3001Member
\u6570\u7EC4 (\u4E0B\u6807) \u4E2A\u6570\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
fun Int.isZero(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u4E3A 0\u3002
fun Int.moreThan(count: Int): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5927\u4E8E
count
\u3002
fun Int.lessThan(count: Int): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5C0F\u4E8E
count
\u3002
fun Int.inInterval(countRange: IntRange): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,31),t=[l];function p(c,r){return o(),n("div",null,t)}const i=s(a,[["render",p],["__file","CountRules.html.vue"]]);export{i as default}; diff --git a/docs/assets/CountRules.html.aa55eac0.js b/docs/assets/CountRules.html.aa55eac0.js deleted file mode 100644 index ba0837a..0000000 --- a/docs/assets/CountRules.html.aa55eac0.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-6f96d791","path":"/en/api/public/com/highcapable/yukireflection/finder/base/rules/CountRules.html","title":"CountRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"Int.isZero - i-ext-method","slug":"int-iszero-i-ext-method","link":"#int-iszero-i-ext-method","children":[]},{"level":2,"title":"Int.moreThan - i-ext-method","slug":"int-morethan-i-ext-method","link":"#int-morethan-i-ext-method","children":[]},{"level":2,"title":"Int.lessThan - i-ext-method","slug":"int-lessthan-i-ext-method","link":"#int-lessthan-i-ext-method","children":[]},{"level":2,"title":"Int.inInterval - i-ext-method","slug":"int-ininterval-i-ext-method","link":"#int-ininterval-i-ext-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/base/rules/CountRules.md"}');export{e as data}; diff --git a/docs/assets/CurrentClass.html.0cbf1174.js b/docs/assets/CurrentClass.html.0cbf1174.js deleted file mode 100644 index 234201b..0000000 --- a/docs/assets/CurrentClass.html.0cbf1174.js +++ /dev/null @@ -1,16 +0,0 @@ -import{_ as s,o as n,c as a,a as e}from"./app.2add9aa5.js";const o={},l=e(`\u5728
countRange
\u533A\u95F4 A \u2264 this \u2264 B\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
val name: String
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
classSet
\u7684Class.getName
\u3002
val simpleName: String
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
classSet
\u7684Class.getSimpleName
\u3002
fun generic(): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
fun superClass(): SuperClass
-
Change Records
v1.0.0
first
Function Illustrate
\u8C03\u7528\u7236\u7C7B\u5B9E\u4F8B\u3002
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
\u8C03\u7528\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u53D8\u91CF\u3002
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
\u8C03\u7528\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u65B9\u6CD5\u3002
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D\u7C7B\u7684\u7236\u7C7B\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
val name: String
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
classSet
\u4E2D\u7236\u7C7B\u7684Class.getName
\u3002
val simpleName: String
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
classSet
\u4E2D\u7236\u7C7B\u7684Class.getSimpleName
\u3002
fun generic(): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7236\u7C7B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7236\u7C7B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
\u8C03\u7528\u7236\u7C7B\u5B9E\u4F8B\u4E2D\u7684\u53D8\u91CF\u3002
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
`,95),p=[l];function c(t,r){return n(),a("div",null,p)}const i=s(o,[["render",c],["__file","CurrentClass.html.vue"]]);export{i as default}; diff --git a/docs/assets/CurrentClass.html.1f324cf5.js b/docs/assets/CurrentClass.html.1f324cf5.js deleted file mode 100644 index 5ab1c9e..0000000 --- a/docs/assets/CurrentClass.html.1f324cf5.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-406687ff","path":"/zh-cn/api/public/com/highcapable/yukireflection/bean/CurrentClass.html","title":"CurrentClass - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"simpleName - field","slug":"simplename-field","link":"#simplename-field","children":[]},{"level":2,"title":"generic - method","slug":"generic-method","link":"#generic-method","children":[]},{"level":2,"title":"generic - method","slug":"generic-method-1","link":"#generic-method-1","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"field - method","slug":"field-method","link":"#field-method","children":[]},{"level":2,"title":"method - method","slug":"method-method","link":"#method-method","children":[]},{"level":2,"title":"SuperClass - class","slug":"superclass-class","link":"#superclass-class","children":[{"level":3,"title":"name - field","slug":"name-field-1","link":"#name-field-1","children":[]},{"level":3,"title":"simpleName - field","slug":"simplename-field-1","link":"#simplename-field-1","children":[]},{"level":3,"title":"generic - method","slug":"generic-method-2","link":"#generic-method-2","children":[]},{"level":3,"title":"generic - method","slug":"generic-method-3","link":"#generic-method-3","children":[]},{"level":3,"title":"field - method","slug":"field-method-1","link":"#field-method-1","children":[]},{"level":3,"title":"method - method","slug":"method-method-1","link":"#method-method-1","children":[]}]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/bean/CurrentClass.md"}');export{e as data}; diff --git a/docs/assets/CurrentClass.html.205e8299.js b/docs/assets/CurrentClass.html.205e8299.js deleted file mode 100644 index 8536f0e..0000000 --- a/docs/assets/CurrentClass.html.205e8299.js +++ /dev/null @@ -1,16 +0,0 @@ -import{_ as s,o as a,c as n,a as o}from"./app.2add9aa5.js";const e={},l=o(`\u8C03\u7528\u7236\u7C7B\u5B9E\u4F8B\u4E2D\u7684\u65B9\u6CD5\u3002
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
val name: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
classSet
\u7684Class.getName
\u3002
val simpleName: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
classSet
\u7684Class.getSimpleName
\u3002
fun generic(): GenericClass?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
fun superClass(): SuperClass
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8C03\u7528\u7236\u7C7B\u5B9E\u4F8B\u3002
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8C03\u7528\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u53D8\u91CF\u3002
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8C03\u7528\u5F53\u524D\u5B9E\u4F8B\u4E2D\u7684\u65B9\u6CD5\u3002
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D\u7C7B\u7684\u7236\u7C7B\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
val name: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
classSet
\u4E2D\u7236\u7C7B\u7684Class.getName
\u3002
val simpleName: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
classSet
\u4E2D\u7236\u7C7B\u7684Class.getSimpleName
\u3002
fun generic(): GenericClass?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7236\u7C7B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7236\u7C7B\u4E2D\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8C03\u7528\u7236\u7C7B\u5B9E\u4F8B\u4E2D\u7684\u53D8\u91CF\u3002
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,94),p=[l];function c(t,r){return a(),n("div",null,p)}const i=s(e,[["render",c],["__file","CurrentClass.html.vue"]]);export{i as default}; diff --git a/docs/assets/CurrentClass.html.4fb3c7c5.js b/docs/assets/CurrentClass.html.4fb3c7c5.js deleted file mode 100644 index baaef54..0000000 --- a/docs/assets/CurrentClass.html.4fb3c7c5.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-47f17664","path":"/en/api/public/com/highcapable/yukireflection/bean/CurrentClass.html","title":"CurrentClass - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"simpleName - field","slug":"simplename-field","link":"#simplename-field","children":[]},{"level":2,"title":"generic - method","slug":"generic-method","link":"#generic-method","children":[]},{"level":2,"title":"generic - method","slug":"generic-method-1","link":"#generic-method-1","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"field - method","slug":"field-method","link":"#field-method","children":[]},{"level":2,"title":"method - method","slug":"method-method","link":"#method-method","children":[]},{"level":2,"title":"SuperClass - class","slug":"superclass-class","link":"#superclass-class","children":[{"level":3,"title":"name - field","slug":"name-field-1","link":"#name-field-1","children":[]},{"level":3,"title":"simpleName - field","slug":"simplename-field-1","link":"#simplename-field-1","children":[]},{"level":3,"title":"generic - method","slug":"generic-method-2","link":"#generic-method-2","children":[]},{"level":3,"title":"generic - method","slug":"generic-method-3","link":"#generic-method-3","children":[]},{"level":3,"title":"field - method","slug":"field-method-1","link":"#field-method-1","children":[]},{"level":3,"title":"method - method","slug":"method-method-1","link":"#method-method-1","children":[]}]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/bean/CurrentClass.md"}');export{e as data}; diff --git a/docs/assets/DefinedTypeFactory.html.5311d687.js b/docs/assets/DefinedTypeFactory.html.5311d687.js deleted file mode 100644 index f3eccc8..0000000 --- a/docs/assets/DefinedTypeFactory.html.5311d687.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-597ac69b","path":"/zh-cn/api/public/com/highcapable/yukireflection/type/defined/DefinedTypeFactory.html","title":"DefinedTypeFactory - kt","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"VagueType - field","slug":"vaguetype-field","link":"#vaguetype-field","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/type/defined/DefinedTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/DefinedTypeFactory.html.b02e4f3c.js b/docs/assets/DefinedTypeFactory.html.b02e4f3c.js deleted file mode 100644 index 9e1ce42..0000000 --- a/docs/assets/DefinedTypeFactory.html.b02e4f3c.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-30e525ac","path":"/en/api/public/com/highcapable/yukireflection/type/defined/DefinedTypeFactory.html","title":"DefinedTypeFactory - kt","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"VagueType - field","slug":"vaguetype-field","link":"#vaguetype-field","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/type/defined/DefinedTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/DefinedTypeFactory.html.db0bb621.js b/docs/assets/DefinedTypeFactory.html.db0bb621.js deleted file mode 100644 index 55ed8ab..0000000 --- a/docs/assets/DefinedTypeFactory.html.db0bb621.js +++ /dev/null @@ -1,2 +0,0 @@ -import{_ as e,o as s,c as o,a as t}from"./app.2add9aa5.js";const a={},n=t(`\u8C03\u7528\u7236\u7C7B\u5B9E\u4F8B\u4E2D\u7684\u65B9\u6CD5\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A\u5185\u90E8\u7C7B\u578B\u7684\u5B9A\u4E49\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u7528\u4E8E\u53CD\u5C04 API \u76F8\u5173\u7528\u6CD5\u7684\u5EF6\u4F38\u3002
val VagueType: Class<*>
-
Change Records
v1.0.0
first
Function Illustrate
`,12),c=[n];function r(l,p){return s(),o("div",null,c)}const d=e(a,[["render",r],["__file","DefinedTypeFactory.html.vue"]]);export{d as default}; diff --git a/docs/assets/DefinedTypeFactory.html.e75cea89.js b/docs/assets/DefinedTypeFactory.html.e75cea89.js deleted file mode 100644 index b879834..0000000 --- a/docs/assets/DefinedTypeFactory.html.e75cea89.js +++ /dev/null @@ -1,2 +0,0 @@ -import{_ as e,o as s,c as a,a as o}from"./app.2add9aa5.js";const t={},n=o(`\u5F97\u5230\u6A21\u7CCA\u7C7B\u578B\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A\u5185\u90E8\u7C7B\u578B\u7684\u5B9A\u4E49\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u7528\u4E8E\u53CD\u5C04 API \u76F8\u5173\u7528\u6CD5\u7684\u5EF6\u4F38\u3002
val VagueType: Class<*>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,11),c=[n];function p(l,r){return s(),a("div",null,c)}const i=e(t,[["render",p],["__file","DefinedTypeFactory.html.vue"]]);export{i as default}; diff --git a/docs/assets/DexClassFinder.html.00bc2e4b.js b/docs/assets/DexClassFinder.html.00bc2e4b.js deleted file mode 100644 index 183d531..0000000 --- a/docs/assets/DexClassFinder.html.00bc2e4b.js +++ /dev/null @@ -1,46 +0,0 @@ -import{_ as s,o,c as e,a}from"./app.2add9aa5.js";const n={},l=a(`\u5F97\u5230\u6A21\u7CCA\u7C7B\u578B\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class DexClassFinder internal constructor(
- private val context: Context?,
- internal var name: String,
- internal var async: Boolean,
- override val loaderSet: ClassLoader?
-) : ClassBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u67E5\u627E\u7C7B\u3002
\u53EF\u4F7F\u7528 BaseDexClassLoader
\u901A\u8FC7\u6307\u5B9A\u6761\u4EF6\u67E5\u627E\u6307\u5B9A Class
\u6216\u4E00\u7EC4 Class
\u3002
Notice
\u6B64\u529F\u80FD\u5C1A\u5728\u8BD5\u9A8C\u9636\u6BB5\uFF0C\u6027\u80FD\u4E0E\u7A33\u5B9A\u6027\u53EF\u80FD\u4ECD\u7136\u5B58\u5728\u95EE\u9898\uFF0C\u4F7F\u7528\u8FC7\u7A0B\u9047\u5230\u95EE\u9898\u8BF7\u5411\u6211\u4EEC\u62A5\u544A\u5E76\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u3002
Change Records
v1.0.0
first
fun clearCache(context: Context, versionName: String?, versionCode: Long?)
-
Change Records
v1.0.0
first
Function Illustrate
\u6E05\u9664\u5F53\u524D
DexClassFinder
\u7684Class
\u7F13\u5B58\u3002
\u9002\u7528\u4E8E\u5168\u90E8\u901A\u8FC7 ClassLoader.searchClass \u83B7\u53D6\u7684 DexClassFinder
\u3002
var fullName: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u5B8C\u6574\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getName
\u3002
\u4F8B\u5982 com.demo.Test
\u9700\u8981\u586B\u5199 com.demo.Test
\u3002
var simpleName: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u7B80\u5355\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getSimpleName
\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest
\u4F1A\u4E3A\u7A7A\uFF0C\u6B64\u65F6\u4F60\u53EF\u4EE5\u4F7F\u7528 singleName\u3002
var singleName: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u72EC\u7ACB\u540D\u79F0\u3002
\u8BBE\u7F6E\u540E\u5C06\u9996\u5148\u4F7F\u7528 Class.getSimpleName
\uFF0C\u82E5\u4E3A\u7A7A\u5219\u4F1A\u4F7F\u7528 Class.getName
\u8FDB\u884C\u5904\u7406\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest
\u53EA\u9700\u8981\u586B\u5199 Test$InnerTest
\u3002
fun from(vararg name: String): FromPackageRules
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5728\u6307\u5B9A\u5305\u540D\u8303\u56F4\u67E5\u627E\u5F53\u524D
Class
\u3002
\u8BBE\u7F6E\u540E\u4EC5\u4F1A\u5728\u5F53\u524D name
\u5F00\u5934\u5339\u914D\u7684\u5305\u540D\u8DEF\u5F84\u4E0B\u8FDB\u884C\u67E5\u627E\uFF0C\u53EF\u63D0\u5347\u67E5\u627E\u901F\u5EA6\u3002
\u4F8B\u5982 \u2193
com.demo.test
com.demo.test.demo
Notice
\u5EFA\u8BAE\u8BBE\u7F6E\u6B64\u53C2\u6570\u6307\u5B9A\u67E5\u627E\u8303\u56F4\uFF0C\u5426\u5219 Class \u8FC7\u591A\u65F6\u5C06\u4F1A\u975E\u5E38\u6162\u3002
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun fullName(value: String): ClassNameRules
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u5B8C\u6574\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getName
\u3002
\u4F8B\u5982 com.demo.Test
\u9700\u8981\u586B\u5199 com.demo.Test
\u3002
fun simpleName(value: String): ClassNameRules
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u7B80\u5355\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getSimpleName
\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest \u4F1A\u4E3A\u7A7A
\uFF0C\u6B64\u65F6\u4F60\u53EF\u4EE5\u4F7F\u7528 singleName\u3002
fun singleName(value: String): ClassNameRules
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u72EC\u7ACB\u540D\u79F0\u3002
\u8BBE\u7F6E\u540E\u5C06\u9996\u5148\u4F7F\u7528 Class.getSimpleName
\uFF0C\u82E5\u4E3A\u7A7A\u5219\u4F1A\u4F7F\u7528 Class.getName
\u8FDB\u884C\u5904\u7406\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest
\u53EA\u9700\u8981\u586B\u5199 Test$InnerTest
\u3002
fun fullName(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u5B8C\u6574\u540D\u79F0\u6761\u4EF6\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getName
\u3002
fun simpleName(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u7B80\u5355\u540D\u79F0\u6761\u4EF6\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getSimpleName
\u3002
fun singleName(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u72EC\u7ACB\u540D\u79F0\u6761\u4EF6\u3002
\u8BBE\u7F6E\u540E\u5C06\u9996\u5148\u4F7F\u7528 Class.getSimpleName
\uFF0C\u82E5\u4E3A\u7A7A\u5219\u4F1A\u4F7F\u7528 Class.getName
\u8FDB\u884C\u5904\u7406\u3002
inline fun <reified T> extends()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u7EE7\u627F\u7684\u7236\u7C7B\u3002
fun extends(vararg name: String)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u7EE7\u627F\u7684\u7236\u7C7B\u3002
\u4F1A\u540C\u65F6\u67E5\u627E name
\u4E2D\u6240\u6709\u5339\u914D\u7684\u7236\u7C7B\u3002
inline fun <reified T> implements()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u5B9E\u73B0\u7684\u63A5\u53E3\u7C7B\u3002
fun implements(vararg name: String)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u5B9E\u73B0\u7684\u63A5\u53E3\u7C7B\u3002
\u4F1A\u540C\u65F6\u67E5\u627E name
\u4E2D\u6240\u6709\u5339\u914D\u7684\u63A5\u53E3\u7C7B\u3002
fun anonymous()
-
Change Records
v1.0.0
first
Function Illustrate
\u6807\u8BC6
Class
\u4E3A\u533F\u540D\u7C7B\u3002
\u4F8B\u5982 com.demo.Test$1
\u6216 com.demo.Test$InnerTest
\u3002
\u6807\u8BC6\u540E\u4F60\u53EF\u4EE5\u4F7F\u7528 enclosing \u6765\u8FDB\u4E00\u6B65\u6307\u5B9A\u533F\u540D\u7C7B\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
fun noExtends()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6CA1\u6709\u4EFB\u4F55\u7EE7\u627F\u3002
\u6B64\u65F6 Class
\u53EA\u5E94\u8BE5\u7EE7\u627F\u4E8E Any
\u3002
Notice
\u8BBE\u7F6E\u6B64\u6761\u4EF6\u540E extends \u5C06\u5931\u6548\u3002
fun noImplements()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6CA1\u6709\u4EFB\u4F55\u63A5\u53E3\u3002
Notice
\u8BBE\u7F6E\u6B64\u6761\u4EF6\u540E implements \u5C06\u5931\u6548\u3002
fun noSuper()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6CA1\u6709\u4EFB\u4F55\u7EE7\u627F\u4E0E\u63A5\u53E3\u3002
\u6B64\u65F6 Class
\u53EA\u5E94\u8BE5\u7EE7\u627F\u4E8E Any
\u3002
Notice
\u8BBE\u7F6E\u6B64\u6761\u4EF6\u540E extends \u4E0E implements \u5C06\u5931\u6548\u3002
inline fun <reified T> enclosing()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u533F\u540D\u7C7B\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
fun enclosing(vararg name: String)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u533F\u540D\u7C7B\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
\u4F1A\u540C\u65F6\u67E5\u627E name
\u4E2D\u6240\u6709\u5339\u914D\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
-
Change Records
v1.0.0
first
Function Illustrate
\u5305\u540D\u8303\u56F4\u540D\u79F0\u8FC7\u6EE4\u5339\u914D\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
fun absolute()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5305\u540D\u7EDD\u5BF9\u5339\u914D\u3002
\u4F8B\u5982\u6709\u5982\u4E0B\u5305\u540D \u2193
com.demo.test.a
com.demo.test.a.b
com.demo.test.active
\u82E5\u5305\u540D\u6761\u4EF6\u4E3A com.demo.test.a
\u5219\u7EDD\u5BF9\u5339\u914D\u4EC5\u80FD\u5339\u914D\u5230\u7B2C\u4E00\u4E2A\u3002
\u76F8\u53CD\u5730\uFF0C\u4E0D\u8BBE\u7F6E\u4EE5\u4E0A\u793A\u4F8B\u4F1A\u5168\u90E8\u5339\u914D\u3002
inner class ClassNameRules internal constructor(private val name: ClassRulesData.NameRulesData)
-
Change Records
v1.0.0
first
Function Illustrate
\u7C7B\u540D\u5339\u914D\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
fun optional()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u7C7B\u540D\u53EF\u9009\u3002
\u4F8B\u5982\u6709\u5982\u4E0B\u7C7B\u540D \u2193
com.demo.Test
fullName / Test
simpleName
defpackage.a
fullName / a
simpleName
\u8FD9\u4E24\u4E2A\u7C7B\u540D\u90FD\u662F\u540C\u4E00\u4E2A\u7C7B\uFF0C\u4F46\u662F\u5728\u6709\u4E9B\u7248\u672C\u4E2D\u88AB\u6DF7\u6DC6\u6709\u4E9B\u7248\u672C\u6CA1\u6709\u3002
\u6B64\u65F6\u53EF\u8BBE\u7F6E\u7C7B\u540D\u4E3A com.demo.Test
fullName / Test
simpleName\u3002
\u8FD9\u6837\u5C31\u53EF\u5728\u5B8C\u5168\u5339\u914D\u7C7B\u540D\u60C5\u51B5\u4E0B\u4F7F\u7528\u7C7B\u540D\u800C\u5FFD\u7565\u5176\u5B83\u67E5\u627E\u6761\u4EF6\uFF0C\u5426\u5219\u5FFD\u7565\u6B64\u6761\u4EF6\u7EE7\u7EED\u4F7F\u7528\u5176\u5B83\u67E5\u627E\u6761\u4EF6\u3002
inline fun member(initiate: MemberRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Member
\u6761\u4EF6\u3002
inline fun field(initiate: FieldRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Field
\u6761\u4EF6\u3002
inline fun method(initiate: MethodRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Method
\u6761\u4EF6\u3002
inline fun constructor(initiate: ConstructorRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Constructor
\u6761\u4EF6\u3002
inner class Result internal constructor(internal var isNotFound: Boolean, internal var throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
fun get(): Class<*>?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Class
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Class
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
\u82E5\u4F60\u8BBE\u7F6E\u4E86 async
\u8BF7\u4F7F\u7528 wait \u65B9\u6CD5\u3002
fun all(): HashSet<Class<*>>
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Class
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Class
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
\u82E5\u4F60\u8BBE\u7F6E\u4E86 async
\u8BF7\u4F7F\u7528 waitAll \u65B9\u6CD5\u3002
fun all(result: (Class<*>) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Class
\u672C\u8EAB\u6570\u7EC4 (\u4F9D\u6B21\u904D\u5386)\u3002
\u56DE\u8C03\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Class
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u4E0D\u4F1A\u6267\u884C\u3002
\u82E5\u4F60\u8BBE\u7F6E\u4E86 async
\u8BF7\u4F7F\u7528 waitAll \u65B9\u6CD5\u3002
fun wait(result: (Class<*>?) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Class
\u672C\u8EAB (\u5F02\u6B65)\u3002
\u82E5\u6709\u591A\u4E2A Class
\u7ED3\u679C\u53EA\u4F1A\u56DE\u8C03\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u56DE\u8C03 null\u3002
\u4F60\u9700\u8981\u8BBE\u7F6E async
\u540E\u6B64\u65B9\u6CD5\u624D\u4F1A\u88AB\u56DE\u8C03\uFF0C\u5426\u5219\u8BF7\u4F7F\u7528 get \u65B9\u6CD5\u3002
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Class
\u672C\u8EAB\u6570\u7EC4 (\u5F02\u6B65)\u3002
\u56DE\u8C03\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Class
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u56DE\u8C03\u7A7A\u7684 HashSet
\u3002
\u4F60\u9700\u8981\u8BBE\u7F6E async
\u540E\u6B64\u65B9\u6CD5\u624D\u4F1A\u88AB\u56DE\u8C03\uFF0C\u5426\u5219\u8BF7\u4F7F\u7528 all \u65B9\u6CD5\u3002
fun onNoClassDefFoundError(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u76D1\u542C\u627E\u4E0D\u5230
Class
\u65F6\u3002
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoClassDefFoundError \u65B9\u6CD5\u3002
`,310),p=[l];function c(t,r){return o(),e("div",null,p)}const i=s(n,[["render",c],["__file","DexClassFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/DexClassFinder.html.50819339.js b/docs/assets/DexClassFinder.html.50819339.js deleted file mode 100644 index f459888..0000000 --- a/docs/assets/DexClassFinder.html.50819339.js +++ /dev/null @@ -1,46 +0,0 @@ -import{_ as s,o,c as a,a as e}from"./app.2add9aa5.js";const n={},l=e(`class DexClassFinder internal constructor(
- private val context: Context?,
- internal var name: String,
- internal var async: Boolean,
- override val loaderSet: ClassLoader?
-) : ClassBaseFinder
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u67E5\u627E\u7C7B\u3002
\u53EF\u4F7F\u7528 BaseDexClassLoader
\u901A\u8FC7\u6307\u5B9A\u6761\u4EF6\u67E5\u627E\u6307\u5B9A Class
\u6216\u4E00\u7EC4 Class
\u3002
\u6CE8\u610F
\u6B64\u529F\u80FD\u5C1A\u5728\u8BD5\u9A8C\u9636\u6BB5\uFF0C\u6027\u80FD\u4E0E\u7A33\u5B9A\u6027\u53EF\u80FD\u4ECD\u7136\u5B58\u5728\u95EE\u9898\uFF0C\u4F7F\u7528\u8FC7\u7A0B\u9047\u5230\u95EE\u9898\u8BF7\u5411\u6211\u4EEC\u62A5\u544A\u5E76\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
fun clearCache(context: Context, versionName: String?, versionCode: Long?)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6E05\u9664\u5F53\u524D
DexClassFinder
\u7684Class
\u7F13\u5B58\u3002
\u9002\u7528\u4E8E\u5168\u90E8\u901A\u8FC7 ClassLoader.searchClass \u83B7\u53D6\u7684 DexClassFinder
\u3002
var fullName: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u5B8C\u6574\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getName
\u3002
\u4F8B\u5982 com.demo.Test
\u9700\u8981\u586B\u5199 com.demo.Test
\u3002
var simpleName: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u7B80\u5355\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getSimpleName
\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest
\u4F1A\u4E3A\u7A7A\uFF0C\u6B64\u65F6\u4F60\u53EF\u4EE5\u4F7F\u7528 singleName\u3002
var singleName: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u72EC\u7ACB\u540D\u79F0\u3002
\u8BBE\u7F6E\u540E\u5C06\u9996\u5148\u4F7F\u7528 Class.getSimpleName
\uFF0C\u82E5\u4E3A\u7A7A\u5219\u4F1A\u4F7F\u7528 Class.getName
\u8FDB\u884C\u5904\u7406\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest
\u53EA\u9700\u8981\u586B\u5199 Test$InnerTest
\u3002
fun from(vararg name: String): FromPackageRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5728\u6307\u5B9A\u5305\u540D\u8303\u56F4\u67E5\u627E\u5F53\u524D
Class
\u3002
\u8BBE\u7F6E\u540E\u4EC5\u4F1A\u5728\u5F53\u524D name
\u5F00\u5934\u5339\u914D\u7684\u5305\u540D\u8DEF\u5F84\u4E0B\u8FDB\u884C\u67E5\u627E\uFF0C\u53EF\u63D0\u5347\u67E5\u627E\u901F\u5EA6\u3002
\u4F8B\u5982 \u2193
com.demo.test
com.demo.test.demo
\u6CE8\u610F
\u5EFA\u8BAE\u8BBE\u7F6E\u6B64\u53C2\u6570\u6307\u5B9A\u67E5\u627E\u8303\u56F4\uFF0C\u5426\u5219 Class \u8FC7\u591A\u65F6\u5C06\u4F1A\u975E\u5E38\u6162\u3002
fun modifiers(conditions: ModifierConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun fullName(value: String): ClassNameRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u5B8C\u6574\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getName
\u3002
\u4F8B\u5982 com.demo.Test
\u9700\u8981\u586B\u5199 com.demo.Test
\u3002
fun simpleName(value: String): ClassNameRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u7B80\u5355\u540D\u79F0\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getSimpleName
\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest \u4F1A\u4E3A\u7A7A
\uFF0C\u6B64\u65F6\u4F60\u53EF\u4EE5\u4F7F\u7528 singleName\u3002
fun singleName(value: String): ClassNameRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u72EC\u7ACB\u540D\u79F0\u3002
\u8BBE\u7F6E\u540E\u5C06\u9996\u5148\u4F7F\u7528 Class.getSimpleName
\uFF0C\u82E5\u4E3A\u7A7A\u5219\u4F1A\u4F7F\u7528 Class.getName
\u8FDB\u884C\u5904\u7406\u3002
\u4F8B\u5982 com.demo.Test
\u53EA\u9700\u8981\u586B\u5199 Test
\u3002
\u5BF9\u4E8E\u533F\u540D\u7C7B\u4F8B\u5982 com.demo.Test$InnerTest
\u53EA\u9700\u8981\u586B\u5199 Test$InnerTest
\u3002
fun fullName(conditions: NameConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u5B8C\u6574\u540D\u79F0\u6761\u4EF6\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getName
\u3002
fun simpleName(conditions: NameConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u7B80\u5355\u540D\u79F0\u6761\u4EF6\u3002
\u53EA\u4F1A\u67E5\u627E\u5339\u914D\u5230\u7684 Class.getSimpleName
\u3002
fun singleName(conditions: NameConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u72EC\u7ACB\u540D\u79F0\u6761\u4EF6\u3002
\u8BBE\u7F6E\u540E\u5C06\u9996\u5148\u4F7F\u7528 Class.getSimpleName
\uFF0C\u82E5\u4E3A\u7A7A\u5219\u4F1A\u4F7F\u7528 Class.getName
\u8FDB\u884C\u5904\u7406\u3002
inline fun <reified T> extends()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u7EE7\u627F\u7684\u7236\u7C7B\u3002
fun extends(vararg name: String)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u7EE7\u627F\u7684\u7236\u7C7B\u3002
\u4F1A\u540C\u65F6\u67E5\u627E name
\u4E2D\u6240\u6709\u5339\u914D\u7684\u7236\u7C7B\u3002
inline fun <reified T> implements()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u5B9E\u73B0\u7684\u63A5\u53E3\u7C7B\u3002
fun implements(vararg name: String)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u5B9E\u73B0\u7684\u63A5\u53E3\u7C7B\u3002
\u4F1A\u540C\u65F6\u67E5\u627E name
\u4E2D\u6240\u6709\u5339\u914D\u7684\u63A5\u53E3\u7C7B\u3002
fun anonymous()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6807\u8BC6
Class
\u4E3A\u533F\u540D\u7C7B\u3002
\u4F8B\u5982 com.demo.Test$1
\u6216 com.demo.Test$InnerTest
\u3002
\u6807\u8BC6\u540E\u4F60\u53EF\u4EE5\u4F7F\u7528 enclosing \u6765\u8FDB\u4E00\u6B65\u6307\u5B9A\u533F\u540D\u7C7B\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
fun noExtends()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6CA1\u6709\u4EFB\u4F55\u7EE7\u627F\u3002
\u6B64\u65F6 Class
\u53EA\u5E94\u8BE5\u7EE7\u627F\u4E8E Any
\u3002
\u6CE8\u610F
\u8BBE\u7F6E\u6B64\u6761\u4EF6\u540E extends \u5C06\u5931\u6548\u3002
fun noImplements()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6CA1\u6709\u4EFB\u4F55\u63A5\u53E3\u3002
\u6CE8\u610F
\u8BBE\u7F6E\u6B64\u6761\u4EF6\u540E implements \u5C06\u5931\u6548\u3002
fun noSuper()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6CA1\u6709\u4EFB\u4F55\u7EE7\u627F\u4E0E\u63A5\u53E3\u3002
\u6B64\u65F6 Class
\u53EA\u5E94\u8BE5\u7EE7\u627F\u4E8E Any
\u3002
\u6CE8\u610F
\u8BBE\u7F6E\u6B64\u6761\u4EF6\u540E extends \u4E0E implements \u5C06\u5931\u6548\u3002
inline fun <reified T> enclosing()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u533F\u540D\u7C7B\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
fun enclosing(vararg name: String)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u533F\u540D\u7C7B\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
\u4F1A\u540C\u65F6\u67E5\u627E name
\u4E2D\u6240\u6709\u5339\u914D\u7684 (\u5C01\u95ED\u7C7B) \u4E3B\u7C7B\u3002
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5305\u540D\u8303\u56F4\u540D\u79F0\u8FC7\u6EE4\u5339\u914D\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
fun absolute()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5305\u540D\u7EDD\u5BF9\u5339\u914D\u3002
\u4F8B\u5982\u6709\u5982\u4E0B\u5305\u540D \u2193
com.demo.test.a
com.demo.test.a.b
com.demo.test.active
\u82E5\u5305\u540D\u6761\u4EF6\u4E3A com.demo.test.a
\u5219\u7EDD\u5BF9\u5339\u914D\u4EC5\u80FD\u5339\u914D\u5230\u7B2C\u4E00\u4E2A\u3002
\u76F8\u53CD\u5730\uFF0C\u4E0D\u8BBE\u7F6E\u4EE5\u4E0A\u793A\u4F8B\u4F1A\u5168\u90E8\u5339\u914D\u3002
inner class ClassNameRules internal constructor(private val name: ClassRulesData.NameRulesData)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u7C7B\u540D\u5339\u914D\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
fun optional()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u7C7B\u540D\u53EF\u9009\u3002
\u4F8B\u5982\u6709\u5982\u4E0B\u7C7B\u540D \u2193
com.demo.Test
fullName / Test
simpleName
defpackage.a
fullName / a
simpleName
\u8FD9\u4E24\u4E2A\u7C7B\u540D\u90FD\u662F\u540C\u4E00\u4E2A\u7C7B\uFF0C\u4F46\u662F\u5728\u6709\u4E9B\u7248\u672C\u4E2D\u88AB\u6DF7\u6DC6\u6709\u4E9B\u7248\u672C\u6CA1\u6709\u3002
\u6B64\u65F6\u53EF\u8BBE\u7F6E\u7C7B\u540D\u4E3A com.demo.Test
fullName / Test
simpleName\u3002
\u8FD9\u6837\u5C31\u53EF\u5728\u5B8C\u5168\u5339\u914D\u7C7B\u540D\u60C5\u51B5\u4E0B\u4F7F\u7528\u7C7B\u540D\u800C\u5FFD\u7565\u5176\u5B83\u67E5\u627E\u6761\u4EF6\uFF0C\u5426\u5219\u5FFD\u7565\u6B64\u6761\u4EF6\u7EE7\u7EED\u4F7F\u7528\u5176\u5B83\u67E5\u627E\u6761\u4EF6\u3002
inline fun member(initiate: MemberRules.() -> Unit): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Member
\u6761\u4EF6\u3002
inline fun field(initiate: FieldRules.() -> Unit): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Field
\u6761\u4EF6\u3002
inline fun method(initiate: MethodRules.() -> Unit): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Method
\u6761\u4EF6\u3002
inline fun constructor(initiate: ConstructorRules.() -> Unit): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Class
\u6EE1\u8DB3\u7684Constructor
\u6761\u4EF6\u3002
inner class Result internal constructor(internal var isNotFound: Boolean, internal var throwable: Throwable?) : BaseResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
fun get(): Class<*>?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Class
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Class
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
\u82E5\u4F60\u8BBE\u7F6E\u4E86 async
\u8BF7\u4F7F\u7528 wait \u65B9\u6CD5\u3002
fun all(): HashSet<Class<*>>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Class
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Class
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
\u82E5\u4F60\u8BBE\u7F6E\u4E86 async
\u8BF7\u4F7F\u7528 waitAll \u65B9\u6CD5\u3002
fun all(result: (Class<*>) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Class
\u672C\u8EAB\u6570\u7EC4 (\u4F9D\u6B21\u904D\u5386)\u3002
\u56DE\u8C03\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Class
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u4E0D\u4F1A\u6267\u884C\u3002
\u82E5\u4F60\u8BBE\u7F6E\u4E86 async
\u8BF7\u4F7F\u7528 waitAll \u65B9\u6CD5\u3002
fun wait(result: (Class<*>?) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Class
\u672C\u8EAB (\u5F02\u6B65)\u3002
\u82E5\u6709\u591A\u4E2A Class
\u7ED3\u679C\u53EA\u4F1A\u56DE\u8C03\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u56DE\u8C03 null\u3002
\u4F60\u9700\u8981\u8BBE\u7F6E async
\u540E\u6B64\u65B9\u6CD5\u624D\u4F1A\u88AB\u56DE\u8C03\uFF0C\u5426\u5219\u8BF7\u4F7F\u7528 get \u65B9\u6CD5\u3002
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Class
\u672C\u8EAB\u6570\u7EC4 (\u5F02\u6B65)\u3002
\u56DE\u8C03\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Class
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u56DE\u8C03\u7A7A\u7684 HashSet
\u3002
\u4F60\u9700\u8981\u8BBE\u7F6E async
\u540E\u6B64\u65B9\u6CD5\u624D\u4F1A\u88AB\u56DE\u8C03\uFF0C\u5426\u5219\u8BF7\u4F7F\u7528 all \u65B9\u6CD5\u3002
fun onNoClassDefFoundError(result: (Throwable) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u76D1\u542C\u627E\u4E0D\u5230
Class
\u65F6\u3002
fun ignored(): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoClassDefFoundError \u65B9\u6CD5\u3002
`,309),p=[l];function c(t,r){return o(),a("div",null,p)}const i=s(n,[["render",c],["__file","DexClassFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/DexClassFinder.html.7f9c18ee.js b/docs/assets/DexClassFinder.html.7f9c18ee.js deleted file mode 100644 index f6a78e5..0000000 --- a/docs/assets/DexClassFinder.html.7f9c18ee.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-6d6cd473","path":"/en/api/public/com/highcapable/yukireflection/finder/classes/DexClassFinder.html","title":"DexClassFinder - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"companion object - object","slug":"companion-object-object","link":"#companion-object-object","children":[{"level":3,"title":"clearCache - method","slug":"clearcache-method","link":"#clearcache-method","children":[]}]},{"level":2,"title":"fullName - field","slug":"fullname-field","link":"#fullname-field","children":[]},{"level":2,"title":"simpleName - field","slug":"simplename-field","link":"#simplename-field","children":[]},{"level":2,"title":"singleName - field","slug":"singlename-field","link":"#singlename-field","children":[]},{"level":2,"title":"from - method","slug":"from-method","link":"#from-method","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"fullName - method","slug":"fullname-method","link":"#fullname-method","children":[]},{"level":2,"title":"simpleName - method","slug":"simplename-method","link":"#simplename-method","children":[]},{"level":2,"title":"singleName - method","slug":"singlename-method","link":"#singlename-method","children":[]},{"level":2,"title":"fullName - method","slug":"fullname-method-1","link":"#fullname-method-1","children":[]},{"level":2,"title":"simpleName - method","slug":"simplename-method-1","link":"#simplename-method-1","children":[]},{"level":2,"title":"singleName - method","slug":"singlename-method-1","link":"#singlename-method-1","children":[]},{"level":2,"title":"extends - method","slug":"extends-method","link":"#extends-method","children":[]},{"level":2,"title":"extends - method","slug":"extends-method-1","link":"#extends-method-1","children":[]},{"level":2,"title":"implements - method","slug":"implements-method","link":"#implements-method","children":[]},{"level":2,"title":"implements - method","slug":"implements-method-1","link":"#implements-method-1","children":[]},{"level":2,"title":"anonymous - method","slug":"anonymous-method","link":"#anonymous-method","children":[]},{"level":2,"title":"noExtends - method","slug":"noextends-method","link":"#noextends-method","children":[]},{"level":2,"title":"noImplements - method","slug":"noimplements-method","link":"#noimplements-method","children":[]},{"level":2,"title":"noSuper - method","slug":"nosuper-method","link":"#nosuper-method","children":[]},{"level":2,"title":"enclosing - method","slug":"enclosing-method","link":"#enclosing-method","children":[]},{"level":2,"title":"enclosing - method","slug":"enclosing-method-1","link":"#enclosing-method-1","children":[]},{"level":2,"title":"FromPackageRules - class","slug":"frompackagerules-class","link":"#frompackagerules-class","children":[{"level":3,"title":"absolute - method","slug":"absolute-method","link":"#absolute-method","children":[]}]},{"level":2,"title":"ClassNameRules - class","slug":"classnamerules-class","link":"#classnamerules-class","children":[{"level":3,"title":"optional - method","slug":"optional-method","link":"#optional-method","children":[]}]},{"level":2,"title":"member - method","slug":"member-method","link":"#member-method","children":[]},{"level":2,"title":"field - method","slug":"field-method","link":"#field-method","children":[]},{"level":2,"title":"method - method","slug":"method-method","link":"#method-method","children":[]},{"level":2,"title":"constructor - method","slug":"constructor-method","link":"#constructor-method","children":[]},{"level":2,"title":"Result - class","slug":"result-class","link":"#result-class","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"all - method","slug":"all-method-1","link":"#all-method-1","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"onNoClassDefFoundError - method","slug":"onnoclassdeffounderror-method","link":"#onnoclassdeffounderror-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]}]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/classes/DexClassFinder.md"}');export{e as data}; diff --git a/docs/assets/DexClassFinder.html.e0965adb.js b/docs/assets/DexClassFinder.html.e0965adb.js deleted file mode 100644 index 36c241a..0000000 --- a/docs/assets/DexClassFinder.html.e0965adb.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-2d13d624","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/classes/DexClassFinder.html","title":"DexClassFinder - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"companion object - object","slug":"companion-object-object","link":"#companion-object-object","children":[{"level":3,"title":"clearCache - method","slug":"clearcache-method","link":"#clearcache-method","children":[]}]},{"level":2,"title":"fullName - field","slug":"fullname-field","link":"#fullname-field","children":[]},{"level":2,"title":"simpleName - field","slug":"simplename-field","link":"#simplename-field","children":[]},{"level":2,"title":"singleName - field","slug":"singlename-field","link":"#singlename-field","children":[]},{"level":2,"title":"from - method","slug":"from-method","link":"#from-method","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"fullName - method","slug":"fullname-method","link":"#fullname-method","children":[]},{"level":2,"title":"simpleName - method","slug":"simplename-method","link":"#simplename-method","children":[]},{"level":2,"title":"singleName - method","slug":"singlename-method","link":"#singlename-method","children":[]},{"level":2,"title":"fullName - method","slug":"fullname-method-1","link":"#fullname-method-1","children":[]},{"level":2,"title":"simpleName - method","slug":"simplename-method-1","link":"#simplename-method-1","children":[]},{"level":2,"title":"singleName - method","slug":"singlename-method-1","link":"#singlename-method-1","children":[]},{"level":2,"title":"extends - method","slug":"extends-method","link":"#extends-method","children":[]},{"level":2,"title":"extends - method","slug":"extends-method-1","link":"#extends-method-1","children":[]},{"level":2,"title":"implements - method","slug":"implements-method","link":"#implements-method","children":[]},{"level":2,"title":"implements - method","slug":"implements-method-1","link":"#implements-method-1","children":[]},{"level":2,"title":"anonymous - method","slug":"anonymous-method","link":"#anonymous-method","children":[]},{"level":2,"title":"noExtends - method","slug":"noextends-method","link":"#noextends-method","children":[]},{"level":2,"title":"noImplements - method","slug":"noimplements-method","link":"#noimplements-method","children":[]},{"level":2,"title":"noSuper - method","slug":"nosuper-method","link":"#nosuper-method","children":[]},{"level":2,"title":"enclosing - method","slug":"enclosing-method","link":"#enclosing-method","children":[]},{"level":2,"title":"enclosing - method","slug":"enclosing-method-1","link":"#enclosing-method-1","children":[]},{"level":2,"title":"FromPackageRules - class","slug":"frompackagerules-class","link":"#frompackagerules-class","children":[{"level":3,"title":"absolute - method","slug":"absolute-method","link":"#absolute-method","children":[]}]},{"level":2,"title":"ClassNameRules - class","slug":"classnamerules-class","link":"#classnamerules-class","children":[{"level":3,"title":"optional - method","slug":"optional-method","link":"#optional-method","children":[]}]},{"level":2,"title":"member - method","slug":"member-method","link":"#member-method","children":[]},{"level":2,"title":"field - method","slug":"field-method","link":"#field-method","children":[]},{"level":2,"title":"method - method","slug":"method-method","link":"#method-method","children":[]},{"level":2,"title":"constructor - method","slug":"constructor-method","link":"#constructor-method","children":[]},{"level":2,"title":"Result - class","slug":"result-class","link":"#result-class","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"all - method","slug":"all-method-1","link":"#all-method-1","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"onNoClassDefFoundError - method","slug":"onnoclassdeffounderror-method","link":"#onnoclassdeffounderror-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]}]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/classes/DexClassFinder.md"}');export{e as data}; diff --git a/docs/assets/FieldFinder.html.00221b25.js b/docs/assets/FieldFinder.html.00221b25.js deleted file mode 100644 index 59a9d2c..0000000 --- a/docs/assets/FieldFinder.html.00221b25.js +++ /dev/null @@ -1,84 +0,0 @@ -import{_ as s,o as n,c as o,a}from"./app.2add9aa5.js";const e={},l=a(`Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class FieldFinder internal constructor(override val classSet: Class<*>?) : MemberBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u67E5\u627E\u7C7B\u3002
\u53EF\u901A\u8FC7\u6307\u5B9A\u7C7B\u578B\u67E5\u627E\u6307\u5B9A Field
\u6216\u4E00\u7EC4 Field
\u3002
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u540D\u79F0\u3002
Pay Attention
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
var type: Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u7C7B\u578B\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun order(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u987A\u5E8F\u7B5B\u9009\u5B57\u8282\u7801\u7684\u4E0B\u6807\u3002
fun name(value: String): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u540D\u79F0\u3002
Pay Attention
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun name(conditions: NameConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u540D\u79F0\u6761\u4EF6\u3002
Pay Attention
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun type(value: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u7C7B\u578B\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun type(conditions: ObjectConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u7C7B\u578B\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun superClass(isOnlySuperClass: Boolean)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5728
classSet
\u7684\u6240\u6709\u7236\u7C7B\u4E2D\u67E5\u627E\u5F53\u524DField
\u3002
Notice
\u82E5\u5F53\u524D classSet \u7684\u7236\u7C7B\u8F83\u591A\u53EF\u80FD\u4F1A\u8017\u65F6\uFF0CAPI \u4F1A\u81EA\u52A8\u5FAA\u73AF\u5230\u7236\u7C7B\u7EE7\u627F\u662F Any \u524D\u7684\u6700\u540E\u4E00\u4E2A\u7C7B\u3002
inner class RemedyPlan internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u91CD\u67E5\u627E\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u7D2F\u8BA1\u5931\u8D25\u6B21\u6570\u76F4\u5230\u67E5\u627E\u6210\u529F\u3002
inline fun field(initiate: FieldConditions): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u9700\u8981\u91CD\u65B0\u67E5\u627E\u7684
Field
\u3002
\u4F60\u53EF\u4EE5\u6DFB\u52A0\u591A\u4E2A\u5907\u9009 Field
\uFF0C\u76F4\u5230\u6210\u529F\u4E3A\u6B62\uFF0C\u82E5\u6700\u540E\u4F9D\u7136\u5931\u8D25\uFF0C\u5C06\u505C\u6B62\u67E5\u627E\u5E76\u8F93\u51FA\u9519\u8BEF\u65E5\u5FD7\u3002
inner class Result internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
RemedyPlan
\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun onFind(initiate: HashSet<Field>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u5728
RemedyPlan
\u4E2D\u627E\u5230\u7ED3\u679C\u65F6\u3002
Function Example
\u4F60\u53EF\u4EE5\u65B9\u4FBF\u5730\u5BF9\u91CD\u67E5\u627E\u7684 Field
\u5B9E\u73B0 onFind
\u65B9\u6CD5\u3002
The following example
field {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528 lambda
\u5F62\u5F0F\u521B\u5EFA Result
\u7C7B\u3002
The following example
field {
- // Your code here.
-}.result {
- get(instance).set("something")
- get(instance).string()
- get(instance).cast<CustomClass>()
- get().boolean()
- all(instance)
- give()
- giveAll()
- onNoSuchField {}
-}
-
fun get(instance: Any?): Instance
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
\u82E5\u6709\u591A\u4E2A Field
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
Function Example
\u4F60\u53EF\u4EE5\u8F7B\u677E\u5730\u5F97\u5230 Field
\u7684\u5B9E\u4F8B\u4EE5\u53CA\u4F7F\u7528\u5B83\u8FDB\u884C\u8BBE\u7F6E\u5B9E\u4F8B\u3002
The following example
field {
- // Your code here.
-}.get(instance).set("something")
-
\u5982\u679C\u4F60\u53D6\u5230\u7684\u662F\u9759\u6001 Field
\uFF0C\u53EF\u4EE5\u4E0D\u9700\u8981\u8BBE\u7F6E\u5B9E\u4F8B\u3002
The following example
field {
- // Your code here.
-}.get().set("something")
-
fun all(instance: Any?): ArrayList<Instance>
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Field
\u5B9E\u4F8B\u7ED3\u679C\u3002
Function Example
\u4F60\u53EF\u4EE5\u901A\u8FC7\u6B64\u65B9\u6CD5\u6765\u83B7\u5F97\u5F53\u524D\u6761\u4EF6\u7ED3\u679C\u4E2D\u5339\u914D\u7684\u5168\u90E8 Field
\uFF0C\u5176 Field
\u6240\u5728\u5B9E\u4F8B\u7528\u6CD5\u4E0E get
\u76F8\u540C\u3002
The following example
field {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.self
-}
-
fun give(): Field?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Field
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Field \u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
fun giveAll(): HashSet<Field>
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Field
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Field
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u82E5\u6709\u591A\u4E2A Field
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Field
\u5B9E\u4F8B\u7ED3\u679C\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA
Field
\u91CD\u67E5\u627E\u529F\u80FD\u3002
Function Example
\u5F53\u4F60\u9047\u5230\u4E00\u79CD Field
\u53EF\u80FD\u5B58\u5728\u4E0D\u540C\u5F62\u5F0F\u7684\u5B58\u5728\u65F6\uFF0C\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u5B83\uFF0C\u800C\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528 onNoSuchField
\u6355\u83B7\u5F02\u5E38\u4E8C\u6B21\u67E5\u627E Field
\u3002
\u82E5\u7B2C\u4E00\u6B21\u67E5\u627E\u5931\u8D25\u4E86\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u8FD9\u91CC\u7EE7\u7EED\u6DFB\u52A0\u6B64\u65B9\u6CD5\u4F53\u76F4\u5230\u6210\u529F\u4E3A\u6B62\u3002
The following example
field {
- // Your code here.
-}.remedys {
- field {
- // Your code here.
- }
- field {
- // Your code here.
- }
-}
-
fun onNoSuchField(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u76D1\u542C\u627E\u4E0D\u5230
Field
\u65F6\u3002
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
Notice
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoSuchField \u65B9\u6CD5\u3002
inner class Instance internal constructor(private val instance: Any?, private val field: Field?)
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u5B9E\u4F8B\u53D8\u91CF\u5904\u7406\u7C7B\u3002
fun current(ignored: Boolean): CurrentClass?
-
inline fun current(ignored: Boolean, initiate: CurrentClass.() -> Unit): Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
Field
\u81EA\u8EABself
\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61CurrentClass
\u3002
fun <T> cast(): T?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
\u5B9E\u4F8B\u3002
fun byte(): Byte?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Byte \u5B9E\u4F8B\u3002
fun int(): Int
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Int \u5B9E\u4F8B\u3002
fun long(): Long
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Long \u5B9E\u4F8B\u3002
fun short(): Short
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Short \u5B9E\u4F8B\u3002
fun double(): Double
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Double \u5B9E\u4F8B\u3002
fun float(): Float
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Float \u5B9E\u4F8B\u3002
fun string(): String
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
String \u5B9E\u4F8B\u3002
fun char(): Char
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Char \u5B9E\u4F8B\u3002
fun boolean(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Boolean \u5B9E\u4F8B\u3002
fun any(): Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Any \u5B9E\u4F8B\u3002
inline fun <reified T> array(): Array<T>
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
Array \u5B9E\u4F8B\u3002
inline fun <reified T> list(): List<T>
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230\u5F53\u524D
Field
List \u5B9E\u4F8B\u3002
fun set(any: Any?)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u3002
fun setTrue()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u4E3Atrue
\u3002
Pay Attention
\u8BF7\u786E\u4FDD\u5B9E\u4F8B\u5BF9\u8C61\u7C7B\u578B\u4E3A Boolean\u3002
fun setFalse()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u4E3Afalse
\u3002
Pay Attention
\u8BF7\u786E\u4FDD\u5B9E\u4F8B\u5BF9\u8C61\u7C7B\u578B\u4E3A Boolean\u3002
fun setNull()
-
Change Records
v1.0.0
first
Function Illustrate
`,316),p=[l];function c(t,r){return n(),o("div",null,p)}const i=s(e,[["render",c],["__file","FieldFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/FieldFinder.html.44edac16.js b/docs/assets/FieldFinder.html.44edac16.js deleted file mode 100644 index 72a5d5e..0000000 --- a/docs/assets/FieldFinder.html.44edac16.js +++ /dev/null @@ -1,84 +0,0 @@ -import{_ as s,o as n,c as o,a}from"./app.2add9aa5.js";const e={},l=a(`\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u4E3Anull
\u3002
class FieldFinder internal constructor(override val classSet: Class<*>?) : MemberBaseFinder
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u67E5\u627E\u7C7B\u3002
\u53EF\u901A\u8FC7\u6307\u5B9A\u7C7B\u578B\u67E5\u627E\u6307\u5B9A Field
\u6216\u4E00\u7EC4 Field
\u3002
var name: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u540D\u79F0\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
var type: Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u7C7B\u578B\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun order(): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u987A\u5E8F\u7B5B\u9009\u5B57\u8282\u7801\u7684\u4E0B\u6807\u3002
fun name(value: String): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u540D\u79F0\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun name(conditions: NameConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u540D\u79F0\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun type(value: Any): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u7C7B\u578B\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun type(conditions: ObjectConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u7C7B\u578B\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun superClass(isOnlySuperClass: Boolean)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5728
classSet
\u7684\u6240\u6709\u7236\u7C7B\u4E2D\u67E5\u627E\u5F53\u524DField
\u3002
\u6CE8\u610F
\u82E5\u5F53\u524D classSet \u7684\u7236\u7C7B\u8F83\u591A\u53EF\u80FD\u4F1A\u8017\u65F6\uFF0CAPI \u4F1A\u81EA\u52A8\u5FAA\u73AF\u5230\u7236\u7C7B\u7EE7\u627F\u662F Any \u524D\u7684\u6700\u540E\u4E00\u4E2A\u7C7B\u3002
inner class RemedyPlan internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u91CD\u67E5\u627E\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u7D2F\u8BA1\u5931\u8D25\u6B21\u6570\u76F4\u5230\u67E5\u627E\u6210\u529F\u3002
inline fun field(initiate: FieldConditions): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u9700\u8981\u91CD\u65B0\u67E5\u627E\u7684
Field
\u3002
\u4F60\u53EF\u4EE5\u6DFB\u52A0\u591A\u4E2A\u5907\u9009 Field
\uFF0C\u76F4\u5230\u6210\u529F\u4E3A\u6B62\uFF0C\u82E5\u6700\u540E\u4F9D\u7136\u5931\u8D25\uFF0C\u5C06\u505C\u6B62\u67E5\u627E\u5E76\u8F93\u51FA\u9519\u8BEF\u65E5\u5FD7\u3002
inner class Result internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
RemedyPlan
\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun onFind(initiate: HashSet<Field>.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u5728
RemedyPlan
\u4E2D\u627E\u5230\u7ED3\u679C\u65F6\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u65B9\u4FBF\u5730\u5BF9\u91CD\u67E5\u627E\u7684 Field
\u5B9E\u73B0 onFind
\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528 lambda
\u5F62\u5F0F\u521B\u5EFA Result
\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- // Your code here.
-}.result {
- get(instance).set("something")
- get(instance).string()
- get(instance).cast<CustomClass>()
- get().boolean()
- all(instance)
- give()
- giveAll()
- onNoSuchField {}
-}
-
fun get(instance: Any?): Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
\u82E5\u6709\u591A\u4E2A Field
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u8F7B\u677E\u5730\u5F97\u5230 Field
\u7684\u5B9E\u4F8B\u4EE5\u53CA\u4F7F\u7528\u5B83\u8FDB\u884C\u8BBE\u7F6E\u5B9E\u4F8B\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- // Your code here.
-}.get(instance).set("something")
-
\u5982\u679C\u4F60\u53D6\u5230\u7684\u662F\u9759\u6001 Field
\uFF0C\u53EF\u4EE5\u4E0D\u9700\u8981\u8BBE\u7F6E\u5B9E\u4F8B\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- // Your code here.
-}.get().set("something")
-
fun all(instance: Any?): ArrayList<Instance>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Field
\u5B9E\u4F8B\u7ED3\u679C\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u901A\u8FC7\u6B64\u65B9\u6CD5\u6765\u83B7\u5F97\u5F53\u524D\u6761\u4EF6\u7ED3\u679C\u4E2D\u5339\u914D\u7684\u5168\u90E8 Field
\uFF0C\u5176 Field
\u6240\u5728\u5B9E\u4F8B\u7528\u6CD5\u4E0E get
\u76F8\u540C\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.self
-}
-
fun give(): Field?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Field
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Field \u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
fun giveAll(): HashSet<Field>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Field
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Field
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u82E5\u6709\u591A\u4E2A Field
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Field
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Field
\u5B9E\u4F8B\u7ED3\u679C\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA
Field
\u91CD\u67E5\u627E\u529F\u80FD\u3002
\u529F\u80FD\u793A\u4F8B
\u5F53\u4F60\u9047\u5230\u4E00\u79CD Field
\u53EF\u80FD\u5B58\u5728\u4E0D\u540C\u5F62\u5F0F\u7684\u5B58\u5728\u65F6\uFF0C\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u5B83\uFF0C\u800C\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528 onNoSuchField
\u6355\u83B7\u5F02\u5E38\u4E8C\u6B21\u67E5\u627E Field
\u3002
\u82E5\u7B2C\u4E00\u6B21\u67E5\u627E\u5931\u8D25\u4E86\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u8FD9\u91CC\u7EE7\u7EED\u6DFB\u52A0\u6B64\u65B9\u6CD5\u4F53\u76F4\u5230\u6210\u529F\u4E3A\u6B62\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- // Your code here.
-}.remedys {
- field {
- // Your code here.
- }
- field {
- // Your code here.
- }
-}
-
fun onNoSuchField(result: (Throwable) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u76D1\u542C\u627E\u4E0D\u5230
Field
\u65F6\u3002
fun ignored(): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
\u6CE8\u610F
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoSuchField \u65B9\u6CD5\u3002
inner class Instance internal constructor(private val instance: Any?, private val field: Field?)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u5B9E\u4F8B\u53D8\u91CF\u5904\u7406\u7C7B\u3002
fun current(ignored: Boolean): CurrentClass?
-
inline fun current(ignored: Boolean, initiate: CurrentClass.() -> Unit): Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
Field
\u81EA\u8EABself
\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61CurrentClass
\u3002
fun <T> cast(): T?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
\u5B9E\u4F8B\u3002
fun byte(): Byte?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Byte \u5B9E\u4F8B\u3002
fun int(): Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Int \u5B9E\u4F8B\u3002
fun long(): Long
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Long \u5B9E\u4F8B\u3002
fun short(): Short
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Short \u5B9E\u4F8B\u3002
fun double(): Double
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Double \u5B9E\u4F8B\u3002
fun float(): Float
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Float \u5B9E\u4F8B\u3002
fun string(): String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
String \u5B9E\u4F8B\u3002
fun char(): Char
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Char \u5B9E\u4F8B\u3002
fun boolean(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Boolean \u5B9E\u4F8B\u3002
fun any(): Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Any \u5B9E\u4F8B\u3002
inline fun <reified T> array(): Array<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
Array \u5B9E\u4F8B\u3002
inline fun <reified T> list(): List<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230\u5F53\u524D
Field
List \u5B9E\u4F8B\u3002
fun set(any: Any?)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u3002
fun setTrue()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u4E3Atrue
\u3002
\u7279\u522B\u6CE8\u610F
\u8BF7\u786E\u4FDD\u5B9E\u4F8B\u5BF9\u8C61\u7C7B\u578B\u4E3A Boolean\u3002
fun setFalse()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u4E3Afalse
\u3002
\u7279\u522B\u6CE8\u610F
\u8BF7\u786E\u4FDD\u5B9E\u4F8B\u5BF9\u8C61\u7C7B\u578B\u4E3A Boolean\u3002
fun setNull()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,315),p=[l];function c(t,r){return n(),o("div",null,p)}const i=s(e,[["render",c],["__file","FieldFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/FieldFinder.html.71816419.js b/docs/assets/FieldFinder.html.71816419.js deleted file mode 100644 index e74eb8d..0000000 --- a/docs/assets/FieldFinder.html.71816419.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-293ae898","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/members/FieldFinder.html","title":"FieldFinder - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"type - field","slug":"type-field","link":"#type-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"order - method","slug":"order-method","link":"#order-method","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"name - method","slug":"name-method-1","link":"#name-method-1","children":[]},{"level":2,"title":"type - method","slug":"type-method","link":"#type-method","children":[]},{"level":2,"title":"type - method","slug":"type-method-1","link":"#type-method-1","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"RemedyPlan - class","slug":"remedyplan-class","link":"#remedyplan-class","children":[{"level":3,"title":"field - method","slug":"field-method","link":"#field-method","children":[]},{"level":3,"title":"Result - class","slug":"result-class","link":"#result-class","children":[]}]},{"level":2,"title":"Result - class","slug":"result-class-1","link":"#result-class-1","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"give - method","slug":"give-method","link":"#give-method","children":[]},{"level":3,"title":"giveAll - method","slug":"giveall-method","link":"#giveall-method","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"remedys - method","slug":"remedys-method","link":"#remedys-method","children":[]},{"level":3,"title":"onNoSuchField - method","slug":"onnosuchfield-method","link":"#onnosuchfield-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]},{"level":3,"title":"Instance - class","slug":"instance-class","link":"#instance-class","children":[]}]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/members/FieldFinder.md"}');export{e as data}; diff --git a/docs/assets/FieldFinder.html.d5dcfef4.js b/docs/assets/FieldFinder.html.d5dcfef4.js deleted file mode 100644 index 571907f..0000000 --- a/docs/assets/FieldFinder.html.d5dcfef4.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-4b907076","path":"/en/api/public/com/highcapable/yukireflection/finder/members/FieldFinder.html","title":"FieldFinder - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"type - field","slug":"type-field","link":"#type-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"order - method","slug":"order-method","link":"#order-method","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"name - method","slug":"name-method-1","link":"#name-method-1","children":[]},{"level":2,"title":"type - method","slug":"type-method","link":"#type-method","children":[]},{"level":2,"title":"type - method","slug":"type-method-1","link":"#type-method-1","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"RemedyPlan - class","slug":"remedyplan-class","link":"#remedyplan-class","children":[{"level":3,"title":"field - method","slug":"field-method","link":"#field-method","children":[]},{"level":3,"title":"Result - class","slug":"result-class","link":"#result-class","children":[]}]},{"level":2,"title":"Result - class","slug":"result-class-1","link":"#result-class-1","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"give - method","slug":"give-method","link":"#give-method","children":[]},{"level":3,"title":"giveAll - method","slug":"giveall-method","link":"#giveall-method","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"remedys - method","slug":"remedys-method","link":"#remedys-method","children":[]},{"level":3,"title":"onNoSuchField - method","slug":"onnosuchfield-method","link":"#onnosuchfield-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]},{"level":3,"title":"Instance - class","slug":"instance-class","link":"#instance-class","children":[]}]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/members/FieldFinder.md"}');export{e as data}; diff --git a/docs/assets/FieldRules.html.0a9d082d.js b/docs/assets/FieldRules.html.0a9d082d.js deleted file mode 100644 index 4cfce38..0000000 --- a/docs/assets/FieldRules.html.0a9d082d.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-30993156","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/FieldRules.html","title":"FieldRules - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"type - field","slug":"type-field","link":"#type-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"type - method","slug":"type-method","link":"#type-method","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/FieldRules.md"}');export{e as data}; diff --git a/docs/assets/FieldRules.html.14cfcb37.js b/docs/assets/FieldRules.html.14cfcb37.js deleted file mode 100644 index 39c0b34..0000000 --- a/docs/assets/FieldRules.html.14cfcb37.js +++ /dev/null @@ -1,7 +0,0 @@ -import{_ as s,o,c as e,a}from"./app.2add9aa5.js";const n={},l=a(`\u8BBE\u7F6E\u5F53\u524D
Field
\u5B9E\u4F8B\u4E3Anull
\u3002
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
var name: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u540D\u79F0\u3002
var type: Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u7C7B\u578B\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
fun modifiers(conditions: ModifierConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun name(conditions: NameConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u540D\u79F0\u6761\u4EF6\u3002
fun type(conditions: ObjectConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Field
\u7C7B\u578B\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
`,39),p=[l];function c(t,r){return o(),e("div",null,p)}const i=s(n,[["render",c],["__file","FieldRules.html.vue"]]);export{i as default}; diff --git a/docs/assets/FieldRules.html.29bf58de.js b/docs/assets/FieldRules.html.29bf58de.js deleted file mode 100644 index 6cead1c..0000000 --- a/docs/assets/FieldRules.html.29bf58de.js +++ /dev/null @@ -1,7 +0,0 @@ -import{_ as s,o as e,c as o,a as n}from"./app.2add9aa5.js";const a={},l=n(`Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u540D\u79F0\u3002
var type: Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u7C7B\u578B\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun name(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u540D\u79F0\u6761\u4EF6\u3002
fun type(conditions: ObjectConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Field
\u7C7B\u578B\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u7C7B\u578B\u3002
`,40),p=[l];function t(c,r){return e(),o("div",null,p)}const i=s(a,[["render",t],["__file","FieldRules.html.vue"]]);export{i as default}; diff --git a/docs/assets/FieldRules.html.cc84b291.js b/docs/assets/FieldRules.html.cc84b291.js deleted file mode 100644 index 384b04b..0000000 --- a/docs/assets/FieldRules.html.cc84b291.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-82a85036","path":"/en/api/public/com/highcapable/yukireflection/finder/classes/rules/FieldRules.html","title":"FieldRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"type - field","slug":"type-field","link":"#type-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"type - method","slug":"type-method","link":"#type-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/classes/rules/FieldRules.md"}');export{e as data}; diff --git a/docs/assets/GenericClass.html.18ef844b.js b/docs/assets/GenericClass.html.18ef844b.js deleted file mode 100644 index ebf11a5..0000000 --- a/docs/assets/GenericClass.html.18ef844b.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-38df33ac","path":"/en/api/public/com/highcapable/yukireflection/bean/GenericClass.html","title":"GenericClass - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"argument - method","slug":"argument-method","link":"#argument-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/bean/GenericClass.md"}');export{e as data}; diff --git a/docs/assets/GenericClass.html.29e779a0.js b/docs/assets/GenericClass.html.29e779a0.js deleted file mode 100644 index 1bcfdf7..0000000 --- a/docs/assets/GenericClass.html.29e779a0.js +++ /dev/null @@ -1,4 +0,0 @@ -import{_ as s,o as a,c as n,a as o}from"./app.2add9aa5.js";const e={},l=o(`Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class GenericClass internal constructor(private val type: ParameterizedType)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Class
\u7684\u6CDB\u578B\u7236\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
fun argument(index: Int): Class<*>
-
inline fun <reified T> argument(index: Int): Class<T>
-
Change Records
v1.0.0
first
Function Illustrate
`,14),p=[l];function t(c,r){return a(),n("div",null,p)}const y=s(e,[["render",t],["__file","GenericClass.html.vue"]]);export{y as default}; diff --git a/docs/assets/GenericClass.html.80c441b8.js b/docs/assets/GenericClass.html.80c441b8.js deleted file mode 100644 index 77abfa9..0000000 --- a/docs/assets/GenericClass.html.80c441b8.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-c5831246","path":"/zh-cn/api/public/com/highcapable/yukireflection/bean/GenericClass.html","title":"GenericClass - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"argument - method","slug":"argument-method","link":"#argument-method","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/bean/GenericClass.md"}');export{e as data}; diff --git a/docs/assets/GenericClass.html.937c5c5e.js b/docs/assets/GenericClass.html.937c5c5e.js deleted file mode 100644 index 1af279c..0000000 --- a/docs/assets/GenericClass.html.937c5c5e.js +++ /dev/null @@ -1,4 +0,0 @@ -import{_ as s,o as a,c as n,a as o}from"./app.2add9aa5.js";const l={},e=o(`\u83B7\u5F97\u6CDB\u578B\u53C2\u6570\u6570\u7EC4\u4E0B\u6807\u7684
Class
\u5B9E\u4F8B\u3002
class GenericClass internal constructor(private val type: ParameterizedType)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Class
\u7684\u6CDB\u578B\u7236\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
fun argument(index: Int): Class<*>
-
inline fun <reified T> argument(index: Int): Class<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,13),p=[e];function c(t,r){return a(),n("div",null,p)}const i=s(l,[["render",c],["__file","GenericClass.html.vue"]]);export{i as default}; diff --git a/docs/assets/GraphicsTypeFactory.html.0a5a863c.js b/docs/assets/GraphicsTypeFactory.html.0a5a863c.js deleted file mode 100644 index 000a3d6..0000000 --- a/docs/assets/GraphicsTypeFactory.html.0a5a863c.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-5a1019d6","path":"/en/api/public/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.html","title":"GraphicsTypeFactory - kt","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":3}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/GraphicsTypeFactory.html.3ab9700c.js b/docs/assets/GraphicsTypeFactory.html.3ab9700c.js deleted file mode 100644 index cc95905..0000000 --- a/docs/assets/GraphicsTypeFactory.html.3ab9700c.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-25cdee85","path":"/zh-cn/api/public/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.html","title":"GraphicsTypeFactory - kt","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/GraphicsTypeFactory.html.c2987428.js b/docs/assets/GraphicsTypeFactory.html.c2987428.js deleted file mode 100644 index 66b5de3..0000000 --- a/docs/assets/GraphicsTypeFactory.html.c2987428.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,r as c,o as n,c as r,b as t,d as s,a as i,e}from"./app.2add9aa5.js";const p={},l=i('\u83B7\u5F97\u6CDB\u578B\u53C2\u6570\u6570\u7EC4\u4E0B\u6807\u7684
Class
\u5B9E\u4F8B\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
',6),d=e("\u8BE6\u60C5\u53EF "),h={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},_=e("\u70B9\u51FB\u8FD9\u91CC"),u=e(" \u8FDB\u884C\u67E5\u770B\u3002");function f(m,g){const o=c("ExternalLinkIcon");return n(),r("div",null,[l,t("p",null,[d,t("a",h,[_,s(o)]),u])])}const k=a(p,[["render",f],["__file","GraphicsTypeFactory.html.vue"]]);export{k as default}; diff --git a/docs/assets/GraphicsTypeFactory.html.d8c3b342.js b/docs/assets/GraphicsTypeFactory.html.d8c3b342.js deleted file mode 100644 index c366094..0000000 --- a/docs/assets/GraphicsTypeFactory.html.d8c3b342.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as c,r as a,o as r,c as s,b as o,d as n,a as i,e}from"./app.2add9aa5.js";const p={},d=i('\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Android
\u76F8\u5173Graphics
\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
',5),l=e("\u8BE6\u60C5\u53EF "),h={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},_=e("\u70B9\u51FB\u8FD9\u91CC"),f=e(" \u8FDB\u884C\u67E5\u770B\u3002");function y(k,m){const t=a("ExternalLinkIcon");return r(),s("div",null,[d,o("p",null,[l,o("a",h,[_,n(t)]),f])])}const b=c(p,[["render",y],["__file","GraphicsTypeFactory.html.vue"]]);export{b as default}; diff --git a/docs/assets/MemberRules.html.2d5c89a4.js b/docs/assets/MemberRules.html.2d5c89a4.js deleted file mode 100644 index b1805a8..0000000 --- a/docs/assets/MemberRules.html.2d5c89a4.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-71ecb893","path":"/en/api/public/com/highcapable/yukireflection/finder/classes/rules/MemberRules.html","title":"MemberRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/classes/rules/MemberRules.md"}');export{e as data}; diff --git a/docs/assets/MemberRules.html.94fb57e3.js b/docs/assets/MemberRules.html.94fb57e3.js deleted file mode 100644 index 379e2ab..0000000 --- a/docs/assets/MemberRules.html.94fb57e3.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-3daa8d42","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/MemberRules.html","title":"MemberRules - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/MemberRules.md"}');export{e as data}; diff --git a/docs/assets/MemberRules.html.e6dd0524.js b/docs/assets/MemberRules.html.e6dd0524.js deleted file mode 100644 index 278f5c8..0000000 --- a/docs/assets/MemberRules.html.e6dd0524.js +++ /dev/null @@ -1,3 +0,0 @@ -import{_ as s,o as e,c as o,a}from"./app.2add9aa5.js";const n={},l=a(`\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Android
\u76F8\u5173Graphics
\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Member
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Member
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
`,14),t=[l];function r(c,p){return e(),o("div",null,t)}const d=s(n,[["render",r],["__file","MemberRules.html.vue"]]);export{d as default}; diff --git a/docs/assets/MemberRules.html.fb90baae.js b/docs/assets/MemberRules.html.fb90baae.js deleted file mode 100644 index 82323ca..0000000 --- a/docs/assets/MemberRules.html.fb90baae.js +++ /dev/null @@ -1,3 +0,0 @@ -import{_ as s,o as e,c as o,a}from"./app.2add9aa5.js";const n={},l=a(`class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Member
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
fun modifiers(conditions: ModifierConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Member
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
`,13),p=[l];function c(r,t){return e(),o("div",null,p)}const i=s(n,[["render",c],["__file","MemberRules.html.vue"]]);export{i as default}; diff --git a/docs/assets/MemberRulesResult.html.0030e851.js b/docs/assets/MemberRulesResult.html.0030e851.js deleted file mode 100644 index 9cfef58..0000000 --- a/docs/assets/MemberRulesResult.html.0030e851.js +++ /dev/null @@ -1,6 +0,0 @@ -import{_ as s,o as e,c as o,a as n}from"./app.2add9aa5.js";const a={},l=n(`Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MemberRulesResult internal constructor(private val rulesData: MemberRulesData)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Member
\u67E5\u627E\u6761\u4EF6\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun none(): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u4E2A\u6570\u4E3A0
\u3002
fun count(num: Int): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u9700\u8981\u5168\u90E8\u5339\u914D\u7684\u4E2A\u6570\u3002
fun count(numRange: IntRange): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u9700\u8981\u5168\u90E8\u5339\u914D\u7684\u4E2A\u6570\u8303\u56F4\u3002
fun count(conditions: CountConditions): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
`,31),t=[l];function c(p,r){return e(),o("div",null,t)}const i=s(a,[["render",c],["__file","MemberRulesResult.html.vue"]]);export{i as default}; diff --git a/docs/assets/MemberRulesResult.html.0df424dd.js b/docs/assets/MemberRulesResult.html.0df424dd.js deleted file mode 100644 index 536a37b..0000000 --- a/docs/assets/MemberRulesResult.html.0df424dd.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-4f47dfda","path":"/en/api/public/com/highcapable/yukireflection/finder/classes/rules/result/MemberRulesResult.html","title":"MemberRulesResult - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"none - method","slug":"none-method","link":"#none-method","children":[]},{"level":2,"title":"count - method","slug":"count-method","link":"#count-method","children":[]},{"level":2,"title":"count - method","slug":"count-method-1","link":"#count-method-1","children":[]},{"level":2,"title":"count - method","slug":"count-method-2","link":"#count-method-2","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/classes/rules/result/MemberRulesResult.md"}');export{e as data}; diff --git a/docs/assets/MemberRulesResult.html.230c0739.js b/docs/assets/MemberRulesResult.html.230c0739.js deleted file mode 100644 index 3f53db2..0000000 --- a/docs/assets/MemberRulesResult.html.230c0739.js +++ /dev/null @@ -1,6 +0,0 @@ -import{_ as s,o,c as e,a as n}from"./app.2add9aa5.js";const a={},l=n(`\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u9700\u8981\u5168\u90E8\u5339\u914D\u7684\u4E2A\u6570\u6761\u4EF6\u3002
class MemberRulesResult internal constructor(private val rulesData: MemberRulesData)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Member
\u67E5\u627E\u6761\u4EF6\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun none(): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u4E2A\u6570\u4E3A0
\u3002
fun count(num: Int): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u9700\u8981\u5168\u90E8\u5339\u914D\u7684\u4E2A\u6570\u3002
fun count(numRange: IntRange): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u9700\u8981\u5168\u90E8\u5339\u914D\u7684\u4E2A\u6570\u8303\u56F4\u3002
fun count(conditions: CountConditions): MemberRulesResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,30),p=[l];function c(t,r){return o(),e("div",null,p)}const u=s(a,[["render",c],["__file","MemberRulesResult.html.vue"]]);export{u as default}; diff --git a/docs/assets/MemberRulesResult.html.aa74ca3c.js b/docs/assets/MemberRulesResult.html.aa74ca3c.js deleted file mode 100644 index 71ad784..0000000 --- a/docs/assets/MemberRulesResult.html.aa74ca3c.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-503f5f8b","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/result/MemberRulesResult.html","title":"MemberRulesResult - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"none - method","slug":"none-method","link":"#none-method","children":[]},{"level":2,"title":"count - method","slug":"count-method","link":"#count-method","children":[]},{"level":2,"title":"count - method","slug":"count-method-1","link":"#count-method-1","children":[]},{"level":2,"title":"count - method","slug":"count-method-2","link":"#count-method-2","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/result/MemberRulesResult.md"}');export{e as data}; diff --git a/docs/assets/MethodFinder.html.30643f39.js b/docs/assets/MethodFinder.html.30643f39.js deleted file mode 100644 index c8a2738..0000000 --- a/docs/assets/MethodFinder.html.30643f39.js +++ /dev/null @@ -1,81 +0,0 @@ -import{_ as s,o,c as n,a}from"./app.2add9aa5.js";const e={},l=a(`\u8BBE\u7F6E\u5F53\u524D
Member
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u9700\u8981\u5168\u90E8\u5339\u914D\u7684\u4E2A\u6570\u6761\u4EF6\u3002
class MethodFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Method
\u67E5\u627E\u7C7B\u3002
\u53EF\u901A\u8FC7\u6307\u5B9A\u7C7B\u578B\u67E5\u627E\u6307\u5B9A Method
\u6216\u4E00\u7EC4 Method
\u3002
var name: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u540D\u79F0\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
var paramCount: Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
var returnType: Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\uFF0C\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun emptyParam(): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Method
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType \u6765\u66FF\u4EE3\u5B83\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun order(): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u987A\u5E8F\u7B5B\u9009\u5B57\u8282\u7801\u7684\u4E0B\u6807\u3002
fun name(value: String): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u540D\u79F0\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun name(conditions: NameConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u540D\u79F0\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(num: Int): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(numRange: IntRange): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun returnType(value: Any): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun returnType(conditions: ObjectConditions): IndexTypeCondition
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
\u7279\u522B\u6CE8\u610F
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun superClass(isOnlySuperClass: Boolean)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E\u5728
classSet
\u7684\u6240\u6709\u7236\u7C7B\u4E2D\u67E5\u627E\u5F53\u524DMethod
\u3002
\u6CE8\u610F
\u82E5\u5F53\u524D classSet \u7684\u7236\u7C7B\u8F83\u591A\u53EF\u80FD\u4F1A\u8017\u65F6\uFF0CAPI \u4F1A\u81EA\u52A8\u5FAA\u73AF\u5230\u7236\u7C7B\u7EE7\u627F\u662F Any \u524D\u7684\u6700\u540E\u4E00\u4E2A\u7C7B\u3002
inner class RemedyPlan internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Method
\u91CD\u67E5\u627E\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u7D2F\u8BA1\u5931\u8D25\u6B21\u6570\u76F4\u5230\u67E5\u627E\u6210\u529F\u3002
inline fun method(initiate: MethodConditions): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u9700\u8981\u91CD\u65B0\u67E5\u627E\u7684
Method
\u3002
\u4F60\u53EF\u4EE5\u6DFB\u52A0\u591A\u4E2A\u5907\u9009 Method
\uFF0C\u76F4\u5230\u6210\u529F\u4E3A\u6B62\uFF0C\u82E5\u6700\u540E\u4F9D\u7136\u5931\u8D25\uFF0C\u5C06\u505C\u6B62\u67E5\u627E\u5E76\u8F93\u51FA\u9519\u8BEF\u65E5\u5FD7\u3002
inner class Result internal constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
RemedyPlan
\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun onFind(initiate: HashSet<Method>.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u5728
RemedyPlan
\u4E2D\u627E\u5230\u7ED3\u679C\u65F6\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u65B9\u4FBF\u5730\u5BF9\u91CD\u67E5\u627E\u7684 Method
\u5B9E\u73B0 onFind
\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Method
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528 lambda
\u5F62\u5F0F\u521B\u5EFA Result
\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // Your code here.
-}.result {
- get(instance).call()
- all(instance)
- remedys {}
- onNoSuchMethod {}
-}
-
fun get(instance: Any?): Instance
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
\u82E5\u6709\u591A\u4E2A Method
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u8BF7\u4F7F\u7528 wait \u56DE\u8C03\u7ED3\u679C\u65B9\u6CD5\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u901A\u8FC7\u83B7\u5F97\u65B9\u6CD5\u6240\u5728\u5B9E\u4F8B\u6765\u6267\u884C Method
\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // Your code here.
-}.get(instance).call()
-
\u82E5\u5F53\u524D\u4E3A\u9759\u6001\u65B9\u6CD5\uFF0C\u4F60\u53EF\u4EE5\u4E0D\u8BBE\u7F6E\u5B9E\u4F8B\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // Your code here.
-}.get().call()
-
fun all(instance: Any?): ArrayList<Instance>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Method
\u5B9E\u4F8B\u7ED3\u679C\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u901A\u8FC7\u6B64\u65B9\u6CD5\u6765\u83B7\u5F97\u5F53\u524D\u6761\u4EF6\u7ED3\u679C\u4E2D\u5339\u914D\u7684\u5168\u90E8 Method
\uFF0C\u5176\u65B9\u6CD5\u6240\u5728\u5B9E\u4F8B\u7528\u6CD5\u4E0E get
\u76F8\u540C\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.call(...)
-}
-
fun give(): Method?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Method
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Method
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
fun giveAll(): HashSet<Method>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F97\u5230
Method
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Method
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u82E5\u6709\u591A\u4E2A Method
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Method
\u5B9E\u4F8B\u7ED3\u679C\u3002
\u7279\u522B\u6CE8\u610F
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u521B\u5EFA
Method
\u91CD\u67E5\u627E\u529F\u80FD\u3002
\u529F\u80FD\u793A\u4F8B
\u5F53\u4F60\u9047\u5230\u4E00\u79CD Method
\u53EF\u80FD\u5B58\u5728\u4E0D\u540C\u5F62\u5F0F\u7684\u5B58\u5728\u65F6\uFF0C\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u5B83\uFF0C\u800C\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528 onNoSuchMethod
\u6355\u83B7\u5F02\u5E38\u4E8C\u6B21\u67E5\u627E Method
\u3002
\u82E5\u7B2C\u4E00\u6B21\u67E5\u627E\u5931\u8D25\u4E86\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u8FD9\u91CC\u7EE7\u7EED\u6DFB\u52A0\u6B64\u65B9\u6CD5\u4F53\u76F4\u5230\u6210\u529F\u4E3A\u6B62\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // Your code here.
-}.remedys {
- method {
- // Your code here.
- }
- method {
- // Your code here.
- }
-}
-
inline fun onNoSuchMethod(result: (Throwable) -> Unit): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u76D1\u542C\u627E\u4E0D\u5230
Method
\u65F6\u3002
\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u6B21\u7684\u9519\u8BEF\u4FE1\u606F\uFF0C\u4E0D\u4F1A\u8FD4\u56DE RemedyPlan
\u7684\u9519\u8BEF\u4FE1\u606F\u3002
fun ignored(): Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
\u6CE8\u610F
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoSuchMethod \u65B9\u6CD5\u3002
inner class Instance internal constructor(private val instance: Any?, private val method: Method?)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
fun call(vararg args: Any?): Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u4E0D\u6307\u5B9A\u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun <T> invoke(vararg args: Any?): T?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9AT
\u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun byte(vararg args: Any?): Byte?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Byte \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun int(vararg args: Any?): Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Int \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun long(vararg args: Any?): Long
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Long \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun short(vararg args: Any?): Short
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Short \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun double(vararg args: Any?): Double
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Double \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun float(vararg args: Any?): Float
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Float \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun string(vararg args: Any?): String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A String \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun char(vararg args: Any?): Char
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Char \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun boolean(vararg args: Any?): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Boolean \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
inline fun <reified T> array(vararg args: Any?): Array<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Array \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
inline fun <reified T> list(vararg args: Any?): List<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,338),p=[l];function c(t,r){return o(),n("div",null,p)}const i=s(e,[["render",c],["__file","MethodFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/MethodFinder.html.3e0643fa.js b/docs/assets/MethodFinder.html.3e0643fa.js deleted file mode 100644 index 42e53f5..0000000 --- a/docs/assets/MethodFinder.html.3e0643fa.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-155c9f97","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/members/MethodFinder.html","title":"MethodFinder - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"paramCount - field","slug":"paramcount-field","link":"#paramcount-field","children":[]},{"level":2,"title":"returnType - field","slug":"returntype-field","link":"#returntype-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"emptyParam - method","slug":"emptyparam-method","link":"#emptyparam-method","children":[]},{"level":2,"title":"param - method","slug":"param-method","link":"#param-method","children":[]},{"level":2,"title":"param - method","slug":"param-method-1","link":"#param-method-1","children":[]},{"level":2,"title":"order - method","slug":"order-method","link":"#order-method","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"name - method","slug":"name-method-1","link":"#name-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method","link":"#paramcount-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-1","link":"#paramcount-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-2","link":"#paramcount-method-2","children":[]},{"level":2,"title":"returnType - method","slug":"returntype-method","link":"#returntype-method","children":[]},{"level":2,"title":"returnType - method","slug":"returntype-method-1","link":"#returntype-method-1","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"RemedyPlan - class","slug":"remedyplan-class","link":"#remedyplan-class","children":[{"level":3,"title":"method - method","slug":"method-method","link":"#method-method","children":[]},{"level":3,"title":"Result - class","slug":"result-class","link":"#result-class","children":[]}]},{"level":2,"title":"Result - class","slug":"result-class-1","link":"#result-class-1","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"give - method","slug":"give-method","link":"#give-method","children":[]},{"level":3,"title":"giveAll - method","slug":"giveall-method","link":"#giveall-method","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"remedys - method","slug":"remedys-method","link":"#remedys-method","children":[]},{"level":3,"title":"onNoSuchMethod - method","slug":"onnosuchmethod-method","link":"#onnosuchmethod-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]},{"level":3,"title":"Instance - class","slug":"instance-class","link":"#instance-class","children":[]},{"level":3,"title":"array - method","slug":"array-method","link":"#array-method","children":[]},{"level":3,"title":"list - method","slug":"list-method","link":"#list-method","children":[]}]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/members/MethodFinder.md"}');export{e as data}; diff --git a/docs/assets/MethodFinder.html.704be21f.js b/docs/assets/MethodFinder.html.704be21f.js deleted file mode 100644 index 8c65f61..0000000 --- a/docs/assets/MethodFinder.html.704be21f.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-012ee5a6","path":"/en/api/public/com/highcapable/yukireflection/finder/members/MethodFinder.html","title":"MethodFinder - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"paramCount - field","slug":"paramcount-field","link":"#paramcount-field","children":[]},{"level":2,"title":"returnType - field","slug":"returntype-field","link":"#returntype-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"emptyParam - method","slug":"emptyparam-method","link":"#emptyparam-method","children":[]},{"level":2,"title":"param - method","slug":"param-method","link":"#param-method","children":[]},{"level":2,"title":"param - method","slug":"param-method-1","link":"#param-method-1","children":[]},{"level":2,"title":"order - method","slug":"order-method","link":"#order-method","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"name - method","slug":"name-method-1","link":"#name-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method","link":"#paramcount-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-1","link":"#paramcount-method-1","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-2","link":"#paramcount-method-2","children":[]},{"level":2,"title":"returnType - method","slug":"returntype-method","link":"#returntype-method","children":[]},{"level":2,"title":"returnType - method","slug":"returntype-method-1","link":"#returntype-method-1","children":[]},{"level":2,"title":"superClass - method","slug":"superclass-method","link":"#superclass-method","children":[]},{"level":2,"title":"RemedyPlan - class","slug":"remedyplan-class","link":"#remedyplan-class","children":[{"level":3,"title":"method - method","slug":"method-method","link":"#method-method","children":[]},{"level":3,"title":"Result - class","slug":"result-class","link":"#result-class","children":[]}]},{"level":2,"title":"Result - class","slug":"result-class-1","link":"#result-class-1","children":[{"level":3,"title":"result - method","slug":"result-method","link":"#result-method","children":[]},{"level":3,"title":"get - method","slug":"get-method","link":"#get-method","children":[]},{"level":3,"title":"all - method","slug":"all-method","link":"#all-method","children":[]},{"level":3,"title":"give - method","slug":"give-method","link":"#give-method","children":[]},{"level":3,"title":"giveAll - method","slug":"giveall-method","link":"#giveall-method","children":[]},{"level":3,"title":"wait - method","slug":"wait-method","link":"#wait-method","children":[]},{"level":3,"title":"waitAll - method","slug":"waitall-method","link":"#waitall-method","children":[]},{"level":3,"title":"remedys - method","slug":"remedys-method","link":"#remedys-method","children":[]},{"level":3,"title":"onNoSuchMethod - method","slug":"onnosuchmethod-method","link":"#onnosuchmethod-method","children":[]},{"level":3,"title":"ignored - method","slug":"ignored-method","link":"#ignored-method","children":[]},{"level":3,"title":"Instance - class","slug":"instance-class","link":"#instance-class","children":[]},{"level":3,"title":"array - method","slug":"array-method","link":"#array-method","children":[]},{"level":3,"title":"list - method","slug":"list-method","link":"#list-method","children":[]}]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/members/MethodFinder.md"}');export{e as data}; diff --git a/docs/assets/MethodFinder.html.bae1e13a.js b/docs/assets/MethodFinder.html.bae1e13a.js deleted file mode 100644 index 314f923..0000000 --- a/docs/assets/MethodFinder.html.bae1e13a.js +++ /dev/null @@ -1,81 +0,0 @@ -import{_ as s,o as n,c as o,a}from"./app.2add9aa5.js";const e={},l=a(`\u6267\u884C
Method
\uFF0C\u6307\u5B9A List \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MethodFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Method
\u67E5\u627E\u7C7B\u3002
\u53EF\u901A\u8FC7\u6307\u5B9A\u7C7B\u578B\u67E5\u627E\u6307\u5B9A Method
\u6216\u4E00\u7EC4 Method
\u3002
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u540D\u79F0\u3002
Pay Attention
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
var returnType: Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\uFF0C\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun emptyParam(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Method
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType \u6765\u66FF\u4EE3\u5B83\u3002
Pay Attention
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u6761\u4EF6\u3002
Pay Attention
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun order(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u987A\u5E8F\u7B5B\u9009\u5B57\u8282\u7801\u7684\u4E0B\u6807\u3002
fun name(value: String): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u540D\u79F0\u3002
Pay Attention
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun name(conditions: NameConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u540D\u79F0\u6761\u4EF6\u3002
Pay Attention
\u82E5\u4E0D\u586B\u5199\u540D\u79F0\u5219\u5FC5\u987B\u5B58\u5728\u4E00\u4E2A\u5176\u5B83\u6761\u4EF6\u3002
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(num: Int): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(numRange: IntRange): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun returnType(value: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun returnType(conditions: ObjectConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
Pay Attention
\u5B58\u5728\u591A\u4E2A IndexTypeCondition \u65F6\u9664\u4E86 order \u53EA\u4F1A\u751F\u6548\u6700\u540E\u4E00\u4E2A\u3002
fun superClass(isOnlySuperClass: Boolean)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E\u5728
classSet
\u7684\u6240\u6709\u7236\u7C7B\u4E2D\u67E5\u627E\u5F53\u524DMethod
\u3002
Notice
\u82E5\u5F53\u524D classSet \u7684\u7236\u7C7B\u8F83\u591A\u53EF\u80FD\u4F1A\u8017\u65F6\uFF0CAPI \u4F1A\u81EA\u52A8\u5FAA\u73AF\u5230\u7236\u7C7B\u7EE7\u627F\u662F Any \u524D\u7684\u6700\u540E\u4E00\u4E2A\u7C7B\u3002
inner class RemedyPlan internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
Method
\u91CD\u67E5\u627E\u5B9E\u73B0\u7C7B\uFF0C\u53EF\u7D2F\u8BA1\u5931\u8D25\u6B21\u6570\u76F4\u5230\u67E5\u627E\u6210\u529F\u3002
inline fun method(initiate: MethodConditions): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u9700\u8981\u91CD\u65B0\u67E5\u627E\u7684
Method
\u3002
\u4F60\u53EF\u4EE5\u6DFB\u52A0\u591A\u4E2A\u5907\u9009 Method
\uFF0C\u76F4\u5230\u6210\u529F\u4E3A\u6B62\uFF0C\u82E5\u6700\u540E\u4F9D\u7136\u5931\u8D25\uFF0C\u5C06\u505C\u6B62\u67E5\u627E\u5E76\u8F93\u51FA\u9519\u8BEF\u65E5\u5FD7\u3002
inner class Result internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
RemedyPlan
\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
fun onFind(initiate: HashSet<Method>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u5728
RemedyPlan
\u4E2D\u627E\u5230\u7ED3\u679C\u65F6\u3002
Function Example
\u4F60\u53EF\u4EE5\u65B9\u4FBF\u5730\u5BF9\u91CD\u67E5\u627E\u7684 Method
\u5B9E\u73B0 onFind
\u65B9\u6CD5\u3002
The following example
method {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Method
\u67E5\u627E\u7ED3\u679C\u5B9E\u73B0\u7C7B\u3002
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA\u76D1\u542C\u7ED3\u679C\u4E8B\u4EF6\u65B9\u6CD5\u4F53\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528 lambda
\u5F62\u5F0F\u521B\u5EFA Result
\u7C7B\u3002
The following example
method {
- // Your code here.
-}.result {
- get(instance).call()
- all(instance)
- remedys {}
- onNoSuchMethod {}
-}
-
fun get(instance: Any?): Instance
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
\u82E5\u6709\u591A\u4E2A Method
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u8BF7\u4F7F\u7528 wait \u56DE\u8C03\u7ED3\u679C\u65B9\u6CD5\u3002
Function Example
\u4F60\u53EF\u4EE5\u901A\u8FC7\u83B7\u5F97\u65B9\u6CD5\u6240\u5728\u5B9E\u4F8B\u6765\u6267\u884C Method
\u3002
The following example
method {
- // Your code here.
-}.get(instance).call()
-
\u82E5\u5F53\u524D\u4E3A\u9759\u6001\u65B9\u6CD5\uFF0C\u4F60\u53EF\u4EE5\u4E0D\u8BBE\u7F6E\u5B9E\u4F8B\u3002
The following example
method {
- // Your code here.
-}.get().call()
-
fun all(instance: Any?): ArrayList<Instance>
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Method
\u5B9E\u4F8B\u7ED3\u679C\u3002
Function Example
\u4F60\u53EF\u4EE5\u901A\u8FC7\u6B64\u65B9\u6CD5\u6765\u83B7\u5F97\u5F53\u524D\u6761\u4EF6\u7ED3\u679C\u4E2D\u5339\u914D\u7684\u5168\u90E8 Method
\uFF0C\u5176\u65B9\u6CD5\u6240\u5728\u5B9E\u4F8B\u7528\u6CD5\u4E0E get
\u76F8\u540C\u3002
The following example
method {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.call(...)
-}
-
fun give(): Method?
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Method
\u672C\u8EAB\u3002
\u82E5\u6709\u591A\u4E2A Method
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE null
\u3002
fun giveAll(): HashSet<Method>
-
Change Records
v1.0.0
first
Function Illustrate
\u5F97\u5230
Method
\u672C\u8EAB\u6570\u7EC4\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Method
\u5B9E\u4F8B\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u627E\u4E0D\u5230\u4EFB\u4F55\u7ED3\u679C\u7684\u65F6\u5019\u5C06\u8FD4\u56DE\u7A7A\u7684 HashSet
\u3002
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u82E5\u6709\u591A\u4E2A Method
\u7ED3\u679C\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u4E2A\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u6570\u7EC4\uFF0C\u914D\u5408RemedyPlan
\u4F7F\u7528\u3002
\u8FD4\u56DE\u5168\u90E8\u67E5\u627E\u6761\u4EF6\u5339\u914D\u7684\u591A\u4E2A Method
\u5B9E\u4F8B\u7ED3\u679C\u3002
Pay Attention
\u82E5\u4F60\u8BBE\u7F6E\u4E86 remedys \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u624D\u80FD\u83B7\u5F97\u7ED3\u679C\u3002
\u82E5\u4F60\u6CA1\u6709\u8BBE\u7F6E remedys \u6B64\u65B9\u6CD5\u5C06\u4E0D\u4F1A\u88AB\u56DE\u8C03\u3002
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u521B\u5EFA
Method
\u91CD\u67E5\u627E\u529F\u80FD\u3002
Function Example
\u5F53\u4F60\u9047\u5230\u4E00\u79CD Method
\u53EF\u80FD\u5B58\u5728\u4E0D\u540C\u5F62\u5F0F\u7684\u5B58\u5728\u65F6\uFF0C\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u5B83\uFF0C\u800C\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528 onNoSuchMethod
\u6355\u83B7\u5F02\u5E38\u4E8C\u6B21\u67E5\u627E Method
\u3002
\u82E5\u7B2C\u4E00\u6B21\u67E5\u627E\u5931\u8D25\u4E86\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u8FD9\u91CC\u7EE7\u7EED\u6DFB\u52A0\u6B64\u65B9\u6CD5\u4F53\u76F4\u5230\u6210\u529F\u4E3A\u6B62\u3002
The following example
method {
- // Your code here.
-}.remedys {
- method {
- // Your code here.
- }
- method {
- // Your code here.
- }
-}
-
inline fun onNoSuchMethod(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u76D1\u542C\u627E\u4E0D\u5230
Method
\u65F6\u3002
\u53EA\u4F1A\u8FD4\u56DE\u7B2C\u4E00\u6B21\u7684\u9519\u8BEF\u4FE1\u606F\uFF0C\u4E0D\u4F1A\u8FD4\u56DE RemedyPlan
\u7684\u9519\u8BEF\u4FE1\u606F\u3002
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
\u5FFD\u7565\u5F02\u5E38\u5E76\u505C\u6B62\u6253\u5370\u4EFB\u4F55\u9519\u8BEF\u65E5\u5FD7\u3002
Notice
\u6B64\u65F6\u82E5\u8981\u76D1\u542C\u5F02\u5E38\u7ED3\u679C\uFF0C\u4F60\u9700\u8981\u624B\u52A8\u5B9E\u73B0 onNoSuchMethod \u65B9\u6CD5\u3002
inner class Instance internal constructor(private val instance: Any?, private val method: Method?)
-
Change Records
v1.0.0
first
Function Illustrate
Method
\u5B9E\u4F8B\u5904\u7406\u7C7B\u3002
fun call(vararg args: Any?): Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u4E0D\u6307\u5B9A\u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun <T> invoke(vararg args: Any?): T?
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9AT
\u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun byte(vararg args: Any?): Byte?
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Byte \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun int(vararg args: Any?): Int
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Int \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun long(vararg args: Any?): Long
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Long \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun short(vararg args: Any?): Short
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Short \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun double(vararg args: Any?): Double
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Double \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun float(vararg args: Any?): Float
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Float \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun string(vararg args: Any?): String
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A String \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun char(vararg args: Any?): Char
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Char \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
fun boolean(vararg args: Any?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Boolean \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
inline fun <reified T> array(vararg args: Any?): Array<T>
-
Change Records
v1.0.0
first
Function Illustrate
\u6267\u884C
Method
\uFF0C\u6307\u5B9A Array \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
inline fun <reified T> list(vararg args: Any?): List<T>
-
Change Records
v1.0.0
first
Function Illustrate
`,339),p=[l];function t(c,r){return n(),o("div",null,p)}const i=s(e,[["render",t],["__file","MethodFinder.html.vue"]]);export{i as default}; diff --git a/docs/assets/MethodRules.html.46e12f82.js b/docs/assets/MethodRules.html.46e12f82.js deleted file mode 100644 index 73bc05d..0000000 --- a/docs/assets/MethodRules.html.46e12f82.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-5e7e121a","path":"/en/api/public/com/highcapable/yukireflection/finder/classes/rules/MethodRules.html","title":"MethodRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"paramCount - field","slug":"paramcount-field","link":"#paramcount-field","children":[]},{"level":2,"title":"returnType - field","slug":"returntype-field","link":"#returntype-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"emptyParam - method","slug":"emptyparam-method","link":"#emptyparam-method","children":[]},{"level":2,"title":"param - method","slug":"param-method","link":"#param-method","children":[]},{"level":2,"title":"param - method","slug":"param-method-1","link":"#param-method-1","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method","link":"#paramcount-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-1","link":"#paramcount-method-1","children":[]},{"level":2,"title":"returnType - method","slug":"returntype-method","link":"#returntype-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/classes/rules/MethodRules.md"}');export{e as data}; diff --git a/docs/assets/MethodRules.html.a2613ed0.js b/docs/assets/MethodRules.html.a2613ed0.js deleted file mode 100644 index daada14..0000000 --- a/docs/assets/MethodRules.html.a2613ed0.js +++ /dev/null @@ -1,13 +0,0 @@ -import{_ as s,o,c as a,a as e}from"./app.2add9aa5.js";const n={},p=e(`\u6267\u884C
Method
\uFF0C\u6307\u5B9A List \u8FD4\u56DE\u503C\u7C7B\u578B\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Method
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u540D\u79F0\u3002
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
var returnType: Any?
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun emptyParam()
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Method
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType
\u6765\u66FF\u4EE3\u5B83\u3002
Pay Attention
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun param(conditions: ObjectsConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u6761\u4EF6\u3002
Pay Attention
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun name(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u540D\u79F0\u6761\u4EF6\u3002
fun paramCount(numRange: IntRange)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
fun paramCount(conditions: CountConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
fun returnType(conditions: ObjectConditions)
-
Change Records
v1.0.0
first
Function Illustrate
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
`,84),t=[p];function l(c,r){return o(),a("div",null,t)}const i=s(n,[["render",l],["__file","MethodRules.html.vue"]]);export{i as default}; diff --git a/docs/assets/MethodRules.html.c94c00ea.js b/docs/assets/MethodRules.html.c94c00ea.js deleted file mode 100644 index f30b80e..0000000 --- a/docs/assets/MethodRules.html.c94c00ea.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-2a3be6c9","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/MethodRules.html","title":"MethodRules - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"name - field","slug":"name-field","link":"#name-field","children":[]},{"level":2,"title":"paramCount - field","slug":"paramcount-field","link":"#paramcount-field","children":[]},{"level":2,"title":"returnType - field","slug":"returntype-field","link":"#returntype-field","children":[]},{"level":2,"title":"modifiers - method","slug":"modifiers-method","link":"#modifiers-method","children":[]},{"level":2,"title":"emptyParam - method","slug":"emptyparam-method","link":"#emptyparam-method","children":[]},{"level":2,"title":"param - method","slug":"param-method","link":"#param-method","children":[]},{"level":2,"title":"param - method","slug":"param-method-1","link":"#param-method-1","children":[]},{"level":2,"title":"name - method","slug":"name-method","link":"#name-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method","link":"#paramcount-method","children":[]},{"level":2,"title":"paramCount - method","slug":"paramcount-method-1","link":"#paramcount-method-1","children":[]},{"level":2,"title":"returnType - method","slug":"returntype-method","link":"#returntype-method","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/classes/rules/MethodRules.md"}');export{e as data}; diff --git a/docs/assets/MethodRules.html.e854c479.js b/docs/assets/MethodRules.html.e854c479.js deleted file mode 100644 index 465ebcb..0000000 --- a/docs/assets/MethodRules.html.e854c479.js +++ /dev/null @@ -1,13 +0,0 @@ -import{_ as s,o,c as a,a as e}from"./app.2add9aa5.js";const n={},p=e(`class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Method
\u67E5\u627E\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
var name: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u540D\u79F0\u3002
var paramCount: Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u53D8\u91CF\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u3002
\u82E5\u53C2\u6570\u4E2A\u6570\u5C0F\u4E8E\u96F6\u5219\u5FFD\u7565\u5E76\u4F7F\u7528 param
\u3002
var returnType: Any?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
fun modifiers(conditions: ModifierConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u6807\u8BC6\u7B26\u7B5B\u9009\u6761\u4EF6\u3002
\u53EF\u4E0D\u8BBE\u7F6E\u7B5B\u9009\u6761\u4EF6\u3002
fun emptyParam()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u7A7A\u53C2\u6570\u3001\u65E0\u53C2\u6570\u3002
fun param(vararg paramType: Any)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u3002
\u5982\u679C\u540C\u65F6\u4F7F\u7528\u4E86 paramCount
\u5219 paramType
\u7684\u6570\u91CF\u5FC5\u987B\u4E0E paramCount
\u5B8C\u5168\u5339\u914D\u3002
\u5982\u679C Method
\u4E2D\u5B58\u5728\u4E00\u4E9B\u65E0\u610F\u4E49\u53C8\u5F88\u957F\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 VagueType
\u6765\u66FF\u4EE3\u5B83\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun param(conditions: ObjectsConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u6761\u4EF6\u3002
\u7279\u522B\u6CE8\u610F
\u65E0\u53C2 Method \u8BF7\u4F7F\u7528 emptyParam \u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u6709\u53C2 Method \u5FC5\u987B\u4F7F\u7528\u6B64\u65B9\u6CD5\u8BBE\u5B9A\u53C2\u6570\u6216\u4F7F\u7528 paramCount \u6307\u5B9A\u4E2A\u6570\u3002
fun name(conditions: NameConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u540D\u79F0\u6761\u4EF6\u3002
fun paramCount(numRange: IntRange)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u3002
fun paramCount(conditions: CountConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
\u4F60\u53EF\u4EE5\u4E0D\u4F7F\u7528 param
\u6307\u5B9A\u53C2\u6570\u7C7B\u578B\u800C\u662F\u4EC5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6307\u5B9A\u53C2\u6570\u4E2A\u6570\u6761\u4EF6\u3002
fun returnType(conditions: ObjectConditions)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8BBE\u7F6E
Method
\u8FD4\u56DE\u503C\u6761\u4EF6\u3002
\u53EF\u4E0D\u586B\u5199\u8FD4\u56DE\u503C\u3002
`,83),l=[p];function t(c,r){return o(),a("div",null,l)}const i=s(n,[["render",t],["__file","MethodRules.html.vue"]]);export{i as default}; diff --git a/docs/assets/ModifierRules.html.063cc2f9.js b/docs/assets/ModifierRules.html.063cc2f9.js deleted file mode 100644 index 1977176..0000000 --- a/docs/assets/ModifierRules.html.063cc2f9.js +++ /dev/null @@ -1 +0,0 @@ -const i=JSON.parse('{"key":"v-701721ec","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/base/rules/ModifierRules.html","title":"ModifierRules - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"isPublic - i-ext-field","slug":"ispublic-i-ext-field","link":"#ispublic-i-ext-field","children":[]},{"level":2,"title":"isPrivate - i-ext-field","slug":"isprivate-i-ext-field","link":"#isprivate-i-ext-field","children":[]},{"level":2,"title":"isProtected - i-ext-field","slug":"isprotected-i-ext-field","link":"#isprotected-i-ext-field","children":[]},{"level":2,"title":"isStatic - i-ext-field","slug":"isstatic-i-ext-field","link":"#isstatic-i-ext-field","children":[]},{"level":2,"title":"isFinal - i-ext-field","slug":"isfinal-i-ext-field","link":"#isfinal-i-ext-field","children":[]},{"level":2,"title":"isSynchronized - i-ext-field","slug":"issynchronized-i-ext-field","link":"#issynchronized-i-ext-field","children":[]},{"level":2,"title":"isVolatile - i-ext-field","slug":"isvolatile-i-ext-field","link":"#isvolatile-i-ext-field","children":[]},{"level":2,"title":"isTransient - i-ext-field","slug":"istransient-i-ext-field","link":"#istransient-i-ext-field","children":[]},{"level":2,"title":"isNative - i-ext-field","slug":"isnative-i-ext-field","link":"#isnative-i-ext-field","children":[]},{"level":2,"title":"isInterface - i-ext-field","slug":"isinterface-i-ext-field","link":"#isinterface-i-ext-field","children":[]},{"level":2,"title":"isAbstract - i-ext-field","slug":"isabstract-i-ext-field","link":"#isabstract-i-ext-field","children":[]},{"level":2,"title":"isStrict - i-ext-field","slug":"isstrict-i-ext-field","link":"#isstrict-i-ext-field","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/base/rules/ModifierRules.md"}');export{i as data}; diff --git a/docs/assets/ModifierRules.html.23e3a69f.js b/docs/assets/ModifierRules.html.23e3a69f.js deleted file mode 100644 index 9d8f620..0000000 --- a/docs/assets/ModifierRules.html.23e3a69f.js +++ /dev/null @@ -1,14 +0,0 @@ -import{_ as s,o as e,c as o,a}from"./app.2add9aa5.js";const n={},l=a(`Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ModifierRules private constructor()
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A
Class
\u3001Member
\u63CF\u8FF0\u7B26\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
val isPublic: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bpublic
\u3002
val isPrivate: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bprivate
\u3002
val isProtected: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bprotected
\u3002
val isStatic: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bstatic
\u3002
\u5BF9\u4E8E\u4EFB\u610F\u7684\u9759\u6001 Class
\u3001Member
\u53EF\u6DFB\u52A0\u6B64\u63CF\u8FF0\u8FDB\u884C\u786E\u5B9A\u3002
Notice
Kotlin \u2192 Jvm \u540E\u7684 object \u7C7B\u4E2D\u7684\u65B9\u6CD5\u5E76\u4E0D\u662F\u9759\u6001\u7684\u3002
val isFinal: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bfinal
\u3002
Notice
Kotlin \u2192 Jvm \u540E\u6CA1\u6709 open \u7B26\u53F7\u6807\u8BC6\u7684 Class\u3001Member \u548C\u6CA1\u6709\u4EFB\u4F55\u5173\u8054\u7684 Class\u3001Member \u90FD\u5C06\u4E3A final\u3002
val isSynchronized: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bsynchronized
\u3002
val isVolatile: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u7C7B\u578B\u662F\u5426\u5305\u542Bvolatile
\u3002
val isTransient: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Field
\u7C7B\u578B\u662F\u5426\u5305\u542Btransient
\u3002
val isNative: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Method
\u7C7B\u578B\u662F\u5426\u5305\u542Bnative
\u3002
\u5BF9\u4E8E\u4EFB\u610F JNI \u5BF9\u63A5\u7684 Method
\u53EF\u6DFB\u52A0\u6B64\u63CF\u8FF0\u8FDB\u884C\u786E\u5B9A\u3002
val isInterface: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u7C7B\u578B\u662F\u5426\u5305\u542Binterface
\u3002
val isAbstract: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Babstract
\u3002
\u5BF9\u4E8E\u4EFB\u610F\u7684\u62BD\u8C61 Class
\u3001Member
\u53EF\u6DFB\u52A0\u6B64\u63CF\u8FF0\u8FDB\u884C\u786E\u5B9A\u3002
val isStrict: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
`,85),c=[l];function t(i,p){return e(),o("div",null,c)}const d=s(n,[["render",t],["__file","ModifierRules.html.vue"]]);export{d as default}; diff --git a/docs/assets/ModifierRules.html.b6f683e3.js b/docs/assets/ModifierRules.html.b6f683e3.js deleted file mode 100644 index cd7e73a..0000000 --- a/docs/assets/ModifierRules.html.b6f683e3.js +++ /dev/null @@ -1,14 +0,0 @@ -import{_ as s,o as e,c as o,a}from"./app.2add9aa5.js";const n={},l=a(`
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bstrictfp
\u3002
class ModifierRules private constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A
Class
\u3001Member
\u63CF\u8FF0\u7B26\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
val isPublic: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bpublic
\u3002
val isPrivate: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bprivate
\u3002
val isProtected: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bprotected
\u3002
val isStatic: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bstatic
\u3002
\u5BF9\u4E8E\u4EFB\u610F\u7684\u9759\u6001 Class
\u3001Member
\u53EF\u6DFB\u52A0\u6B64\u63CF\u8FF0\u8FDB\u884C\u786E\u5B9A\u3002
\u6CE8\u610F
Kotlin \u2192 Jvm \u540E\u7684 object \u7C7B\u4E2D\u7684\u65B9\u6CD5\u5E76\u4E0D\u662F\u9759\u6001\u7684\u3002
val isFinal: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bfinal
\u3002
\u6CE8\u610F
Kotlin \u2192 Jvm \u540E\u6CA1\u6709 open \u7B26\u53F7\u6807\u8BC6\u7684 Class\u3001Member \u548C\u6CA1\u6709\u4EFB\u4F55\u5173\u8054\u7684 Class\u3001Member \u90FD\u5C06\u4E3A final\u3002
val isSynchronized: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bsynchronized
\u3002
val isVolatile: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u7C7B\u578B\u662F\u5426\u5305\u542Bvolatile
\u3002
val isTransient: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Field
\u7C7B\u578B\u662F\u5426\u5305\u542Btransient
\u3002
val isNative: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Method
\u7C7B\u578B\u662F\u5426\u5305\u542Bnative
\u3002
\u5BF9\u4E8E\u4EFB\u610F JNI \u5BF9\u63A5\u7684 Method
\u53EF\u6DFB\u52A0\u6B64\u63CF\u8FF0\u8FDB\u884C\u786E\u5B9A\u3002
val isInterface: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u7C7B\u578B\u662F\u5426\u5305\u542Binterface
\u3002
val isAbstract: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Babstract
\u3002
\u5BF9\u4E8E\u4EFB\u610F\u7684\u62BD\u8C61 Class
\u3001Member
\u53EF\u6DFB\u52A0\u6B64\u63CF\u8FF0\u8FDB\u884C\u786E\u5B9A\u3002
val isStrict: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,84),c=[l];function t(p,i){return e(),o("div",null,c)}const r=s(n,[["render",t],["__file","ModifierRules.html.vue"]]);export{r as default}; diff --git a/docs/assets/ModifierRules.html.bf55a30e.js b/docs/assets/ModifierRules.html.bf55a30e.js deleted file mode 100644 index 8c7b258..0000000 --- a/docs/assets/ModifierRules.html.bf55a30e.js +++ /dev/null @@ -1 +0,0 @@ -const i=JSON.parse('{"key":"v-56071599","path":"/en/api/public/com/highcapable/yukireflection/finder/base/rules/ModifierRules.html","title":"ModifierRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"isPublic - i-ext-field","slug":"ispublic-i-ext-field","link":"#ispublic-i-ext-field","children":[]},{"level":2,"title":"isPrivate - i-ext-field","slug":"isprivate-i-ext-field","link":"#isprivate-i-ext-field","children":[]},{"level":2,"title":"isProtected - i-ext-field","slug":"isprotected-i-ext-field","link":"#isprotected-i-ext-field","children":[]},{"level":2,"title":"isStatic - i-ext-field","slug":"isstatic-i-ext-field","link":"#isstatic-i-ext-field","children":[]},{"level":2,"title":"isFinal - i-ext-field","slug":"isfinal-i-ext-field","link":"#isfinal-i-ext-field","children":[]},{"level":2,"title":"isSynchronized - i-ext-field","slug":"issynchronized-i-ext-field","link":"#issynchronized-i-ext-field","children":[]},{"level":2,"title":"isVolatile - i-ext-field","slug":"isvolatile-i-ext-field","link":"#isvolatile-i-ext-field","children":[]},{"level":2,"title":"isTransient - i-ext-field","slug":"istransient-i-ext-field","link":"#istransient-i-ext-field","children":[]},{"level":2,"title":"isNative - i-ext-field","slug":"isnative-i-ext-field","link":"#isnative-i-ext-field","children":[]},{"level":2,"title":"isInterface - i-ext-field","slug":"isinterface-i-ext-field","link":"#isinterface-i-ext-field","children":[]},{"level":2,"title":"isAbstract - i-ext-field","slug":"isabstract-i-ext-field","link":"#isabstract-i-ext-field","children":[]},{"level":2,"title":"isStrict - i-ext-field","slug":"isstrict-i-ext-field","link":"#isstrict-i-ext-field","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/base/rules/ModifierRules.md"}');export{i as data}; diff --git a/docs/assets/NameRules.html.2124d233.js b/docs/assets/NameRules.html.2124d233.js deleted file mode 100644 index 53c0ffc..0000000 --- a/docs/assets/NameRules.html.2124d233.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-4ea9e766","path":"/en/api/public/com/highcapable/yukireflection/finder/base/rules/NameRules.html","title":"NameRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"String.isSynthetic - i-ext-method","slug":"string-issynthetic-i-ext-method","link":"#string-issynthetic-i-ext-method","children":[]},{"level":2,"title":"String.isOnlySymbols - i-ext-method","slug":"string-isonlysymbols-i-ext-method","link":"#string-isonlysymbols-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyLetters - i-ext-method","slug":"string-isonlyletters-i-ext-method","link":"#string-isonlyletters-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyNumbers - i-ext-method","slug":"string-isonlynumbers-i-ext-method","link":"#string-isonlynumbers-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyLettersNumbers - i-ext-method","slug":"string-isonlylettersnumbers-i-ext-method","link":"#string-isonlylettersnumbers-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyLowercase - i-ext-method","slug":"string-isonlylowercase-i-ext-method","link":"#string-isonlylowercase-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyUppercase - i-ext-method","slug":"string-isonlyuppercase-i-ext-method","link":"#string-isonlyuppercase-i-ext-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/base/rules/NameRules.md"}');export{e as data}; diff --git a/docs/assets/NameRules.html.538d5551.js b/docs/assets/NameRules.html.538d5551.js deleted file mode 100644 index e9c0825..0000000 --- a/docs/assets/NameRules.html.538d5551.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-264e7384","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/base/rules/NameRules.html","title":"NameRules - class","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"String.isSynthetic - i-ext-method","slug":"string-issynthetic-i-ext-method","link":"#string-issynthetic-i-ext-method","children":[]},{"level":2,"title":"String.isOnlySymbols - i-ext-method","slug":"string-isonlysymbols-i-ext-method","link":"#string-isonlysymbols-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyLetters - i-ext-method","slug":"string-isonlyletters-i-ext-method","link":"#string-isonlyletters-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyNumbers - i-ext-method","slug":"string-isonlynumbers-i-ext-method","link":"#string-isonlynumbers-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyLettersNumbers - i-ext-method","slug":"string-isonlylettersnumbers-i-ext-method","link":"#string-isonlylettersnumbers-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyLowercase - i-ext-method","slug":"string-isonlylowercase-i-ext-method","link":"#string-isonlylowercase-i-ext-method","children":[]},{"level":2,"title":"String.isOnlyUppercase - i-ext-method","slug":"string-isonlyuppercase-i-ext-method","link":"#string-isonlyuppercase-i-ext-method","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/base/rules/NameRules.md"}');export{e as data}; diff --git a/docs/assets/NameRules.html.5824cbcd.js b/docs/assets/NameRules.html.5824cbcd.js deleted file mode 100644 index c1505af..0000000 --- a/docs/assets/NameRules.html.5824cbcd.js +++ /dev/null @@ -1,9 +0,0 @@ -import{_ as s,o as e,c as n,a as o}from"./app.2add9aa5.js";const a={},t=o(`
Class
\u3001Member
\u7C7B\u578B\u662F\u5426\u5305\u542Bstrictfp
\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class NameRules private constructor()
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A\u6A21\u7CCA
Class
\u3001Member
\u540D\u79F0\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
fun String.isSynthetic(index: Int): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u4E3A\u533F\u540D\u7C7B\u7684\u4E3B\u7C7B\u8C03\u7528\u5BF9\u8C61\u3002
fun String.isOnlySymbols(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u53EA\u6709\u7B26\u53F7\u3002
fun String.isOnlyLetters(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u53EA\u6709\u5B57\u6BCD\u3002
fun String.isOnlyNumbers(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u53EA\u6709\u6570\u5B57\u3002
fun String.isOnlyLettersNumbers(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u53EA\u6709\u5B57\u6BCD\u6216\u6570\u5B57\u3002
fun String.isOnlyLowercase(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u53EA\u6709\u5C0F\u5199\u5B57\u6BCD\u3002
\u5728\u6CA1\u6709\u5176\u5B83\u6761\u4EF6\u7684\u60C5\u51B5\u4E0B\u8BBE\u7F6E\u6B64\u6761\u4EF6\u5141\u8BB8\u5224\u65AD\u5BF9\u8C61\u5B58\u5728\u5B57\u6BCD\u4EE5\u5916\u7684\u5B57\u7B26\u3002
fun String.isOnlyUppercase(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u53EA\u6709\u5927\u5199\u5B57\u6BCD\u3002
\u5728\u6CA1\u6709\u5176\u5B83\u6761\u4EF6\u7684\u60C5\u51B5\u4E0B\u8BBE\u7F6E\u6B64\u6761\u4EF6\u5141\u8BB8\u5224\u65AD\u5BF9\u8C61\u5B58\u5728\u5B57\u6BCD\u4EE5\u5916\u7684\u5B57\u7B26\u3002
`,52),l=[t];function p(r,c){return e(),n("div",null,l)}const d=s(a,[["render",p],["__file","NameRules.html.vue"]]);export{d as default}; diff --git a/docs/assets/NameRules.html.6db86216.js b/docs/assets/NameRules.html.6db86216.js deleted file mode 100644 index 985e6c7..0000000 --- a/docs/assets/NameRules.html.6db86216.js +++ /dev/null @@ -1,9 +0,0 @@ -import{_ as s,o as e,c as n,a as o}from"./app.2add9aa5.js";const a={},l=o(`class NameRules private constructor()
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A\u6A21\u7CCA
Class
\u3001Member
\u540D\u79F0\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
fun String.isSynthetic(index: Int): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u4E3A\u533F\u540D\u7C7B\u7684\u4E3B\u7C7B\u8C03\u7528\u5BF9\u8C61\u3002
fun String.isOnlySymbols(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u53EA\u6709\u7B26\u53F7\u3002
fun String.isOnlyLetters(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u53EA\u6709\u5B57\u6BCD\u3002
fun String.isOnlyNumbers(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u53EA\u6709\u6570\u5B57\u3002
fun String.isOnlyLettersNumbers(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u53EA\u6709\u5B57\u6BCD\u6216\u6570\u5B57\u3002
fun String.isOnlyLowercase(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u53EA\u6709\u5C0F\u5199\u5B57\u6BCD\u3002
\u5728\u6CA1\u6709\u5176\u5B83\u6761\u4EF6\u7684\u60C5\u51B5\u4E0B\u8BBE\u7F6E\u6B64\u6761\u4EF6\u5141\u8BB8\u5224\u65AD\u5BF9\u8C61\u5B58\u5728\u5B57\u6BCD\u4EE5\u5916\u7684\u5B57\u7B26\u3002
fun String.isOnlyUppercase(): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u53EA\u6709\u5927\u5199\u5B57\u6BCD\u3002
\u5728\u6CA1\u6709\u5176\u5B83\u6761\u4EF6\u7684\u60C5\u51B5\u4E0B\u8BBE\u7F6E\u6B64\u6761\u4EF6\u5141\u8BB8\u5224\u65AD\u5BF9\u8C61\u5B58\u5728\u5B57\u6BCD\u4EE5\u5916\u7684\u5B57\u7B26\u3002
`,51),t=[l];function p(c,r){return e(),n("div",null,t)}const d=s(a,[["render",p],["__file","NameRules.html.vue"]]);export{d as default}; diff --git a/docs/assets/ObjectRules.html.0a6223eb.js b/docs/assets/ObjectRules.html.0a6223eb.js deleted file mode 100644 index 3596377..0000000 --- a/docs/assets/ObjectRules.html.0a6223eb.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-3045c7fe","path":"/en/api/public/com/highcapable/yukireflection/finder/base/rules/ObjectRules.html","title":"ObjectRules - class","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/base/rules/ObjectRules.md"}');export{e as data}; diff --git a/docs/assets/ObjectRules.html.2373dc72.js b/docs/assets/ObjectRules.html.2373dc72.js deleted file mode 100644 index 4960953..0000000 --- a/docs/assets/ObjectRules.html.2373dc72.js +++ /dev/null @@ -1,2 +0,0 @@ -import{_ as s,o as e,c as o,a}from"./app.2add9aa5.js";const l={},n=a(`class ObjectRules private constructor(private val instance: Any)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A\u4EFB\u610F\u5BF9\u8C61\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ObjectRules private constructor(private val instance: Any)
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A\u4EFB\u610F\u5BF9\u8C61\u6761\u4EF6\u5B9E\u73B0\u7C7B\u3002
\u53EF\u5BF9 R8 \u6DF7\u6DC6\u540E\u7684 Class
\u3001Member
\u8FDB\u884C\u66F4\u52A0\u8BE6\u7EC6\u7684\u5B9A\u4F4D\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u81EA\u5B9A\u4E49
Member
\u548CClass
\u76F8\u5173\u529F\u80FD\u7684\u67E5\u627E\u5339\u914D\u4EE5\u53CAinvoke
\u7684\u5C01\u88C5\u7C7B\u3002
fun ClassLoader.listOfClasses(): List<String>
-
Change Records
v1.0.0
first
Function Illustrate
\u5199\u51FA\u5F53\u524D
ClassLoader
\u4E0B\u6240\u6709Class
\u540D\u79F0\u6570\u7EC4\u3002
Notice
\u6B64\u65B9\u6CD5\u5728 Class \u6570\u91CF\u8FC7\u591A\u65F6\u4F1A\u975E\u5E38\u8017\u65F6\u3002
\u82E5\u8981\u6309\u6307\u5B9A\u89C4\u5219\u67E5\u627E\u4E00\u4E2A Class\uFF0C\u8BF7\u4F7F\u7528 ClassLoader.searchClass \u65B9\u6CD5\u3002
inline fun ClassLoader.searchClass(context: Context?, name: String, async: Boolean, initiate: ClassConditions): DexClassFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
\u901A\u8FC7\u5F53\u524D
ClassLoader
\u6309\u6307\u5B9A\u6761\u4EF6\u67E5\u627E\u5E76\u5F97\u5230 Dex \u4E2D\u7684Class
\u3002
Pay Attention
\u6B64\u65B9\u6CD5\u5728 Class \u6570\u91CF\u8FC7\u591A\u53CA\u67E5\u627E\u6761\u4EF6\u590D\u6742\u65F6\u4F1A\u975E\u5E38\u8017\u65F6\u3002
\u5EFA\u8BAE\u542F\u7528 async \u6216\u8BBE\u7F6E name \u53C2\u6570\uFF0Cname \u53C2\u6570\u5C06\u5728\u5F53\u524D APP \u4E0D\u540C\u7248\u672C\u4E2D\u81EA\u52A8\u8FDB\u884C\u672C\u5730\u7F13\u5B58\u4EE5\u63D0\u5347\u6548\u7387\u3002
\u5982\u679C\u4F7F\u7528\u4E86 async \u6216 name \u53C2\u6570\uFF0C\u5219\u5FC5\u987B\u586B\u5199 context \u53C2\u6570\u3002
\u6B64\u529F\u80FD\u5C1A\u5728\u8BD5\u9A8C\u9636\u6BB5\uFF0C\u6027\u80FD\u4E0E\u7A33\u5B9A\u6027\u53EF\u80FD\u4ECD\u7136\u5B58\u5728\u95EE\u9898\uFF0C\u4F7F\u7528\u8FC7\u7A0B\u9047\u5230\u95EE\u9898\u8BF7\u5411\u6211\u4EEC\u62A5\u544A\u5E76\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u3002
val Class<*>.hasExtends: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Class
\u662F\u5426\u6709\u7EE7\u627F\u5173\u7CFB\uFF0C\u7236\u7C7B\u662FAny
\u5C06\u88AB\u8BA4\u4E3A\u6CA1\u6709\u7EE7\u627F\u5173\u7CFB\u3002
infix fun Class<*>?.extends(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Class
\u662F\u5426\u7EE7\u627F\u4E8Eother
\u3002
\u5982\u679C\u5F53\u524D Class
\u5C31\u662F other
\u4E5F\u4F1A\u8FD4\u56DE true
\u3002
\u5982\u679C\u5F53\u524D Class
\u4E3A null
\u6216 other
\u4E3A null
\u4F1A\u8FD4\u56DE false
\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u5B58\u5728\u7EE7\u627F\u5173\u7CFB\u3002
The following example
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u7EE7\u627F\u4E8E B
-if (classA extends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notExtends(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Class
\u662F\u5426\u4E0D\u7EE7\u627F\u4E8Eother
\u3002
\u6B64\u65B9\u6CD5\u76F8\u5F53\u4E8E extends
\u7684\u53CD\u5411\u5224\u65AD\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u4E0D\u5B58\u5728\u7EE7\u627F\u5173\u7CFB\u3002
The following example
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u4E0D\u7EE7\u627F\u4E8E B
-if (classA notExtends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.implements(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Class
\u662F\u5426\u5B9E\u73B0\u4E86other
\u63A5\u53E3\u7C7B\u3002
\u5982\u679C\u5F53\u524D Class
\u4E3A null
\u6216 other
\u4E3A null
\u4F1A\u8FD4\u56DE false
\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u5B58\u5728\u4F9D\u8D56\u5173\u7CFB\u3002
The following example
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u5B9E\u73B0\u4E86 B \u63A5\u53E3\u7C7B
-if (classA implements classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notImplements(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u5F53\u524D
Class
\u662F\u5426\u672A\u5B9E\u73B0other
\u63A5\u53E3\u7C7B\u3002
\u6B64\u65B9\u6CD5\u76F8\u5F53\u4E8E implements
\u7684\u53CD\u5411\u5224\u65AD\u3002
Function Example
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u4E0D\u5B58\u5728\u4F9D\u8D56\u5173\u7CFB\u3002
The following example
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u672A\u5B9E\u73B0 B \u63A5\u53E3\u7C7B
-if (classA notImplements classB) {
- // Your code here.
-}
-
fun Class<*>.toJavaPrimitiveType(): Class<*>
-
Change Records
v1.0.0
first
Function Illustrate
\u81EA\u52A8\u8F6C\u6362\u5F53\u524D
Class
\u4E3A Java \u539F\u59CB\u7C7B\u578B (Primitive Type)\u3002
\u5982\u679C\u5F53\u524D Class
\u4E3A Java \u6216 Kotlin \u57FA\u672C\u7C7B\u578B\u5C06\u81EA\u52A8\u6267\u884C\u7C7B\u578B\u8F6C\u6362\u3002
\u5F53\u524D\u80FD\u591F\u81EA\u52A8\u8F6C\u6362\u7684\u57FA\u672C\u7C7B\u578B\u5982\u4E0B\u3002
kotlin.Unit
java.lang.Void
java.lang.Boolean
java.lang.Integer
java.lang.Float
java.lang.Double
java.lang.Long
java.lang.Short
java.lang.Character
java.lang.Byte
fun String.toClass(loader: ClassLoader?, initialize: Boolean): Class<*>
-
inline fun <reified T> String.toClass(loader: ClassLoader?, initialize: Boolean): Class<T>
-
Change Records
v1.0.0
first
Function Illustrate
\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u8F6C\u6362\u4E3A
loader
\u4E2D\u7684\u5B9E\u4F53\u7C7B\u3002
Function Example
\u4F60\u53EF\u4EE5\u76F4\u63A5\u586B\u5199\u4F60\u8981\u67E5\u627E\u7684\u76EE\u6807 Class
\uFF0C\u5FC5\u987B\u5728\u9ED8\u8BA4 ClassLoader
\u4E0B\u5B58\u5728\u3002
The following example
"com.example.demo.DemoClass".toClass()
-
\u4F60\u8FD8\u53EF\u4EE5\u81EA\u5B9A\u4E49 Class
\u6240\u5728\u7684 ClassLoader
\u3002
The following example
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-"com.example.demo.DemoClass".toClass(customClassLoader)
-
\u4F60\u8FD8\u53EF\u4EE5\u6307\u5B9A Class
\u7684\u76EE\u6807\u7C7B\u578B\u3002
The following example
// \u6307\u5B9A\u7684 DemoClass \u5FC5\u987B\u5B58\u5728\u6216\u4E3A\u53EF\u8BBF\u95EE\u7684 stub
-"com.example.demo.DemoClass".toClass<DemoClass>()
-
\u4F60\u8FD8\u53EF\u4EE5\u8BBE\u7F6E\u5728\u83B7\u53D6\u5230\u8FD9\u4E2A Class
\u65F6\u662F\u5426\u81EA\u52A8\u6267\u884C\u5176\u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757\uFF0C\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4E0D\u4F1A\u6267\u884C\u3002
The following example
// \u83B7\u53D6\u5E76\u6267\u884C DemoClass \u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757
-"com.example.demo.DemoClass".toClass(initialize = true)
-
\u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757\u5728 Java \u4E2D\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u5B9A\u4E49\u3002
The following example
public class DemoClass {
-
- static {
- // \u8FD9\u91CC\u662F\u9759\u6001\u65B9\u6CD5\u5757\u7684\u5185\u5BB9
- }
-
- public DemoClass() {
- // ...
- }
-}
-
fun String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<*>?
-
inline fun <reified T> String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<T>?
-
Change Records
v1.0.0
first
Function Illustrate
\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u8F6C\u6362\u4E3A
loader
\u4E2D\u7684\u5B9E\u4F53\u7C7B\u3002
\u627E\u4E0D\u5230 Class
\u4F1A\u8FD4\u56DE null
\uFF0C\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38\u3002
Function Example
\u7528\u6CD5\u8BF7\u53C2\u8003 String.toClass \u65B9\u6CD5\u3002
inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class<T>
-
Change Records
v1.0.0
first
Function Illustrate
\u901A\u8FC7
T
\u5F97\u5230\u5176Class
\u5B9E\u4F8B\u5E76\u8F6C\u6362\u4E3A\u5B9E\u4F53\u7C7B\u3002
Function Example
\u6211\u4EEC\u8981\u83B7\u53D6\u4E00\u4E2A Class
\u5728 Kotlin
\u4E0B\u4E0D\u901A\u8FC7\u53CD\u5C04\u65F6\u5E94\u8BE5\u8FD9\u6837\u505A\u3002
The following example
DemoClass::class.java
-
\u73B0\u5728\uFF0C\u4F60\u53EF\u4EE5\u76F4\u63A5 cast
\u4E00\u4E2A\u5B9E\u4F8B\u5E76\u83B7\u53D6\u5B83\u7684 Class
\u5BF9\u8C61\uFF0C\u5FC5\u987B\u5728\u5F53\u524D ClassLoader
\u4E0B\u5B58\u5728\u3002
The following example
classOf<DemoClass>()
-
\u82E5\u76EE\u6807\u5B58\u5728\u7684 Class
\u4E3A stub
\uFF0C\u901A\u8FC7\u8FD9\u79CD\u65B9\u5F0F\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u81EA\u5B9A\u4E49 Class
\u6240\u5728\u7684 ClassLoader
\u3002
The following example
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-classOf<DemoClass>(customClassLoader)
-
fun String.hasClass(loader: ClassLoader?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u4F7F\u7528\u6307\u5B9A\u7684
ClassLoader
\u67E5\u627E\u662F\u5426\u5B58\u5728\u3002
Function Example
\u4F60\u53EF\u4EE5\u8F7B\u677E\u7684\u4F7F\u7528\u6B64\u65B9\u6CD5\u5224\u65AD\u5B57\u7B26\u4E32\u4E2D\u7684\u7C7B\u662F\u5426\u5B58\u5728\uFF0C\u6548\u679C\u7B49\u540C\u4E8E\u76F4\u63A5\u4F7F\u7528 Class.forName
\u3002
The following example
if("com.example.demo.DemoClass".hasClass()) {
- // Your code here.
-}
-
\u586B\u5165\u65B9\u6CD5\u4E2D\u7684 loader
\u53C2\u6570\u53EF\u5224\u65AD\u6307\u5B9A\u7684 ClassLoader
\u4E2D\u7684 Class
\u662F\u5426\u5B58\u5728\u3002
The following example
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-if("com.example.demo.DemoClass".hasClass(customClassLoader)) {
- // Your code here.
-}
-
inline fun Class<*>.hasField(initiate: FieldConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E\u53D8\u91CF\u662F\u5426\u5B58\u5728\u3002
inline fun Class<*>.hasMethod(initiate: MethodConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E\u65B9\u6CD5\u662F\u5426\u5B58\u5728\u3002
inline fun Class<*>.hasConstructor(initiate: ConstructorConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E\u6784\u9020\u65B9\u6CD5\u662F\u5426\u5B58\u5728\u3002
inline fun Member.hasModifiers(conditions: ModifierConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E
Member
\u4E2D\u5339\u914D\u7684\u63CF\u8FF0\u7B26\u3002
inline fun Class<*>.hasModifiers(conditions: ModifierConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E
Class
\u4E2D\u5339\u914D\u7684\u63CF\u8FF0\u7B26\u3002
inline fun Class<*>.field(initiate: FieldConditions): FieldFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E\u5E76\u5F97\u5230\u53D8\u91CF\u3002
inline fun Class<*>.method(initiate: MethodConditions): MethodFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E\u5E76\u5F97\u5230\u65B9\u6CD5\u3002
inline fun Class<*>.constructor(initiate: ConstructorConditions): ConstructorFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
\u67E5\u627E\u5E76\u5F97\u5230\u6784\u9020\u65B9\u6CD5\u3002
fun Class<*>.generic(): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
Class
\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun Class<*>.generic(initiate: GenericClass.() -> Unit): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D
Class
\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun <reified T : Any> T.current(ignored: Boolean): CurrentClass
-
inline fun <reified T : Any> T.current(ignored: Boolean, initiate: CurrentClass.() -> Unit): T
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
inline fun Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): Any?
-
inline fun <T> Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): T?
-
Change Records
v1.0.0
first
Function Illustrate
\u901A\u8FC7\u6784\u9020\u65B9\u6CD5\u521B\u5EFA\u65B0\u5B9E\u4F8B\uFF0C\u6307\u5B9A\u7C7B\u578B
T
\u6216\u4EFB\u610F\u7C7B\u578BAny
\u3002
inline fun Class<*>.allMethods(isAccessible: Boolean, result: (index: Int, method: Method) -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u904D\u5386\u5F53\u524D\u7C7B\u4E2D\u7684\u6240\u6709\u65B9\u6CD5\u3002
inline fun Class<*>.allConstructors(isAccessible: Boolean, result: (index: Int, constructor: Constructor<*>) -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u904D\u5386\u5F53\u524D\u7C7B\u4E2D\u7684\u6240\u6709\u6784\u9020\u65B9\u6CD5\u3002
inline fun Class<*>.allFields(isAccessible: Boolean, result: (index: Int, field: Field) -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
`,236),p=[e];function t(c,r){return a(),n("div",null,p)}const d=s(o,[["render",t],["__file","ReflectionFactory.html.vue"]]);export{d as default}; diff --git a/docs/assets/ReflectionFactory.html.660311db.js b/docs/assets/ReflectionFactory.html.660311db.js deleted file mode 100644 index bb89977..0000000 --- a/docs/assets/ReflectionFactory.html.660311db.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-728f231c","path":"/en/api/public/com/highcapable/yukireflection/factory/ReflectionFactory.html","title":"ReflectionFactory - kt","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"ClassLoader.listOfClasses - ext-method","slug":"classloader-listofclasses-ext-method","link":"#classloader-listofclasses-ext-method","children":[]},{"level":2,"title":"ClassLoader.searchClass - ext-method","slug":"classloader-searchclass-ext-method","link":"#classloader-searchclass-ext-method","children":[]},{"level":2,"title":"Class.hasExtends - ext-field","slug":"class-hasextends-ext-field","link":"#class-hasextends-ext-field","children":[]},{"level":2,"title":"Class?.extends - ext-method","slug":"class-extends-ext-method","link":"#class-extends-ext-method","children":[]},{"level":2,"title":"Class?.notExtends - ext-method","slug":"class-notextends-ext-method","link":"#class-notextends-ext-method","children":[]},{"level":2,"title":"Class?.implements - ext-method","slug":"class-implements-ext-method","link":"#class-implements-ext-method","children":[]},{"level":2,"title":"Class?.notImplements - ext-method","slug":"class-notimplements-ext-method","link":"#class-notimplements-ext-method","children":[]},{"level":2,"title":"Class.toJavaPrimitiveType - ext-method","slug":"class-tojavaprimitivetype-ext-method","link":"#class-tojavaprimitivetype-ext-method","children":[]},{"level":2,"title":"String.toClass - ext-method","slug":"string-toclass-ext-method","link":"#string-toclass-ext-method","children":[]},{"level":2,"title":"String.toClassOrNull - ext-method","slug":"string-toclassornull-ext-method","link":"#string-toclassornull-ext-method","children":[]},{"level":2,"title":"classOf - method","slug":"classof-method","link":"#classof-method","children":[]},{"level":2,"title":"String.hasClass - ext-method","slug":"string-hasclass-ext-method","link":"#string-hasclass-ext-method","children":[]},{"level":2,"title":"Class.hasField - ext-method","slug":"class-hasfield-ext-method","link":"#class-hasfield-ext-method","children":[]},{"level":2,"title":"Class.hasMethod - ext-method","slug":"class-hasmethod-ext-method","link":"#class-hasmethod-ext-method","children":[]},{"level":2,"title":"Class.hasConstructor - ext-method","slug":"class-hasconstructor-ext-method","link":"#class-hasconstructor-ext-method","children":[]},{"level":2,"title":"Member.hasModifiers - ext-method","slug":"member-hasmodifiers-ext-method","link":"#member-hasmodifiers-ext-method","children":[]},{"level":2,"title":"Class.hasModifiers - ext-method","slug":"class-hasmodifiers-ext-method","link":"#class-hasmodifiers-ext-method","children":[]},{"level":2,"title":"Class.field - ext-method","slug":"class-field-ext-method","link":"#class-field-ext-method","children":[]},{"level":2,"title":"Class.method - ext-method","slug":"class-method-ext-method","link":"#class-method-ext-method","children":[]},{"level":2,"title":"Class.constructor - ext-method","slug":"class-constructor-ext-method","link":"#class-constructor-ext-method","children":[]},{"level":2,"title":"Class.generic - ext-method","slug":"class-generic-ext-method","link":"#class-generic-ext-method","children":[]},{"level":2,"title":"Class.generic - ext-method","slug":"class-generic-ext-method-1","link":"#class-generic-ext-method-1","children":[]},{"level":2,"title":"Any.current - ext-method","slug":"any-current-ext-method","link":"#any-current-ext-method","children":[]},{"level":2,"title":"Class.buildOf - ext-method","slug":"class-buildof-ext-method","link":"#class-buildof-ext-method","children":[]},{"level":2,"title":"Class.allMethods - ext-method","slug":"class-allmethods-ext-method","link":"#class-allmethods-ext-method","children":[]},{"level":2,"title":"Class.allConstructors - ext-method","slug":"class-allconstructors-ext-method","link":"#class-allconstructors-ext-method","children":[]},{"level":2,"title":"Class.allFields - ext-method","slug":"class-allfields-ext-method","link":"#class-allfields-ext-method","children":[]}],"git":{"updatedTime":1674726569000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/factory/ReflectionFactory.md"}');export{e as data}; diff --git a/docs/assets/ReflectionFactory.html.79e3b099.js b/docs/assets/ReflectionFactory.html.79e3b099.js deleted file mode 100644 index 9428a82..0000000 --- a/docs/assets/ReflectionFactory.html.79e3b099.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-b3841eba","path":"/zh-cn/api/public/com/highcapable/yukireflection/factory/ReflectionFactory.html","title":"ReflectionFactory - kt","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"ClassLoader.listOfClasses - ext-method","slug":"classloader-listofclasses-ext-method","link":"#classloader-listofclasses-ext-method","children":[]},{"level":2,"title":"ClassLoader.searchClass - ext-method","slug":"classloader-searchclass-ext-method","link":"#classloader-searchclass-ext-method","children":[]},{"level":2,"title":"Class.hasExtends - ext-field","slug":"class-hasextends-ext-field","link":"#class-hasextends-ext-field","children":[]},{"level":2,"title":"Class?.extends - ext-method","slug":"class-extends-ext-method","link":"#class-extends-ext-method","children":[]},{"level":2,"title":"Class?.notExtends - ext-method","slug":"class-notextends-ext-method","link":"#class-notextends-ext-method","children":[]},{"level":2,"title":"Class?.implements - ext-method","slug":"class-implements-ext-method","link":"#class-implements-ext-method","children":[]},{"level":2,"title":"Class?.notImplements - ext-method","slug":"class-notimplements-ext-method","link":"#class-notimplements-ext-method","children":[]},{"level":2,"title":"Class.toJavaPrimitiveType - ext-method","slug":"class-tojavaprimitivetype-ext-method","link":"#class-tojavaprimitivetype-ext-method","children":[]},{"level":2,"title":"String.toClass - ext-method","slug":"string-toclass-ext-method","link":"#string-toclass-ext-method","children":[]},{"level":2,"title":"String.toClassOrNull - ext-method","slug":"string-toclassornull-ext-method","link":"#string-toclassornull-ext-method","children":[]},{"level":2,"title":"classOf - method","slug":"classof-method","link":"#classof-method","children":[]},{"level":2,"title":"String.hasClass - ext-method","slug":"string-hasclass-ext-method","link":"#string-hasclass-ext-method","children":[]},{"level":2,"title":"Class.hasField - ext-method","slug":"class-hasfield-ext-method","link":"#class-hasfield-ext-method","children":[]},{"level":2,"title":"Class.hasMethod - ext-method","slug":"class-hasmethod-ext-method","link":"#class-hasmethod-ext-method","children":[]},{"level":2,"title":"Class.hasConstructor - ext-method","slug":"class-hasconstructor-ext-method","link":"#class-hasconstructor-ext-method","children":[]},{"level":2,"title":"Member.hasModifiers - ext-method","slug":"member-hasmodifiers-ext-method","link":"#member-hasmodifiers-ext-method","children":[]},{"level":2,"title":"Class.hasModifiers - ext-method","slug":"class-hasmodifiers-ext-method","link":"#class-hasmodifiers-ext-method","children":[]},{"level":2,"title":"Class.field - ext-method","slug":"class-field-ext-method","link":"#class-field-ext-method","children":[]},{"level":2,"title":"Class.method - ext-method","slug":"class-method-ext-method","link":"#class-method-ext-method","children":[]},{"level":2,"title":"Class.constructor - ext-method","slug":"class-constructor-ext-method","link":"#class-constructor-ext-method","children":[]},{"level":2,"title":"Class.generic - ext-method","slug":"class-generic-ext-method","link":"#class-generic-ext-method","children":[]},{"level":2,"title":"Class.generic - ext-method","slug":"class-generic-ext-method-1","link":"#class-generic-ext-method-1","children":[]},{"level":2,"title":"Any.current - ext-method","slug":"any-current-ext-method","link":"#any-current-ext-method","children":[]},{"level":2,"title":"Class.buildOf - ext-method","slug":"class-buildof-ext-method","link":"#class-buildof-ext-method","children":[]},{"level":2,"title":"Class.allMethods - ext-method","slug":"class-allmethods-ext-method","link":"#class-allmethods-ext-method","children":[]},{"level":2,"title":"Class.allConstructors - ext-method","slug":"class-allconstructors-ext-method","link":"#class-allconstructors-ext-method","children":[]},{"level":2,"title":"Class.allFields - ext-method","slug":"class-allfields-ext-method","link":"#class-allfields-ext-method","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/factory/ReflectionFactory.md"}');export{e as data}; diff --git a/docs/assets/ReflectionFactory.html.faaec016.js b/docs/assets/ReflectionFactory.html.faaec016.js deleted file mode 100644 index c926475..0000000 --- a/docs/assets/ReflectionFactory.html.faaec016.js +++ /dev/null @@ -1,88 +0,0 @@ -import{_ as s,o as a,c as n,a as l}from"./app.2add9aa5.js";const o={},e=l(`\u904D\u5386\u5F53\u524D\u7C7B\u4E2D\u7684\u6240\u6709\u53D8\u91CF\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u81EA\u5B9A\u4E49
Member
\u548CClass
\u76F8\u5173\u529F\u80FD\u7684\u67E5\u627E\u5339\u914D\u4EE5\u53CAinvoke
\u7684\u5C01\u88C5\u7C7B\u3002
fun ClassLoader.listOfClasses(): List<String>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5199\u51FA\u5F53\u524D
ClassLoader
\u4E0B\u6240\u6709Class
\u540D\u79F0\u6570\u7EC4\u3002
\u6CE8\u610F
\u6B64\u65B9\u6CD5\u5728 Class \u6570\u91CF\u8FC7\u591A\u65F6\u4F1A\u975E\u5E38\u8017\u65F6\u3002
\u82E5\u8981\u6309\u6307\u5B9A\u89C4\u5219\u67E5\u627E\u4E00\u4E2A Class\uFF0C\u8BF7\u4F7F\u7528 ClassLoader.searchClass \u65B9\u6CD5\u3002
inline fun ClassLoader.searchClass(context: Context?, name: String, async: Boolean, initiate: ClassConditions): DexClassFinder.Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u901A\u8FC7\u5F53\u524D
ClassLoader
\u6309\u6307\u5B9A\u6761\u4EF6\u67E5\u627E\u5E76\u5F97\u5230 Dex \u4E2D\u7684Class
\u3002
\u7279\u522B\u6CE8\u610F
\u6B64\u65B9\u6CD5\u5728 Class \u6570\u91CF\u8FC7\u591A\u53CA\u67E5\u627E\u6761\u4EF6\u590D\u6742\u65F6\u4F1A\u975E\u5E38\u8017\u65F6\u3002
\u5EFA\u8BAE\u542F\u7528 async \u6216\u8BBE\u7F6E name \u53C2\u6570\uFF0Cname \u53C2\u6570\u5C06\u5728\u5F53\u524D APP \u4E0D\u540C\u7248\u672C\u4E2D\u81EA\u52A8\u8FDB\u884C\u672C\u5730\u7F13\u5B58\u4EE5\u63D0\u5347\u6548\u7387\u3002
\u5982\u679C\u4F7F\u7528\u4E86 async \u6216 name \u53C2\u6570\uFF0C\u5219\u5FC5\u987B\u586B\u5199 context \u53C2\u6570\u3002
\u6B64\u529F\u80FD\u5C1A\u5728\u8BD5\u9A8C\u9636\u6BB5\uFF0C\u6027\u80FD\u4E0E\u7A33\u5B9A\u6027\u53EF\u80FD\u4ECD\u7136\u5B58\u5728\u95EE\u9898\uFF0C\u4F7F\u7528\u8FC7\u7A0B\u9047\u5230\u95EE\u9898\u8BF7\u5411\u6211\u4EEC\u62A5\u544A\u5E76\u5E2E\u52A9\u6211\u4EEC\u6539\u8FDB\u3002
val Class<*>.hasExtends: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Class
\u662F\u5426\u6709\u7EE7\u627F\u5173\u7CFB\uFF0C\u7236\u7C7B\u662FAny
\u5C06\u88AB\u8BA4\u4E3A\u6CA1\u6709\u7EE7\u627F\u5173\u7CFB\u3002
infix fun Class<*>?.extends(other: Class<*>?): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Class
\u662F\u5426\u7EE7\u627F\u4E8Eother
\u3002
\u5982\u679C\u5F53\u524D Class
\u5C31\u662F other
\u4E5F\u4F1A\u8FD4\u56DE true
\u3002
\u5982\u679C\u5F53\u524D Class
\u4E3A null
\u6216 other
\u4E3A null
\u4F1A\u8FD4\u56DE false
\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u5B58\u5728\u7EE7\u627F\u5173\u7CFB\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u7EE7\u627F\u4E8E B
-if (classA extends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notExtends(other: Class<*>?): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Class
\u662F\u5426\u4E0D\u7EE7\u627F\u4E8Eother
\u3002
\u6B64\u65B9\u6CD5\u76F8\u5F53\u4E8E extends
\u7684\u53CD\u5411\u5224\u65AD\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u4E0D\u5B58\u5728\u7EE7\u627F\u5173\u7CFB\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u4E0D\u7EE7\u627F\u4E8E B
-if (classA notExtends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.implements(other: Class<*>?): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Class
\u662F\u5426\u5B9E\u73B0\u4E86other
\u63A5\u53E3\u7C7B\u3002
\u5982\u679C\u5F53\u524D Class
\u4E3A null
\u6216 other
\u4E3A null
\u4F1A\u8FD4\u56DE false
\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u5B58\u5728\u4F9D\u8D56\u5173\u7CFB\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u5B9E\u73B0\u4E86 B \u63A5\u53E3\u7C7B
-if (classA implements classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notImplements(other: Class<*>?): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5F53\u524D
Class
\u662F\u5426\u672A\u5B9E\u73B0other
\u63A5\u53E3\u7C7B\u3002
\u6B64\u65B9\u6CD5\u76F8\u5F53\u4E8E implements
\u7684\u53CD\u5411\u5224\u65AD\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u4F7F\u7528\u6B64\u65B9\u6CD5\u6765\u5224\u65AD\u4E24\u4E2A Class
\u662F\u5426\u4E0D\u5B58\u5728\u4F9D\u8D56\u5173\u7CFB\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u4E0B\u9762\u8FD9\u4E24\u4E2A Class \u5C31\u662F\u4F60\u9700\u8981\u5224\u65AD\u7684 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// \u5224\u65AD A \u662F\u5426\u672A\u5B9E\u73B0 B \u63A5\u53E3\u7C7B
-if (classA notImplements classB) {
- // Your code here.
-}
-
fun Class<*>.toJavaPrimitiveType(): Class<*>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u81EA\u52A8\u8F6C\u6362\u5F53\u524D
Class
\u4E3A Java \u539F\u59CB\u7C7B\u578B (Primitive Type)\u3002
\u5982\u679C\u5F53\u524D Class
\u4E3A Java \u6216 Kotlin \u57FA\u672C\u7C7B\u578B\u5C06\u81EA\u52A8\u6267\u884C\u7C7B\u578B\u8F6C\u6362\u3002
\u5F53\u524D\u80FD\u591F\u81EA\u52A8\u8F6C\u6362\u7684\u57FA\u672C\u7C7B\u578B\u5982\u4E0B\u3002
kotlin.Unit
java.lang.Void
java.lang.Boolean
java.lang.Integer
java.lang.Float
java.lang.Double
java.lang.Long
java.lang.Short
java.lang.Character
java.lang.Byte
fun String.toClass(loader: ClassLoader?, initialize: Boolean): Class<*>
-
inline fun <reified T> String.toClass(loader: ClassLoader?, initialize: Boolean): Class<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u8F6C\u6362\u4E3A
loader
\u4E2D\u7684\u5B9E\u4F53\u7C7B\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u76F4\u63A5\u586B\u5199\u4F60\u8981\u67E5\u627E\u7684\u76EE\u6807 Class
\uFF0C\u5FC5\u987B\u5728\u9ED8\u8BA4 ClassLoader
\u4E0B\u5B58\u5728\u3002
\u793A\u4F8B\u5982\u4E0B
"com.example.demo.DemoClass".toClass()
-
\u4F60\u8FD8\u53EF\u4EE5\u81EA\u5B9A\u4E49 Class
\u6240\u5728\u7684 ClassLoader
\u3002
\u793A\u4F8B\u5982\u4E0B
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-"com.example.demo.DemoClass".toClass(customClassLoader)
-
\u4F60\u8FD8\u53EF\u4EE5\u6307\u5B9A Class
\u7684\u76EE\u6807\u7C7B\u578B\u3002
\u793A\u4F8B\u5982\u4E0B
// \u6307\u5B9A\u7684 DemoClass \u5FC5\u987B\u5B58\u5728\u6216\u4E3A\u53EF\u8BBF\u95EE\u7684 stub
-"com.example.demo.DemoClass".toClass<DemoClass>()
-
\u4F60\u8FD8\u53EF\u4EE5\u8BBE\u7F6E\u5728\u83B7\u53D6\u5230\u8FD9\u4E2A Class
\u65F6\u662F\u5426\u81EA\u52A8\u6267\u884C\u5176\u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757\uFF0C\u9ED8\u8BA4\u60C5\u51B5\u4E0B\u4E0D\u4F1A\u6267\u884C\u3002
\u793A\u4F8B\u5982\u4E0B
// \u83B7\u53D6\u5E76\u6267\u884C DemoClass \u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757
-"com.example.demo.DemoClass".toClass(initialize = true)
-
\u9ED8\u8BA4\u7684\u9759\u6001\u65B9\u6CD5\u5757\u5728 Java \u4E2D\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u5B9A\u4E49\u3002
\u793A\u4F8B\u5982\u4E0B
public class DemoClass {
-
- static {
- // \u8FD9\u91CC\u662F\u9759\u6001\u65B9\u6CD5\u5757\u7684\u5185\u5BB9
- }
-
- public DemoClass() {
- // ...
- }
-}
-
fun String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<*>?
-
inline fun <reified T> String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<T>?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u8F6C\u6362\u4E3A
loader
\u4E2D\u7684\u5B9E\u4F53\u7C7B\u3002
\u627E\u4E0D\u5230 Class
\u4F1A\u8FD4\u56DE null
\uFF0C\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38\u3002
\u529F\u80FD\u793A\u4F8B
\u7528\u6CD5\u8BF7\u53C2\u8003 String.toClass \u65B9\u6CD5\u3002
inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class<T>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u901A\u8FC7
T
\u5F97\u5230\u5176Class
\u5B9E\u4F8B\u5E76\u8F6C\u6362\u4E3A\u5B9E\u4F53\u7C7B\u3002
\u529F\u80FD\u793A\u4F8B
\u6211\u4EEC\u8981\u83B7\u53D6\u4E00\u4E2A Class
\u5728 Kotlin
\u4E0B\u4E0D\u901A\u8FC7\u53CD\u5C04\u65F6\u5E94\u8BE5\u8FD9\u6837\u505A\u3002
\u793A\u4F8B\u5982\u4E0B
DemoClass::class.java
-
\u73B0\u5728\uFF0C\u4F60\u53EF\u4EE5\u76F4\u63A5 cast
\u4E00\u4E2A\u5B9E\u4F8B\u5E76\u83B7\u53D6\u5B83\u7684 Class
\u5BF9\u8C61\uFF0C\u5FC5\u987B\u5728\u5F53\u524D ClassLoader
\u4E0B\u5B58\u5728\u3002
\u793A\u4F8B\u5982\u4E0B
classOf<DemoClass>()
-
\u82E5\u76EE\u6807\u5B58\u5728\u7684 Class
\u4E3A stub
\uFF0C\u901A\u8FC7\u8FD9\u79CD\u65B9\u5F0F\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u81EA\u5B9A\u4E49 Class
\u6240\u5728\u7684 ClassLoader
\u3002
\u793A\u4F8B\u5982\u4E0B
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-classOf<DemoClass>(customClassLoader)
-
fun String.hasClass(loader: ClassLoader?): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u901A\u8FC7\u5B57\u7B26\u4E32\u7C7B\u540D\u4F7F\u7528\u6307\u5B9A\u7684
ClassLoader
\u67E5\u627E\u662F\u5426\u5B58\u5728\u3002
\u529F\u80FD\u793A\u4F8B
\u4F60\u53EF\u4EE5\u8F7B\u677E\u7684\u4F7F\u7528\u6B64\u65B9\u6CD5\u5224\u65AD\u5B57\u7B26\u4E32\u4E2D\u7684\u7C7B\u662F\u5426\u5B58\u5728\uFF0C\u6548\u679C\u7B49\u540C\u4E8E\u76F4\u63A5\u4F7F\u7528 Class.forName
\u3002
\u793A\u4F8B\u5982\u4E0B
if("com.example.demo.DemoClass".hasClass()) {
- // Your code here.
-}
-
\u586B\u5165\u65B9\u6CD5\u4E2D\u7684 loader
\u53C2\u6570\u53EF\u5224\u65AD\u6307\u5B9A\u7684 ClassLoader
\u4E2D\u7684 Class
\u662F\u5426\u5B58\u5728\u3002
\u793A\u4F8B\u5982\u4E0B
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-if("com.example.demo.DemoClass".hasClass(customClassLoader)) {
- // Your code here.
-}
-
inline fun Class<*>.hasField(initiate: FieldConditions): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E\u53D8\u91CF\u662F\u5426\u5B58\u5728\u3002
inline fun Class<*>.hasMethod(initiate: MethodConditions): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E\u65B9\u6CD5\u662F\u5426\u5B58\u5728\u3002
inline fun Class<*>.hasConstructor(initiate: ConstructorConditions): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E\u6784\u9020\u65B9\u6CD5\u662F\u5426\u5B58\u5728\u3002
inline fun Member.hasModifiers(conditions: ModifierConditions): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E
Member
\u4E2D\u5339\u914D\u7684\u63CF\u8FF0\u7B26\u3002
inline fun Class<*>.hasModifiers(conditions: ModifierConditions): Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E
Class
\u4E2D\u5339\u914D\u7684\u63CF\u8FF0\u7B26\u3002
inline fun Class<*>.field(initiate: FieldConditions): FieldFinder.Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E\u5E76\u5F97\u5230\u53D8\u91CF\u3002
inline fun Class<*>.method(initiate: MethodConditions): MethodFinder.Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E\u5E76\u5F97\u5230\u65B9\u6CD5\u3002
inline fun Class<*>.constructor(initiate: ConstructorConditions): ConstructorFinder.Result
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u67E5\u627E\u5E76\u5F97\u5230\u6784\u9020\u65B9\u6CD5\u3002
fun Class<*>.generic(): GenericClass?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
Class
\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun Class<*>.generic(initiate: GenericClass.() -> Unit): GenericClass?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D
Class
\u7684\u6CDB\u578B\u7236\u7C7B\u3002
\u5982\u679C\u5F53\u524D\u5B9E\u4F8B\u4E0D\u5B58\u5728\u6CDB\u578B\u5C06\u8FD4\u56DE null
\u3002
inline fun <reified T : Any> T.current(ignored: Boolean): CurrentClass
-
inline fun <reified T : Any> T.current(ignored: Boolean, initiate: CurrentClass.() -> Unit): T
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7684\u7C7B\u64CD\u4F5C\u5BF9\u8C61\u3002
inline fun Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): Any?
-
inline fun <T> Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): T?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u901A\u8FC7\u6784\u9020\u65B9\u6CD5\u521B\u5EFA\u65B0\u5B9E\u4F8B\uFF0C\u6307\u5B9A\u7C7B\u578B
T
\u6216\u4EFB\u610F\u7C7B\u578BAny
\u3002
inline fun Class<*>.allMethods(isAccessible: Boolean, result: (index: Int, method: Method) -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u904D\u5386\u5F53\u524D\u7C7B\u4E2D\u7684\u6240\u6709\u65B9\u6CD5\u3002
inline fun Class<*>.allConstructors(isAccessible: Boolean, result: (index: Int, constructor: Constructor<*>) -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u904D\u5386\u5F53\u524D\u7C7B\u4E2D\u7684\u6240\u6709\u6784\u9020\u65B9\u6CD5\u3002
inline fun Class<*>.allFields(isAccessible: Boolean, result: (index: Int, field: Field) -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
`,235),p=[e];function c(t,r){return a(),n("div",null,p)}const i=s(o,[["render",c],["__file","ReflectionFactory.html.vue"]]);export{i as default}; diff --git a/docs/assets/VariableTypeFactory.html.216c2fbf.js b/docs/assets/VariableTypeFactory.html.216c2fbf.js deleted file mode 100644 index 666ef5e..0000000 --- a/docs/assets/VariableTypeFactory.html.216c2fbf.js +++ /dev/null @@ -1 +0,0 @@ -const a=JSON.parse('{"key":"v-5ad1133e","path":"/zh-cn/api/public/com/highcapable/yukireflection/type/java/VariableTypeFactory.html","title":"VariableTypeFactory - kt","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/type/java/VariableTypeFactory.md"}');export{a as data}; diff --git a/docs/assets/VariableTypeFactory.html.2f75d9b7.js b/docs/assets/VariableTypeFactory.html.2f75d9b7.js deleted file mode 100644 index 9e6bcb0..0000000 --- a/docs/assets/VariableTypeFactory.html.2f75d9b7.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,r as c,o as r,c as n,b as a,d as s,a as l,e}from"./app.2add9aa5.js";const i={},d=l('\u904D\u5386\u5F53\u524D\u7C7B\u4E2D\u7684\u6240\u6709\u53D8\u91CF\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
',5),p=e("\u8BE6\u60C5\u53EF "),_={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/java/VariableTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},h=e("\u70B9\u51FB\u8FD9\u91CC"),b=e(" \u8FDB\u884C\u67E5\u770B\u3002");function f(y,k){const o=c("ExternalLinkIcon");return r(),n("div",null,[d,a("p",null,[p,a("a",_,[h,s(o)]),b])])}const u=t(i,[["render",f],["__file","VariableTypeFactory.html.vue"]]);export{u as default}; diff --git a/docs/assets/VariableTypeFactory.html.85b2fcf2.js b/docs/assets/VariableTypeFactory.html.85b2fcf2.js deleted file mode 100644 index afd16bf..0000000 --- a/docs/assets/VariableTypeFactory.html.85b2fcf2.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-12f074b0","path":"/en/api/public/com/highcapable/yukireflection/type/java/VariableTypeFactory.html","title":"VariableTypeFactory - kt","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":3}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/type/java/VariableTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/VariableTypeFactory.html.a02b32e0.js b/docs/assets/VariableTypeFactory.html.a02b32e0.js deleted file mode 100644 index 106eaff..0000000 --- a/docs/assets/VariableTypeFactory.html.a02b32e0.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,r as n,o as r,c,b as t,d as s,a as i,e}from"./app.2add9aa5.js";const l={},p=i('\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Java
\u76F8\u5173\u57FA\u672C\u53D8\u91CF\u7C7B\u578B\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
',6),d=e("\u8BE6\u60C5\u53EF "),h={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/java/VariableTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},_=e("\u70B9\u51FB\u8FD9\u91CC"),u=e(" \u8FDB\u884C\u67E5\u770B\u3002");function f(b,m){const o=n("ExternalLinkIcon");return r(),c("div",null,[p,t("p",null,[d,t("a",h,[_,s(o)]),u])])}const g=a(l,[["render",f],["__file","VariableTypeFactory.html.vue"]]);export{g as default}; diff --git a/docs/assets/VariousClass.html.416446a8.js b/docs/assets/VariousClass.html.416446a8.js deleted file mode 100644 index 7e697d3..0000000 --- a/docs/assets/VariousClass.html.416446a8.js +++ /dev/null @@ -1,4 +0,0 @@ -import{_ as s,o,c as a,a as n}from"./app.2add9aa5.js";const l={},e=n(`\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Java
\u76F8\u5173\u57FA\u672C\u53D8\u91CF\u7C7B\u578B\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class VariousClass(private vararg val name: String)
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A\u4E0D\u786E\u5B9A\u6027
Class
\u7C7B\u540D\u88C5\u8F7D\u5668\uFF0C\u901A\u8FC7name
\u88C5\u8F7DClass
\u540D\u79F0\u6570\u7EC4\u3002
fun get(loader: ClassLoader? = null, initialize: Boolean): Class<*>
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u53D6\u5339\u914D\u7684\u5B9E\u4F53\u7C7B\u3002
\u4F7F\u7528\u5F53\u524D loader
\u88C5\u8F7D\u76EE\u6807 Class
\u3002
fun getOrNull(loader: ClassLoader? = null, initialize: Boolean): Class<*>?
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u53D6\u5339\u914D\u7684\u5B9E\u4F53\u7C7B\u3002
\u4F7F\u7528\u5F53\u524D loader
\u88C5\u8F7D\u76EE\u6807 Class
\u3002
\u5339\u914D\u4E0D\u5230 Class
\u4F1A\u8FD4\u56DE null
\uFF0C\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38\u3002
class VariousClass(private vararg val name: String)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A\u4E0D\u786E\u5B9A\u6027
Class
\u7C7B\u540D\u88C5\u8F7D\u5668\uFF0C\u901A\u8FC7name
\u88C5\u8F7DClass
\u540D\u79F0\u6570\u7EC4\u3002
fun get(loader: ClassLoader? = null, initialize: Boolean): Class<*>
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u53D6\u5339\u914D\u7684\u5B9E\u4F53\u7C7B\u3002
\u4F7F\u7528\u5F53\u524D loader
\u88C5\u8F7D\u76EE\u6807 Class
\u3002
fun getOrNull(loader: ClassLoader? = null, initialize: Boolean): Class<*>?
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u53D6\u5339\u914D\u7684\u5B9E\u4F53\u7C7B\u3002
\u4F7F\u7528\u5F53\u524D loader
\u88C5\u8F7D\u76EE\u6807 Class
\u3002
\u5339\u914D\u4E0D\u5230 Class
\u4F1A\u8FD4\u56DE null
\uFF0C\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
',5),p=e("\u8BE6\u60C5\u53EF "),_={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ViewTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},h=e("\u70B9\u51FB\u8FD9\u91CC"),f=e(" \u8FDB\u884C\u67E5\u770B\u3002");function y(k,m){const t=a("ExternalLinkIcon");return n(),r("div",null,[l,o("p",null,[p,o("a",_,[h,s(t)]),f])])}const b=c(d,[["render",y],["__file","ViewTypeFactory.html.vue"]]);export{b as default}; diff --git a/docs/assets/ViewTypeFactory.html.419f7049.js b/docs/assets/ViewTypeFactory.html.419f7049.js deleted file mode 100644 index 56230e9..0000000 --- a/docs/assets/ViewTypeFactory.html.419f7049.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-12826b1f","path":"/zh-cn/api/public/com/highcapable/yukireflection/type/android/ViewTypeFactory.html","title":"ViewTypeFactory - kt","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/type/android/ViewTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/ViewTypeFactory.html.4f37f6c4.js b/docs/assets/ViewTypeFactory.html.4f37f6c4.js deleted file mode 100644 index 3f96ad4..0000000 --- a/docs/assets/ViewTypeFactory.html.4f37f6c4.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as n,r as a,o as c,c as r,b as t,d as s,a as i,e}from"./app.2add9aa5.js";const l={},d=i('\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Android
\u76F8\u5173Widget
\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
',6),p=e("\u8BE6\u60C5\u53EF "),h={href:"https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ViewTypeFactory.kt",target:"_blank",rel:"noopener noreferrer"},_=e("\u70B9\u51FB\u8FD9\u91CC"),u=e(" \u8FDB\u884C\u67E5\u770B\u3002");function f(m,y){const o=a("ExternalLinkIcon");return c(),r("div",null,[d,t("p",null,[p,t("a",h,[_,s(o)]),u])])}const k=n(l,[["render",f],["__file","ViewTypeFactory.html.vue"]]);export{k as default}; diff --git a/docs/assets/ViewTypeFactory.html.fd43bb20.js b/docs/assets/ViewTypeFactory.html.fd43bb20.js deleted file mode 100644 index 6e5bf9c..0000000 --- a/docs/assets/ViewTypeFactory.html.fd43bb20.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-be0e3220","path":"/en/api/public/com/highcapable/yukireflection/type/android/ViewTypeFactory.html","title":"ViewTypeFactory - kt","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[],"git":{"updatedTime":1683882215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":3}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/type/android/ViewTypeFactory.md"}');export{e as data}; diff --git a/docs/assets/YukiReflection.html.071d5ea0.js b/docs/assets/YukiReflection.html.071d5ea0.js deleted file mode 100644 index b93a34a..0000000 --- a/docs/assets/YukiReflection.html.071d5ea0.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-23f4d2be","path":"/en/api/public/com/highcapable/yukireflection/YukiReflection.html","title":"YukiReflection - object","lang":"en-US","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"API_VERSION_NAME - field","slug":"api-version-name-field","link":"#api-version-name-field","children":[]},{"level":2,"title":"API_VERSION_CODE - field","slug":"api-version-code-field","link":"#api-version-code-field","children":[]},{"level":2,"title":"Configs - object","slug":"configs-object","link":"#configs-object","children":[{"level":3,"title":"debugTag - field","slug":"debugtag-field","link":"#debugtag-field","children":[]},{"level":3,"title":"isDebug - field","slug":"isdebug-field","link":"#isdebug-field","children":[]},{"level":3,"title":"isAllowPrintingLogs - field","slug":"isallowprintinglogs-field","link":"#isallowprintinglogs-field","children":[]}]},{"level":2,"title":"configs - method","slug":"configs-method","link":"#configs-method","children":[]}],"git":{"updatedTime":1682370215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":3}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/YukiReflection.md"}');export{e as data}; diff --git a/docs/assets/YukiReflection.html.6e790ebd.js b/docs/assets/YukiReflection.html.6e790ebd.js deleted file mode 100644 index bea897b..0000000 --- a/docs/assets/YukiReflection.html.6e790ebd.js +++ /dev/null @@ -1,9 +0,0 @@ -import{_ as s,o,c as e,a as n}from"./app.2add9aa5.js";const a={},l=n(`\u8FD9\u662F\u4E00\u4E2A\u9884\u7F6E\u53CD\u5C04\u7C7B\u578B\u7684\u5E38\u91CF\u7C7B\uFF0C\u4E3B\u8981\u4E3A
Android
\u76F8\u5173Widget
\u7684Class
\u5185\u5BB9\uFF0C\u8DDF\u968F\u7248\u672C\u66F4\u65B0\u4F1A\u9010\u4E00\u8FDB\u884C\u589E\u52A0\u3002
object YukiReflection
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F
YukiReflection
\u7684\u88C5\u8F7D\u8C03\u7528\u7C7B\u3002
const val API_VERSION_NAME: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u53D6\u5F53\u524D
YukiReflection
\u7684\u7248\u672C\u3002
const val API_VERSION_CODE: Int
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u83B7\u53D6\u5F53\u524D
YukiReflection
\u7684\u7248\u672C\u53F7\u3002
object Configs
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5BF9 API \u76F8\u5173\u529F\u80FD\u7684\u914D\u7F6E\u7C7B\u3002
var debugTag: String
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u8FD9\u662F\u4E00\u4E2A\u8C03\u8BD5\u65E5\u5FD7\u7684\u5168\u5C40\u6807\u8BC6\u3002
\u9ED8\u8BA4\u6587\u6848\u4E3A YukiReflection
\u3002
\u4F60\u53EF\u4EE5\u4FEE\u6539\u4E3A\u4F60\u81EA\u5DF1\u7684\u6587\u6848\u3002
var isDebug: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u542F\u7528 Debug \u6A21\u5F0F\u3002
\u9ED8\u8BA4\u4E0D\u542F\u7528\uFF0C\u542F\u7528\u540E\u5C06\u4EA4\u7531\u65E5\u5FD7\u8F93\u51FA\u7BA1\u7406\u5668\u6253\u5370\u8BE6\u7EC6\u65E5\u5FD7 (\u4F8B\u5982\u53CD\u5C04\u67E5\u627E\u529F\u80FD\u7684\u8017\u65F6) \u5230\u63A7\u5236\u53F0\u3002
\u8BF7\u8FC7\u6EE4 debugTag
\u5373\u53EF\u627E\u5230\u6BCF\u6761\u65E5\u5FD7\u3002
var isAllowPrintingLogs: Boolean
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u662F\u5426\u542F\u7528\u8C03\u8BD5\u65E5\u5FD7\u7684\u8F93\u51FA\u529F\u80FD\u3002
\u6CE8\u610F
\u5173\u95ED\u540E\u5C06\u4F1A\u505C\u7528 YukiReflection \u5BF9\u5168\u90E8\u65E5\u5FD7\u7684\u8F93\u51FA\u3002
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
v1.0.2
\u4F5C\u5E9F
Member
\u7684\u76F4\u63A5\u7F13\u5B58\u529F\u80FD\u5DF2\u88AB\u79FB\u9664\uFF0C\u56E0\u4E3A\u5176\u5B58\u5728\u5185\u5B58\u6EA2\u51FA (OOM) \u95EE\u9898
inline fun configs(initiate: Configs.() -> Unit)
-
\u53D8\u66F4\u8BB0\u5F55
v1.0.0
\u6DFB\u52A0
\u529F\u80FD\u63CF\u8FF0
\u5BF9
Configs
\u7C7B\u5B9E\u73B0\u4E86\u4E00\u4E2Alambda
\u65B9\u6CD5\u4F53\u3002
\u4F60\u53EF\u4EE5\u8F7B\u677E\u5730\u8C03\u7528\u5B83\u8FDB\u884C\u914D\u7F6E\u3002
`,59),c=[l];function p(t,r){return o(),e("div",null,c)}const d=s(a,[["render",p],["__file","YukiReflection.html.vue"]]);export{d as default}; diff --git a/docs/assets/YukiReflection.html.787cb57f.js b/docs/assets/YukiReflection.html.787cb57f.js deleted file mode 100644 index cd74156..0000000 --- a/docs/assets/YukiReflection.html.787cb57f.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-c088ede0","path":"/zh-cn/api/public/com/highcapable/yukireflection/YukiReflection.html","title":"YukiReflection - object","lang":"zh-CN","frontmatter":{"pageClass":"code-page"},"excerpt":"","headers":[{"level":2,"title":"API_VERSION_NAME - field","slug":"api-version-name-field","link":"#api-version-name-field","children":[]},{"level":2,"title":"API_VERSION_CODE - field","slug":"api-version-code-field","link":"#api-version-code-field","children":[]},{"level":2,"title":"Configs - object","slug":"configs-object","link":"#configs-object","children":[{"level":3,"title":"debugTag - field","slug":"debugtag-field","link":"#debugtag-field","children":[]},{"level":3,"title":"isDebug - field","slug":"isdebug-field","link":"#isdebug-field","children":[]},{"level":3,"title":"isAllowPrintingLogs - field","slug":"isallowprintinglogs-field","link":"#isallowprintinglogs-field","children":[]}]},{"level":2,"title":"configs - method","slug":"configs-method","link":"#configs-method","children":[]}],"git":{"updatedTime":1682370215000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":2}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/YukiReflection.md"}');export{e as data}; diff --git a/docs/assets/YukiReflection.html.9b18a061.js b/docs/assets/YukiReflection.html.9b18a061.js deleted file mode 100644 index cf749b2..0000000 --- a/docs/assets/YukiReflection.html.9b18a061.js +++ /dev/null @@ -1,9 +0,0 @@ -import{_ as s,o as e,c as o,a as n}from"./app.2add9aa5.js";const a={},l=n(`Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
object YukiReflection
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F
YukiReflection
\u7684\u88C5\u8F7D\u8C03\u7528\u7C7B\u3002
const val API_VERSION_NAME: String
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u53D6\u5F53\u524D
YukiReflection
\u7684\u7248\u672C\u3002
const val API_VERSION_CODE: Int
-
Change Records
v1.0.0
first
Function Illustrate
\u83B7\u53D6\u5F53\u524D
YukiReflection
\u7684\u7248\u672C\u53F7\u3002
object Configs
-
Change Records
v1.0.0
first
Function Illustrate
\u5BF9 API \u76F8\u5173\u529F\u80FD\u7684\u914D\u7F6E\u7C7B\u3002
var debugTag: String
-
Change Records
v1.0.0
first
Function Illustrate
\u8FD9\u662F\u4E00\u4E2A\u8C03\u8BD5\u65E5\u5FD7\u7684\u5168\u5C40\u6807\u8BC6\u3002
\u9ED8\u8BA4\u6587\u6848\u4E3A YukiReflection
\u3002
\u4F60\u53EF\u4EE5\u4FEE\u6539\u4E3A\u4F60\u81EA\u5DF1\u7684\u6587\u6848\u3002
var isDebug: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u542F\u7528 Debug \u6A21\u5F0F\u3002
\u9ED8\u8BA4\u4E0D\u542F\u7528\uFF0C\u542F\u7528\u540E\u5C06\u4EA4\u7531\u65E5\u5FD7\u8F93\u51FA\u7BA1\u7406\u5668\u6253\u5370\u8BE6\u7EC6\u65E5\u5FD7 (\u4F8B\u5982\u53CD\u5C04\u67E5\u627E\u529F\u80FD\u7684\u8017\u65F6) \u5230\u63A7\u5236\u53F0\u3002
\u8BF7\u8FC7\u6EE4 debugTag
\u5373\u53EF\u627E\u5230\u6BCF\u6761\u65E5\u5FD7\u3002
var isAllowPrintingLogs: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
\u662F\u5426\u542F\u7528\u8C03\u8BD5\u65E5\u5FD7\u7684\u8F93\u51FA\u529F\u80FD\u3002
Notice
\u5173\u95ED\u540E\u5C06\u4F1A\u505C\u7528 YukiReflection \u5BF9\u5168\u90E8\u65E5\u5FD7\u7684\u8F93\u51FA\u3002
Change Records
v1.0.0
first
v1.0.2
deprecated
Member
\u7684\u76F4\u63A5\u7F13\u5B58\u529F\u80FD\u5DF2\u88AB\u79FB\u9664\uFF0C\u56E0\u4E3A\u5176\u5B58\u5728\u5185\u5B58\u6EA2\u51FA (OOM) \u95EE\u9898
inline fun configs(initiate: Configs.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
\u5BF9
Configs
\u7C7B\u5B9E\u73B0\u4E86\u4E00\u4E2Alambda
\u65B9\u6CD5\u4F53\u3002
\u4F60\u53EF\u4EE5\u8F7B\u677E\u5730\u8C03\u7528\u5B83\u8FDB\u884C\u914D\u7F6E\u3002
`,60),c=[l];function t(p,r){return e(),o("div",null,c)}const d=s(a,[["render",t],["__file","YukiReflection.html.vue"]]);export{d as default}; diff --git a/docs/assets/about.html.2effd4b1.js b/docs/assets/about.html.2effd4b1.js deleted file mode 100644 index 23a2dce..0000000 --- a/docs/assets/about.html.2effd4b1.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-7a15fe3b","path":"/en/about/about.html","title":"About this Document","lang":"en-US","frontmatter":{},"excerpt":"","headers":[{"level":2,"title":"License","slug":"license","link":"#license","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"en/about/about.md"}');export{e as data}; diff --git a/docs/assets/about.html.94009ddf.js b/docs/assets/about.html.94009ddf.js deleted file mode 100644 index 36c5491..0000000 --- a/docs/assets/about.html.94009ddf.js +++ /dev/null @@ -1,22 +0,0 @@ -import{_ as o,r as t,o as l,c,b as s,d as e,e as a,a as p}from"./app.2add9aa5.js";const i={},r=s("h1",{id:"about-this-document",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#about-this-document","aria-hidden":"true"},"#"),a(" About this Document")],-1),d=a("This document is powered by "),h={href:"https://v2.vuepress.vuejs.org/en",target:"_blank",rel:"noopener noreferrer"},b=a("VuePress"),T=a("."),u=s("h2",{id:"license",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#license","aria-hidden":"true"},"#"),a(" License")],-1),I={href:"https://github.com/fankes/YukiReflection/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer"},E=a("The MIT License (MIT)"),O=p(`MIT License
-
-Copyright (C) 2019-2023 HighCapable
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
Copyright \xA9 2019-2023 HighCapable
`,2);function N(R,_){const n=t("ExternalLinkIcon");return l(),c("div",null,[r,s("blockquote",null,[s("p",null,[d,s("a",h,[b,e(n)]),T])]),u,s("p",null,[s("a",I,[E,e(n)])]),O])}const f=o(i,[["render",N],["__file","about.html.vue"]]);export{f as default}; diff --git a/docs/assets/about.html.b758f732.js b/docs/assets/about.html.b758f732.js deleted file mode 100644 index 73e4754..0000000 --- a/docs/assets/about.html.b758f732.js +++ /dev/null @@ -1 +0,0 @@ -const e=JSON.parse('{"key":"v-41967128","path":"/zh-cn/about/about.html","title":"\u5173\u4E8E\u6B64\u6587\u6863","lang":"zh-CN","frontmatter":{},"excerpt":"","headers":[{"level":2,"title":"License","slug":"license","link":"#license","children":[]}],"git":{"updatedTime":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/about/about.md"}');export{e as data}; diff --git a/docs/assets/about.html.c8884850.js b/docs/assets/about.html.c8884850.js deleted file mode 100644 index 3f1c317..0000000 --- a/docs/assets/about.html.c8884850.js +++ /dev/null @@ -1,22 +0,0 @@ -import{_ as o,r as t,o as l,c,b as s,d as e,e as a,a as p}from"./app.2add9aa5.js";const i={},r=s("h1",{id:"\u5173\u4E8E\u6B64\u6587\u6863",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#\u5173\u4E8E\u6B64\u6587\u6863","aria-hidden":"true"},"#"),a(" \u5173\u4E8E\u6B64\u6587\u6863")],-1),d=a("\u6B64\u6587\u6863\u7531 "),h={href:"https://v2.vuepress.vuejs.org/zh",target:"_blank",rel:"noopener noreferrer"},b=a("VuePress"),T=a(" \u5F3A\u529B\u9A71\u52A8\u3002"),I=s("h2",{id:"license",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#license","aria-hidden":"true"},"#"),a(" License")],-1),E={href:"https://github.com/fankes/YukiReflection/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer"},u=a("The MIT License (MIT)"),O=p(`MIT License
-
-Copyright (C) 2019-2023 HighCapable
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
\u7248\u6743\u6240\u6709 \xA9 2019-2023 HighCapable
`,2);function N(R,_){const n=t("ExternalLinkIcon");return l(),c("div",null,[r,s("blockquote",null,[s("p",null,[d,s("a",h,[b,e(n)]),T])]),I,s("p",null,[s("a",E,[u,e(n)])]),O])}const y=o(i,[["render",N],["__file","about.html.vue"]]);export{y as default}; diff --git a/docs/assets/api-example.html.4692aae4.js b/docs/assets/api-example.html.4692aae4.js deleted file mode 100644 index 9bda7cf..0000000 --- a/docs/assets/api-example.html.4692aae4.js +++ /dev/null @@ -1,28 +0,0 @@ -import{_ as s,o as n,c as a,a as e}from"./app.2add9aa5.js";const l={},o=e(`\u8FD9\u91CC\u4ECB\u7ECD\u4E86
YukiReflection
\u7684\u57FA\u672C\u914D\u7F6E\u65B9\u6CD5\u3002
YukiReflection
\u65E0\u9700\u4E00\u4E9B\u590D\u6742\u7684\u914D\u7F6E\u5373\u53EF\u76F4\u63A5\u5F00\u59CB\u4F7F\u7528\uFF0C\u4E14\u4E0D\u4F1A\u4E0E Java
\u539F\u751F\u7684\u53CD\u5C04 API \u51B2\u7A81\u3002
\u4F60\u53EF\u4EE5\u5728\u4F7F\u7528\u4E4B\u524D\u5BF9 YukiReflection
\u8FDB\u884C\u4E00\u4E9B\u529F\u80FD\u914D\u7F6E\u3002
\u4F60\u53EF\u4EE5\u901A\u8FC7\u5982\u4E0B\u65B9\u5F0F\u83B7\u53D6\u5F53\u524D YukiReflection
\u7684 API \u7248\u672C\u3002
\u793A\u4F8B\u5982\u4E0B
// \u83B7\u53D6\u7248\u672C\u540D\u79F0
-val versionName = YukiReflection.API_VERSION_NAME
-// \u83B7\u53D6\u7248\u672C\u53F7
-val versionCode = YukiReflection.API_VERSION_CODE
-
\u4F60\u53EF\u4EE5\u901A\u8FC7\u83B7\u53D6\u7248\u672C\u8FDB\u884C\u4E00\u4E9B\u4E0D\u540C\u7248\u672C\u5DEE\u5F02\u7684\u5224\u65AD\u6216\u7528\u4E8E\u663E\u793A\u5728\u5173\u4E8E\u4FE1\u606F\u4E2D\u3002
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 YukiReflection\u3002
\u4F60\u53EF\u4EE5\u901A\u8FC7 YukiReflection.configs { ... }
\u65B9\u6CD5\u6216 YukiReflection.Configs
\u6765\u914D\u7F6E\u76F8\u5173\u529F\u80FD\u3002
\u4F60\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u6765\u81EA\u5B9A\u4E49\u8C03\u8BD5\u65E5\u5FD7\u7684\u6807\u7B7E\u3002
API \u5185\u90E8\u7684\u65E5\u5FD7\u5C06\u4F1A\u4F7F\u7528\u6B64\u6807\u7B7E\u8FDB\u884C\u6253\u5370\u3002
\u793A\u4F8B\u5982\u4E0B
// \u901A\u8FC7 configs \u65B9\u6CD5
-YukiReflection.configs {
- debugTag = "YourCustomTag"
-}
-// \u76F4\u63A5\u8BBE\u7F6E
-YukiReflection.Configs.debugTag = "YourCustomTag"
-
\u4F60\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u6765\u542F\u7528\u6216\u7981\u7528 Debug \u6A21\u5F0F\u3002
Debug \u6A21\u5F0F\u9ED8\u8BA4\u662F\u5173\u95ED\u7684\uFF0C\u542F\u7528\u540E\u5C06\u4F1A\u6253\u5370\u8BE6\u7EC6\u65E5\u5FD7 (\u4F8B\u5982\u53CD\u5C04\u67E5\u627E\u529F\u80FD\u7684\u8017\u65F6) \u5230\u63A7\u5236\u53F0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u901A\u8FC7 configs \u65B9\u6CD5
-YukiReflection.configs {
- isDebug = true
-}
-// \u76F4\u63A5\u8BBE\u7F6E
-YukiReflection.Configs.isDebug = true
-
\u4F60\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u6765\u542F\u7528\u6216\u7981\u7528\u8C03\u8BD5\u65E5\u5FD7\u7684\u8F93\u51FA\u529F\u80FD\u3002
\u6B64\u529F\u80FD\u9ED8\u8BA4\u542F\u7528\uFF0C\u5173\u95ED\u540E\u5C06\u4F1A\u505C\u7528 YukiReflection
\u5BF9\u5168\u90E8\u65E5\u5FD7\u7684\u8F93\u51FA\u3002
\u793A\u4F8B\u5982\u4E0B
// \u901A\u8FC7 configs \u65B9\u6CD5
-YukiReflection.configs {
- isAllowPrintingLogs = true
-}
-// \u76F4\u63A5\u8BBE\u7F6E
-YukiReflection.Configs.isAllowPrintingLogs = true
-
\u4E3A\u4E86\u4E00\u6B21\u6027\u914D\u7F6E\u591A\u4E2A\u529F\u80FD\uFF0C\u4F60\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 YukiReflection.configs { ... }
\u65B9\u6CD5\u8FDB\u884C\u914D\u7F6E\u3002
\u793A\u4F8B\u5982\u4E0B
YukiReflection.configs {
- debugTag = "YourCustomTag"
- isDebug = true
- isAllowPrintingLogs = true
-}
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 YukiReflection.configs \u65B9\u6CD5\u3001YukiReflection.Configs\u3002
The basic configuration method of
YukiReflection
is introduced here.
YukiReflection
can be used directly without some complex configuration, and does not conflict with Java
's native Reflection API.
You can configure some functions of YukiReflection
before using it.
You can get the current API version of YukiReflection
as follows.
The following example
// Get the version name
-val versionName = YukiReflection. API_VERSION_NAME
-// Get the version code
-val versionCode = YukiReflection. API_VERSION_CODE
-
You can judge the difference between different versions or display it in the about information by obtaining the version.
Tips
For more functions, please refer to YukiReflection.
You can configure related functions through YukiReflection.configs { ... }
method or YukiReflection.Configs
.
You can use the following methods to customize the tag of the debug log.
Logs inside the API will be printed using this tag.
The following example
// Via the configs method
-YukiReflection.configs {
- debugTag = "YourCustomTag"
-}
-// Set directly
-YukiReflection.Configs.debugTag = "YourCustomTag"
-
You can use the following methods to enable or disable Debug mode.
The Debug mode is disabled by default, and when enabled, detailed logs (such as the time spent on the reflective search function) will be printed to the console.
The following example
// Via the configs method
-YukiReflection.configs {
- isDebug = true
-}
-// Set directly
-YukiReflection.Configs.isDebug = true
-
You can use the following methods to enable or disable debug logs.
This function is enabled by default, and disable will stop YukiReflection
output all logs.
The following example
// Via the configs method
-YukiReflection.configs {
- isAllowPrintingLogs = true
-}
-// Set directly
-YukiReflection.Configs.isAllowPrintingLogs = true
-
In order to configure multiple features at once, you can directly use the YukiReflection.configs { ... }
method to configure.
The following example
YukiReflection.configs {
- debugTag = "YourCustomTag"
- isDebug = true
- isAllowPrintingLogs = true
-}
-
Tips
For more functions, please refer to YukiReflection.configs method, YukiReflection.Configs.
\u5F02\u5E38\u662F\u5728\u5F00\u53D1\u8FC7\u7A0B\u7ECF\u5E38\u9047\u5230\u7684\u4E3B\u8981\u95EE\u9898\uFF0C\u8FD9\u91CC\u4ECB\u7ECD\u4E86
YukiReflection
\u5728\u4F7F\u7528\u8FC7\u7A0B\u4E2D\u53EF\u80FD\u9047\u5230\u7684\u5E38\u89C1\u5F02\u5E38\u4EE5\u53CA\u5904\u7406\u65B9\u5F0F\u3002
\u8FD9\u91CC\u7684\u5F02\u5E38\u8BF4\u660E\u53EA\u4F1A\u540C\u6B65\u6700\u65B0\u7684 API \u7248\u672C\uFF0C\u8F83\u65E7\u7684 API \u7248\u672C\u7684\u5F02\u5E38\u5C06\u4E0D\u4F1A\u518D\u8FDB\u884C\u8BF4\u660E\uFF0C\u8BF7\u59CB\u7EC8\u4FDD\u6301 API \u7248\u672C\u4E3A\u6700\u65B0\u3002
\u8FD9\u4E9B\u5F02\u5E38\u4E0D\u4F1A\u5BFC\u81F4 APP \u505C\u6B62\u8FD0\u884C (FC)\uFF0C\u4F46\u662F\u4F1A\u5728\u63A7\u5236\u53F0\u6253\u5370
E
\u7EA7\u522B\u7684\u65E5\u5FD7\uFF0C\u4E5F\u53EF\u80FD\u4F1A\u505C\u6B62\u7EE7\u7EED\u6267\u884C\u76F8\u5173\u529F\u80FD\u3002
loggerE
Method/Constructor/Field match type "TYPE" not allowed
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u8BBE\u7F6E\u4E86\u4E0D\u5141\u8BB8\u7684\u53C2\u6570\u7C7B\u578B\u3002
\u793A\u4F8B\u5982\u4E0B
// \u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5
-method {
- // \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B
- param(false, 1, 0)
- // \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B
- returnType = false
-}
-
-// \u67E5\u627E\u4E00\u4E2A\u53D8\u91CF
-field {
- // \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B
- type = false
-}
-
\u89E3\u51B3\u65B9\u6848
\u5728\u67E5\u627E\u4E2D param
\u3001returnType
\u3001type
\u4E2D\u4EC5\u63A5\u53D7 Class
\u3001String
\u3001VariousClass
\u7C7B\u578B\u7684\u4F20\u503C\uFF0C\u4E0D\u53EF\u4F20\u5165\u53C2\u6570\u5B9E\u4F8B\u3002
\u793A\u4F8B\u5982\u4E0B
// \u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5
-method {
- // \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B
- param(BooleanType, IntType, IntType)
- // \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B
- returnType = BooleanType
- // \u2705 \u4EE5\u4E0B\u65B9\u6848\u4E5F\u662F\u6B63\u786E\u7684
- returnType = "java.lang.Boolean"
-}
-
-// \u67E5\u627E\u4E00\u4E2A\u53D8\u91CF
-field {
- // \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B
- type = BooleanType
-}
-
loggerE
NoSuchMethod/NoSuchConstructor/NoSuchField happend in [NAME]
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u5E76\u672A\u627E\u5230\u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002
\u89E3\u51B3\u65B9\u6848
\u8BF7\u786E\u8BA4\u4F60\u7684\u67E5\u627E\u6761\u4EF6\u662F\u5426\u80FD\u6B63\u786E\u5339\u914D\u5230\u76EE\u6807 Class
\u4E2D\u7684\u6307\u5B9A\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002
loggerE
Trying COUNT times and all failure by RemedyPlan
\u5F02\u5E38\u539F\u56E0
\u4F7F\u7528 RemedyPlan
\u91CD\u65B0\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\u65F6\u4F9D\u7136\u6CA1\u6709\u627E\u5230\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\u3002
\u89E3\u51B3\u65B9\u6848
\u8BF7\u786E\u8BA4\u4F60\u8BBE\u7F6E\u7684 RemedyPlan
\u53C2\u6570\u4EE5\u53CA\u5F53\u524D APP \u5185\u5B58\u5728\u7684 Class
\uFF0C\u518D\u8BD5\u4E00\u6B21\u3002
loggerE
You must set a condition when finding a Method/Constructor/Field
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u5E76\u672A\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- // \u8FD9\u91CC\u6CA1\u6709\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6
-}
-
\u89E3\u51B3\u65B9\u6848
\u8BF7\u5C06\u67E5\u627E\u6761\u4EF6\u8865\u5145\u5B8C\u6574\u5E76\u518D\u8BD5\u4E00\u6B21\u3002
loggerE
Can't find this Class in [CLASSLOADER]: CONTENT Generated by YukiReflection#ReflectionTool
\u5F02\u5E38\u539F\u56E0
\u901A\u8FC7 ClassLoader.searchClass
\u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684 Class
\u5BF9\u8C61\u3002
\u793A\u4F8B\u5982\u4E0B
customClassLoader?.searchClass {
- from(...)
- // ...
-}.get()
-
\u89E3\u51B3\u65B9\u6848
\u8FD9\u662F\u4E00\u4E2A\u5B89\u5168\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u4F60\u8BBE\u7F6E\u7684\u6761\u4EF6\uFF0C\u4F7F\u7528\u76F8\u5173\u5DE5\u5177\u67E5\u770B\u6240\u5728 Dex \u4E2D\u7684 Class
\u4EE5\u53CA\u5B57\u8282\u7801\u5BF9\u8C61\u7279\u5F81\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002
loggerE
Can't find this Method/Constructor/Field in [CLASS]: CONTENT Generated by YukiReflection#ReflectionTool
\u5F02\u5E38\u539F\u56E0
\u901A\u8FC7\u6307\u5B9A\u6761\u4EF6\u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002
\u793A\u4F8B\u5982\u4E0B
TargetClass.method {
- name = "test"
- param(BooleanType)
-}
-
\u89E3\u51B3\u65B9\u6848
\u8FD9\u662F\u4E00\u4E2A\u5B89\u5168\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u4F60\u8BBE\u7F6E\u7684\u6761\u4EF6\uFF0C\u4F7F\u7528\u76F8\u5173\u5DE5\u5177\u67E5\u770B\u6240\u5728 Class
\u4E2D\u7684\u5B57\u8282\u7801\u5BF9\u8C61\u7279\u5F81\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002
loggerE
The number of VagueType must be at least less than the count of paramTypes
\u5F02\u5E38\u539F\u56E0
\u5728 Method
\u3001Constructor
\u67E5\u627E\u6761\u4EF6\u4E2D\u9519\u8BEF\u5730\u4F7F\u7528\u4E86 VagueType
\u3002
\u793A\u4F8B\u5982\u4E0B
TargetClass.method {
- name = "test"
- // <\u60C5\u666F1>
- param(VagueType)
- // <\u60C5\u666F2>
- param(VagueType, VagueType ...)
-}
-
\u89E3\u51B3\u65B9\u6848
VagueType
\u4E0D\u80FD\u5728\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u53C2\u6570\u4E2D\u5B8C\u5168\u586B\u5145\uFF0C\u82E5\u5B58\u5728\u8FD9\u6837\u7684\u9700\u6C42\u8BF7\u4F7F\u7528 paramCount
\u3002
loggerE
Field match type class is not found
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u53D8\u91CF\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D type
\u7684 Class
\u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- name = "test"
- // \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 type \u7684 Class \u5E76\u4E0D\u5B58\u5728
- type = "com.example.TestClass"
-}
-
\u89E3\u51B3\u65B9\u6848
\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D type
\u7684 Class
\u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002
loggerE
Method match returnType class is not found
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u65B9\u6CD5\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D returnType
\u7684 Class
\u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- name = "test"
- // \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 returnType \u7684 Class \u5E76\u4E0D\u5B58\u5728
- returnType = "com.example.TestClass"
-}
-
\u89E3\u51B3\u65B9\u6848
\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D returnType
\u7684 Class
\u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002
loggerE
Method/Constructor match paramType[INDEX] class is not found
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D param
\u7684 index
\u53F7\u4E0B\u6807\u7684 Class
\u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002
method {
- name = "test"
- // \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 1 \u53F7\u4E0B\u6807\u7684 Class \u5E76\u4E0D\u5B58\u5728
- param(StringClass, "com.example.TestClass", BooleanType)
-}
-
\u89E3\u51B3\u65B9\u6848
\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D param
\u7684 index
\u53F7\u4E0B\u6807\u7684 Class
\u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002
\u8FD9\u4E9B\u5F02\u5E38\u4F1A\u76F4\u63A5\u5BFC\u81F4 APP \u505C\u6B62\u8FD0\u884C (FC)\uFF0C\u540C\u65F6\u4F1A\u5728\u63A7\u5236\u53F0\u6253\u5370
E
\u7EA7\u522B\u7684\u65E5\u5FD7\u3002
NoClassDefFoundError
Can't find this Class in [CLASSLOADER]: CONTENT Generated by YukiReflection#ReflectionTool
\u5F02\u5E38\u539F\u56E0
\u901A\u8FC7 String.toClass(...)
\u6216 classOf<...>()
\u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684 Class
\u5BF9\u8C61\u3002
\u793A\u4F8B\u5982\u4E0B
"com.demo.Test".toClass()
-
\u89E3\u51B3\u65B9\u6848
\u8BF7\u68C0\u67E5\u5F53\u524D\u5B57\u7B26\u4E32\u6216\u5B9E\u4F53\u5339\u914D\u5230\u7684 Class
\u662F\u5426\u5B58\u5728\u4E8E\u5F53\u524D ClassLoader
\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002
IllegalStateException
ClassLoader [CLASSLOADER] is not a DexClassLoader
\u5F02\u5E38\u539F\u56E0
\u4F7F\u7528 ClassLoader.searchClass
\u67E5\u627E Class
\u4F46\u662F\u5F53\u524D ClassLoader
\u5E76\u4E0D\u7EE7\u627F\u4E8E BaseDexClassLoader
\u3002
\u89E3\u51B3\u65B9\u6848
\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0D\u5B58\u5728\uFF0C\u9664\u975E\u5F53\u524D APP \u5F15\u7528\u4E86\u975E ART \u5E73\u53F0\u7684\u53EF\u6267\u884C\u6587\u4EF6 (\u4F46\u662F\u8FD9\u79CD\u60C5\u51B5\u8FD8\u662F\u4E0D\u4F1A\u5B58\u5728) \u6216\u5F53\u524D ClassLoader
\u4E3A\u7A7A\u3002
IllegalStateException
VariousClass match failed of those CLASSES
\u5F02\u5E38\u539F\u56E0
\u5728\u4F7F\u7528 VariousClass
\u521B\u5EFA\u4E0D\u786E\u5B9A\u7684 Class
\u5BF9\u8C61\u65F6\u5168\u90E8\u7684 Class
\u90FD\u6CA1\u6709\u88AB\u627E\u5230\u3002
\u89E3\u51B3\u65B9\u6848
\u68C0\u67E5\u5F53\u524D APP \u5185\u662F\u5426\u5B58\u5728\u5176\u4E2D\u80FD\u591F\u5339\u914D\u7684 Class
\u540E\uFF0C\u518D\u8BD5\u4E00\u6B21\u3002
IllegalStateException
paramTypes is empty, please use emptyParam() instead
\u5F02\u5E38\u539F\u56E0
\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u4FDD\u7559\u4E86\u7A7A\u7684 param
\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- name = "test"
- // \u62EC\u53F7\u5185\u6CA1\u6709\u586B\u5199\u4EFB\u4F55\u53C2\u6570
- param()
-}
-
\u89E3\u51B3\u65B9\u6848
\u82E5\u8981\u6807\u8BC6\u6B64\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u6CA1\u6709\u53C2\u6570\uFF0C\u4F60\u53EF\u4EE5\u6709\u5982\u4E0B\u8BBE\u7F6E\u65B9\u6CD5\u3002
\u7B2C\u4E00\u79CD\uFF0C\u8BBE\u7F6E emptyParam
(\u63A8\u8350)
\u793A\u4F8B\u5982\u4E0B
method {
- name = "test"
- emptyParam()
-}
-
\u7B2C\u4E8C\u79CD\uFF0C\u8BBE\u7F6E paramCount = 0
\u793A\u4F8B\u5982\u4E0B
method {
- name = "test"
- paramCount = 0
-}
-
IllegalStateException
Cannot create classes cache for "android", please remove "name" param
\u5F02\u5E38\u539F\u56E0
\u5728\u7CFB\u7EDF\u6846\u67B6 (android) \u4E2D\u4F7F\u7528\u4E86 DexClassFinder
\u7684\u7F13\u5B58\u529F\u80FD searchClass(name = ...)
\u3002
\u793A\u4F8B\u5982\u4E0B
searchClass(name = "test") {
- from(...)
- // ...
-}.get()
-
\u89E3\u51B3\u65B9\u6848
\u7531\u4E8E\u7F13\u5B58\u4F1A\u5C06\u627E\u5230\u7684 Class
\u540D\u79F0\u5B58\u5165 SharedPreferences
\uFF0C\u4F46\u662F\u7CFB\u7EDF\u6846\u67B6\u4E0D\u5B58\u5728 data \u76EE\u5F55\uFF0C\u6240\u4EE5\u8BF7\u4E0D\u8981\u5728\u7CFB\u7EDF\u6846\u67B6\u4E2D\u4F7F\u7528\u6B64\u529F\u80FD\u3002
IllegalStateException
Target Class type cannot cast to TYPE
\u5F02\u5E38\u539F\u56E0
\u4F7F\u7528 Class.toClass
\u3001Class.toClassOrNull
\u3001GenericClass.argument
\u65B9\u6CD5\u5C06\u5B57\u7B26\u4E32\u7C7B\u540D\u8F6C\u6362\u4E3A\u76EE\u6807 Class
\u65F6\u58F0\u660E\u4E86\u9519\u8BEF\u7684\u7C7B\u578B\u3002
\u4EE5\u4E0B\u4F7F\u7528 Class.toClass
\u65B9\u6CD5\u6765\u8FDB\u884C\u793A\u4F8B\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u76EE\u6807\u7C7B\u578B\u662F Activity \u4F46\u662F\u88AB\u9519\u8BEF\u5730\u8F6C\u6362\u4E3A\u4E86 WrongClass \u7C7B\u578B
-val clazz = "android.app.Activity".toClass<WrongClass>()
-
\u89E3\u51B3\u65B9\u6848
\u793A\u4F8B\u5982\u4E0B
// <\u89E3\u51B3\u65B9\u6848 1> \u586B\u5199\u6B63\u786E\u7684\u7C7B\u578B
-val clazz1 = "android.app.Activity".toClass<Activity>()
-// <\u89E3\u51B3\u65B9\u6848 2> \u4E0D\u586B\u5199\u6CDB\u578B\u58F0\u660E
-val clazz2 = "android.app.Activity".toClass()
-
\u8BF7\u786E\u4FDD\u6267\u884C\u65B9\u6CD5\u540E\u58F0\u660E\u7684\u6CDB\u578B\u662F\u6307\u5B9A\u7684\u76EE\u6807 Class
\u7C7B\u578B\uFF0C\u5728\u4E0D\u786E\u5B9A\u76EE\u6807\u7C7B\u578B\u7684\u60C5\u51B5\u4E0B\u4F60\u53EF\u4EE5\u4E0D\u9700\u8981\u586B\u5199\u6CDB\u578B\u58F0\u660E\u3002
Exceptions are the main problems often encountered in the development process. Here are some common exceptions that may be encountered during the use of
YukiReflection
and how to deal with them.
The exception description here will only synchronize the latest API version, and the exception of the older API version will not be described again, please always keep the API version up-to-date.
These exceptions will not cause the app to stop running (FC), but will print
E
level logs on the console, and may also stop continuing to execute related functions.
loggerE
Method/Constructor/Field match type "TYPE" not allowed
Abnormal
A disallowed parameter type was set when looking up methods, constructors, and variables.
The following example
// Find a method
-method {
- // \u2757 Invalid type example is set
- param(false, 1, 0)
- // \u2757 Invalid type example is set
- returnType = false
-}
-
-// Find a variable
-field {
- // \u2757 Invalid type example is set
- type = false
-}
-
Solution
In the search, param
, returnType
, type
only accept Class
, String
, VariousClass
types, and parameter instances cannot be passed in.
The following example
// Find a method
-method {
- // \u2705 Examples of correct usage
- param(BooleanType, IntType, IntType)
- // \u2705 Examples of correct usage
- returnType = BooleanType
- // \u2705 The following scheme is also correct
- returnType = "java.lang.Boolean"
-}
-
-// Find a variable
-field {
- // \u2705 Examples of correct usage
- type = BooleanType
-}
-
loggerE
NoSuchMethod/NoSuchConstructor/NoSuchField happend in [NAME]
Abnormal
The target method, constructor, and variable were not found when looking for methods, constructors, and variables.
Solution
Please confirm that your search criteria can correctly match the specified methods, constructors and variables in the target Class
.
loggerE
Trying COUNT times and all failure by RemedyPlan
Abnormal
When using RemedyPlan
to search for methods, constructors, and variables, the methods, constructors, and variables are still not found.
Solution
Please confirm the RemedyPlan
parameter you set and the Class
that exists in the current app, and try again.
loggerE
You must set a condition when finding a Method/Constructor/Field
Abnormal
No conditions are set when looking for methods, constructors, and variables.
The following example
method {
- // No conditions are set here
-}
-
Solution
Please complete your search criteria and try again.
loggerE
Can't find this Class in [CLASSLOADER]: CONTENT Generated by YukiReflection#ReflectionTool
Abnormal
The Class
object to be searched for was not found via ClassLoader.searchClass
.
The following example
customClassLoader?.searchClass {
- from(...)
- // ...
-}.get()
-
Solution
This is a security exception, please check the conditions you set, use the relevant tools to view the Class
and bytecode object characteristics in the Dex and try again.
loggerE
Can't find this Method/Constructor/Field in [CLASS]: CONTENT Generated by YukiReflection#ReflectionTool
Abnormal
The methods, constructors, and variables that need to be found cannot be found by specifying conditions.
The following example
TargetClass.method {
- name = "test"
- param(BooleanType)
-}
-
Solution
This is a security exception, please check the conditions you set, use the relevant tools to view the bytecode object characteristics in the Class
, and try again.
loggerE
The number of VagueType must be at least less than the count of paramTypes
Abnormal
Incorrect use of VagueType
in Method
, Constructor
lookup conditions.
The following example
TargetClass.method {
- name = "test"
- // <Scenario 1>
- param(VagueType)
- // <Scenario 2>
- param(VagueType, VagueType ...)
-}
-
Solution
VagueType
cannot be completely filled in method and constructor parameters. If there is such a requirement, please use paramCount
.
loggerE
Field match type class is not found
Abnormal
An instance of Class
for type
was not found in the lookup criteria set when looking up the variable.
The following example
field {
- name = "test"
- // Assume that the Class of the type set here does not exist
- type = "com.example.TestClass"
-}
-
Solution
Please check if Class
of type
in the lookup condition exists and try again.
loggerE
Method match returnType class is not found
Abnormal
An instance of Class
of returnType
was not found in the search criteria set when looking up the method.
The following example
method {
- name = "test"
- // Assume that the Class of returnType set here does not exist
- returnType = "com.example.TestClass"
-}
-
Solution
Please check if Class
of returnType
in the lookup condition exists and try again.
loggerE
Method/Constructor match paramType[INDEX] class is not found
Abnormal
The Class
instance subscripted by the index
number of param
was not found in the search conditions set when searching for methods and constructors.
method {
- name = "test"
- // Assume that the Class with subscript "No.1" set here does not exist
- param(StringClass, "com.example.TestClass", BooleanType)
-}
-
Solution
Please check if the Class
subscripted by the index
number of param
in the lookup condition exists and try again.
These exceptions will directly cause the app to stop running (FC), at the same time print
E
level logs on the console.
NoClassDefFoundError
Can't find this Class in [CLASSLOADER]: CONTENT Generated by YukiReflection#ReflectionTool
Abnormal
The Class
object you were looking for was not found via String.toClass(...)
or classOf<...>()
.
The following example
"com.demo.Test".toClass()
-
Solution
Please check if the Class
matched by the current string or entity exists in the current ClassLoader
and try again.
IllegalStateException
ClassLoader [CLASSLOADER] is not a DexClassLoader
Abnormal
Use ClassLoader.searchClass
to find Class
but currently ClassLoader
does not extends BaseDexClassLoader
.
Solution
This situation basically does not exist, unless the current app references a Non-ART platform executable (which not realistic) or the current ClassLoader
is null.
IllegalStateException
VariousClass match failed of those CLASSES
Abnormal
All Class
were not found when creating indeterminate Class
objects using VariousClass
.
Solution
After checking whether there is a matching Class
in the current app and try again.
IllegalStateException
paramTypes is empty, please use emptyParam() instead
Abnormal
The empty param
method is preserved when looking up methods, constructors.
The following example
method {
- name = "test"
- // No parameters are filled in parentheses
- param()
-}
-
Solution
To identify this method, the constructor has no parameters, you can have a setter method as follows.
The first way, set emptyParam
(recommended)
The following example
method {
- name = "test"
- emptyParam()
-}
-
The second way, set paramCount = 0
The following example
method {
- name = "test"
- paramCount = 0
-}
-
IllegalStateException
Cannot create classes cache for "android", please remove "name" param
Abnormal
The DexClassFinder
cache function searchClass(name = ...)
is used in the System Framework ("android") app.
The following example
searchClass(name = "test") {
- from(...)
- // ...
-}.get()
-
Solution
Since the cache will store the found Class
name in SharedPreferences
, but the data directory does not exist in the System Framework, so please do not use this function in the System Framework.
IllegalStateException
Target Class type cannot cast to TYPE
Abnormal
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
// Assume the target type is Activity but it was wrongly cast to WrongClass type
-val clazz = "android.app.Activity".toClass<WrongClass>()
-
Solution
The following example
// <Solution 1> Fill in the correct type
-val clazz1 = "android.app.Activity".toClass<Activity>()
-// <Solution 2> Do not fill in the generic declaration
-val clazz2 = "android.app.Activity".toClass()
-
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.
Member
\u7684\u76F4\u63A5\u7F13\u5B58\u529F\u80FD\u5E76\u4F5C\u5E9F YukiReflection.Configs.isEnableMemberCache
Class
\u7684\u7F13\u5B58\u529F\u80FDSequence
\uFF0C\u4F18\u5316 Member
\u7684\u67E5\u627E\u901F\u5EA6\u4E0E\u6027\u80FDThe version update history of
YukiReflection
is recorded here.
Pay Attention
We will only maintain the latest API version, if you are using an outdate API version, you voluntarily renounce any possibility of maintenance.
Notice
To avoid translation time consumption, Changelog will use Google Translation from Chinese to English, please refer to the original text for actual reference.
Time zone of version release date: UTC+8
This page contains usage examples for all core features of
YukiReflection
.
Here are the extension functions related to the Class object itself.
Suppose we want to get a Class
that cannot be called directly.
Normally, we can use the standard reflection API to find this Class
.
The following example
// Class in the default ClassLoader environment
-var instance = Class.forName("com.demo.Test")
-// Specify the Class in the ClassLoader environment
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var instance = customClassLoader?.loadClass("com.demo.Test")
-
This is probably not very friendly, and YukiReflection
provides you with a syntactic sugar that can be used anywhere.
The above writing can be written as YukiReflection
as follows.
The following example
// Get this Class directly
-var instance = "com.demo.Test".toClass()
-// ClassLoader where the custom Class is located
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var instance = "com.demo.Test".toClass(customClassLoader)
-
If the current Class
does not exist, using the above method will throw an exception.
If you are not sure whether the Class
exists, you can refer to the following solutions.
The following example
// Get this Class directly
-// If not available, the result will be null but no exception will be thrown
-var instance = "com.demo.Test".toClassOrNull()
-// ClassLoader where the custom Class is located
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-// If not available, the result will be null but no exception will be thrown
-var instance = "com.demo.Test".toClassOrNull(customClassLoader)
-
We can also get an existing Class
object by mapping.
The following example
// Assume this Class can be obtained directly
-var instance = classOf<Test>()
-// We can also customize the ClassLoader where the Class is located, which is very effective for stubs
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var instance = classOf<Test>(customClassLoader)
-
Tips
For more functions, please refer to classOf, String.toClass, String.toClassOrNull methods.
Suppose we want to determine whether a Class
exists.
Usually, we can use the standard reflection API to find this Class
to determine whether it exists by exception.
The following example
// Class in the default ClassLoader environment
-var isExist = try {
- Class.forName("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-// Specify the Class in the ClassLoader environment
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var isExist = try {
- customClassLoader?.loadClass("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-
This is probably not very friendly, and YukiReflection
provides you with a syntactic sugar that can be used anywhere.
The above writing can be written as YukiReflection
as follows.
The following example
// Check if this class exists
-var isExist = "com.demo.Test".hasClass()
-// ClassLoader where the custom Class is located
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var isExist = "com.demo.Test".hasClass(customClassLoader)
-
Tips
For more functions, please refer to String.hasClass method.
The Class
name in the current app's Dex after being obfuscated by tools such as R8 will be difficult to distinguish.
Its correct position is uncertain, and cannot be obtained directly through Object Conversion.
At this point, there is DexClassFinder
, its role is to determine the instance of this Class
by the bytecode features in the Class
that need to be searched.
Notice
This feature is only available on the Android platform.
At present, the function of DexClassFinder is still in the experimental stage.
Since the search function is only implemented through the Java layer, the performance may not reach the optimal level when there are too many current app's Class.
If something got wrong welcome to feedback.
Since it is a reflection-level API, currently it can only locate the specified Class through the characteristics of Class and Member, and cannot locate it by specifying the string and method content characteristics in the bytecode.
The speed of searching Class depends on the performance of the current device.
At present, the mainstream mobile processors are in the 3~10s range when the conditions are not complicated in the 10~15w number of Class, the fastest speed can reach within 25s under slightly complex conditions.
Please note that the more the same type Class is matched, the slower the speed.
Below is a simple usage example.
Suppose the following Class
is what we want, the names are obfuscated and may be different in each version.
The following example
package com.demo;
-
-public class a extends Activity implements Serializable {
-
- public a(String var1) {
- // ...
- }
-
- private String a;
-
- private String b;
-
- private boolean a;
-
- protected void onCreate(Bundle var1) {
- // ...
- }
-
- private static void a(String var1) {
- // ...
- }
-
- private String a(boolean var1, String var2) {
- // ...
- }
-
- private void a() {
- // ...
- }
-
- public void a(boolean var1, a var2, b var3, String var4) {
- // ...
- }
-}
-
At this point, we want to get this Class
, you can use the ClassLoader.searchClass
method directly.
Each of the conditions demonstrated below is optional, and the more complex the conditions, the more accurate the positioning and the worse the performance.
The following example
searchClass {
- // Start the search from the specified package name range
- // In actual use, you can specify multiple package name ranges at the same time
- from("com.demo")
- // Specify the result of getSimpleName of the current Class
- // You can directly make logical judgments on this string
- // Here we are not sure whether its name is a, we can only judge the length of the string
- simpleName { it.length == 1 }
- // Specify the inherited parent class object
- // If it is an existing stub, it can be directly represented by generics
- extends<Activity>()
- // Specify the inherited parent class object
- // Which can be written directly as the full class name
- // And you can also specify multiple objects at the same time
- extends("android.app.Activity")
- // Specify the implemented interface
- // If it exists stub, can be directly represented by generics
- implements<Serializable>()
- // Specify the implemented interface
- // Which can be written directly as a full class name, or you can specify multiple at the same time
- implements("java.io.Serializable")
- // Specify the type and style of the constructor
- // And the number count that exists in the current class
- constructor { param(StringClass) }.count(num = 1)
- // Specify the type and style of the variable
- // And the number that exists in the current class count
- field { type = StringClass }.count(num = 2)
- // Specify the type and style of the variable
- // And the number that exists in the current class count
- field { type = BooleanType }.count(num = 1)
- // Directly specify the number of all variables that exist in the current class count
- field().count(num = 3)
- // If you think the number of variables is indeterminate
- // You can also use the following custom conditions
- field().count(1..3)
- field().count { it >= 3 }
- // Specify the type and style of the method
- // And the number that exists in the current class count
- method {
- name = "onCreate"
- param(BundleClass)
- }.count(num = 1)
- // Specify the type and style of the method
- // Specify the modifier, and the number count in the current class
- method {
- modifiers { isStatic && isPrivate }
- param(StringClass)
- returnType = UnitType
- }.count(num = 1)
- // Specify the type and style of the method
- // Specify the modifier, and the number count in the current class
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, StringClass)
- returnType = StringClass
- }.count(num = 1)
- // Specify the type and style of the method
- // Specify the modifier, and the number count in the current class
- method {
- modifiers { isPrivate && isStatic.not() }
- emptyParam()
- returnType = UnitType
- }.count(num = 1)
- // Specify the type and style of the method
- // As well as the modifier and VagueType
- // And the number count that exists in the current class
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, VagueType, VagueType, StringClass)
- returnType = UnitType
- }.count(num = 1)
- // Directly specify the number of all methods that exist in the current class count
- method().count(num = 5)
- // If you think the number of methods is uncertain, you can also use the following custom conditions
- method().count(1..5)
- method().count { it >= 5 }
- // Directly specify the number of all members existing in the current class count
- // Members include: Field, Method, Constructor
- member().count(num = 9)
- // There must be a static modifier in all members, you can add this condition like this
- member {
- modifiers { isStatic }
- }
-}.get() // Get the instance of this Class itself, if not found, it will return null
-
Tips
The conditional usage of Field, Method, Constructor in the above usage is consistent with the related usage in Member Extensions, with only minor differences.
For more functions, please refer to MemberRules, FieldRules, MethodRules, ConstructorRules.
By default, DexClassFinder
will use synchronous mode to search Class
, which will block the current thread until it finds or finds an exception.
If the search takes too long, it may cause ANR problems to the current app.
In response to the above problems, we can enable asynchronous, just add the parameter async = true
, which will not require you to start a thread again, the API has already handled the related problems for you.
Notice
To use this function, you need to pass in the Context of the current app as the first method parameter.
For the asynchronous case you need to use the wait method to get the result, the get method will no longer work.
The following example
val context: Context // Assume this is the Context of the current app
-searchClass(context, async = true) {
- // ...
-}.wait { class1 ->
- // Get asynchronous result
-}
-searchClass(context, async = true) {
- // ...
-}.wait { class2 ->
- // Get asynchronous result
-}
-
In this way, our search process runs asynchronously, it will not block the main thread, and each search will be performed in a separate thread at the same time, which can achieve the effect of parallel tasks.
Since the search is performed again every time the current app is reopened, this is a waste of repetitive performance when the current app's version is unchanged.
At this point, we can locally cache the search results of the current app's version by specifying the name
parameter.
Next time, the found class name will be directly read from the local cache.
The local cache uses SharedPreferences
, which will be saved to the app's data directory and will be re-cached after the app's version is updated.
After enabling the local cache, async = true
will be set at the same time, you don't need to set it manually.
Notice
To use this function, you need to pass in the Context of the current app as the first method parameter.
The following example
val context: Context // Assume this is the Context of the current app
-searchClass(context, name = "com.demo.class1") {
- // ...
-}.wait { class1 ->
- // Get asynchronous result
-}
-searchClass(context, name = "com.demo.class2") {
- // ...
-}.wait { class2 ->
- // Get asynchronous result
-}
-
If you want to clear the local cache manually, you can use the following method to clear the current version of the current app's cache.
The following example
val context: Context // Assume this is the Context of the current app
-DexClassFinder.clearCache(context)
-
You can also clear the app's cache for a specific version.
The following example
val context: Context // Assume this is the Context of the current app
-DexClassFinder.clearCache(context, versionName = "1.0", versionCode = 1)
-
If you need to search a set of Class
at the same time using a fixed condition, then you only need to use the all
or waitAll
method to get the result.
// Synchronous search, use all to get all the results found by the conditions
-searchClass {
- // ...
-}.all().forEach { clazz ->
- // Get each result
-}
-// Synchronous search, using all { ... } to iterate over each result
-searchClass {
- // ...
-}.all { clazz ->
- // Get each result
-}
-// Asynchronous search, use waitAll to get all the results found by the conditions
-val context: Context // Assume this is the Context of the current app
-searchClass(context, async = true) {
- // ...
-}.waitAll { classes ->
- classes.forEach {
- // Get each result
- }
-}
-
Tips
For more functions, please refer to ClassLoader.searchClass method.
Here are the extension functions related to the Class bytecode member variables Field, Method, Constructor.
Tips
Member is the interface description object of Field, Method, Constructor, which is the general term for the bytecode members in Class in Java reflection.
Suppose there is such a Class
.
The following example
package com.demo;
-
-public class BaseTest {
-
- public BaseTest() {
- // ...
- }
-
- public BaseTest(boolean isInit) {
- // ...
- }
-
- private void doBaseTask(String taskName) {
- // ...
- }
-}
-
package com.demo;
-
-public class Test extends BaseTest {
-
- public Test() {
- // ...
- }
-
- public Test(boolean isInit) {
- // ...
- }
-
- private static TAG = "Test";
-
- private BaseTest baseInstance;
-
- private String a;
-
- private boolean a;
-
- private boolean isTaskRunning = false;
-
- private static void init() {
- // ...
- }
-
- private void doTask(String taskName) {
- // ...
- }
-
- private void release(String taskName, Function<boolean, String> task, boolean isFinish) {
- // ...
- }
-
- private void stop() {
- // ...
- }
-
- private String getName() {
- // ...
- }
-
- private void b() {
- // ...
- }
-
- private void b(String a) {
- // ...
- }
-}
-
Suppose we want to get the doTask
method of Test
and execute it.
Normally, we can use the standard reflection API to find this method.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using reflection API
-Test::class.java
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(instance, "task_name")
-
This is probably not very friendly, and YukiReflection
provides you with a syntactic sugar that can be used anywhere.
The above writing can be written as YukiReflection
as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doTask"
- param(StringClass)
-}.get(instance).call("task_name")
-
Tips
For more features, please refer to MethodFinder.
Similarly, we need to get the isTaskRunning
field can also be written as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.field {
- name = "isTaskRunning"
- type = BooleanType
-}.get(instance).any() // Any instantiates an object of any type of Field
-
Tips
For more features, please refer to FieldFinder.
Maybe you also want to get the current Class
constructor, the same can be achieved.
The following example
Test::class.java.constructor {
- param(BooleanType)
-}.get().call(true) // Can create a new instance
-
If you want to get the no-argument constructor of Class
, you can write it as follows.
The following example
Test::class.java.constructor().get().call() // Create a new instance
-
Tips
For more features, please refer to ConstructorFinder.
Suppose we want to get the getName
method in Class
, which can be implemented as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "getName"
- emptyParam()
- returnType = StringClass
-}.get(instance).string() // Get the result of the method
-
Through observation, it is found that there is only one method named getName
in this Class
, so can we make it simpler?
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "getName"
- emptyParam()
-}.get(instance).string() // Get the result of the method
-
Yes, you can refine your find criteria for methods that do not change exactly.
When using only get
or wait
methods to get results, YukiReflection
will match the first found result in bytecode order by default.
The problem comes again, this Class
has a release
method, but its method parameters are very long, and some types may not be directly available.
Normally we would use param(...)
to find this method, but is there an easier way.
At this point, after determining the uniqueness of the method, you can use paramCount
to find the method.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "release"
- // At this point
- // We don't have to determine the specific type of method parameters, just write the number
- paramCount = 3
-}.get(instance) // Get this method
-
Although the above example can be successfully matched, it is not accurate.
At this time, you can also use VagueType
to fill in the method parameter type that you do not want to fill in.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "release"
- // Use VagueType to fill in the type you don't want to fill in
- // While ensuring that other types can match
- param(StringClass, VagueType, BooleanType)
-}.get(instance) // Get this method
-
If you are not sure about the type of each parameter, you can create a conditional method body with the param { ... }
method.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "release"
- // Get the it (Class) method parameter type array instance
- // To only determine the known type and its position
- param { it[0] == StringClass && it[2] == BooleanType }
-}.get(instance) // Get this method
-
Tips
Use param { ... } to create a conditional method body, where the variable it is the Class type array instance of the current method parameter, and you can freely use Class all objects and their methods in.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to FieldFinder.type, MethodFinder.param, MethodFinder.returnType, ConstructorFinder.param method.
You will notice that Test
extends BaseTest
, now we want to get the doBaseTask
method of BaseTest
, how do we do it without knowing the name of the super class?
Referring to the above find conditions, we only need to add a superClass
to the find conditions to achieve this function.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // Just add this condition
- superClass()
-}.get(instance).call("task_name")
-
At this time, we can get this method in the super class.
superClass
has a parameter isOnlySuperClass
, when set to true
, you can skip the current Class
and only find the super class of the current Class
.
Since we now know that the doBaseTask
method only exists in the super class, this condition can be added to save finding time.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // Add a find condition
- superClass(isOnlySuperClass = true)
-}.get(instance).call("task_name")
-
At this time, we can also get this method in the super class.
Once superClass
is set, it will automatically cycle backward to find out whether this method exists in all extends super classes, until it finds that the target has no super class (the extends is java.lang.Object
).
Tips
For more functions, please refer to MethodFinder.superClass, ConstructorFinder.superClass, FieldFinder.superClass methods.
Pay Attention
The currently founded Method can only find the Method of the current Class unless the superClass condition is specified, which is the default behavior of the Java Reflection API.
If we want to find a method name, but are not sure if it has changed in each release, we can use vague find.
Suppose we want to get the doTask
method in Class
, which can be implemented as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Set name is case insensitive
- it.equals("dotask", isIgnoreCase = true)
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
Knowing that there is currently only one doTask
method in Class
, we can also judge that the method name contains only the characters specified in it.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Only contains oTas
- it.contains("oTas")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
We can also judge based on the first and last strings.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Contains do at the beginning and Task at the end
- it.startsWith("do") && it.endsWith("Task")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
By observing that this method name contains only letters, we can add a precise search condition.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Start with do, end with Task, just letters
- it.startsWith("do") && it.endsWith("Task") && it.isOnlyLetters()
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
Tips
Use name { ... } to create a conditional method body, where the variable it is the string of the current name, and you can freely use it in the extension method of NameRules function.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to FieldFinder.name, MethodFinder.name methods and NameRules.
Sometimes, we may need to find a set of methods, constructors, and fields with the same characteristics in a Class
.
At this time, we can use relative condition matching to complete.
Based on the result of the find condition, we only need to replace get
with all
to get all the bytecodes that match the condition.
Suppose this time we want to get all methods in Class
with the number of method parameters in the range 1..3
, you can use the following implementation.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- paramCount(1..3)
-}.all(instance).forEach { instance ->
- // Call and execute each method
- instance.call(...)
-}
-
The above example can be perfectly matched to the following 3 methods.
private void doTask(String taskName)
private void release(String taskName, Function<boolean, String> task, boolean isFinish)
private void b(String a)
If you want to define the conditions for the range of the number of parameters more freely, you can use the following implementation.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- paramCount { it < 3 }
-}.all(instance).forEach { instance ->
- // Call and execute each method
- instance.call(...)
-}
-
The above example can be perfectly matched to the following 6 methods.
private static void init()
private void doTask(String taskName)
private void stop(String a)
private void getName(String a)
private void b()
private void b(String a)
By observing that there are two methods named b
in Class
, you can use the following implementation.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "b"
-}.all(instance).forEach { instance ->
- // Call and execute each method
- instance.call(...)
-}
-
The above example can be perfectly matched to the following 2 methods.
private void b()
private void b(String a)
Tips
Use paramCount { ... } to create a conditional method body, where the variable it is the integer of the current number of parameters, and you can use it freely in the extension method of CountRules function in it.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to MethodFinder.paramCount, ConstructorFinder.paramCount methods and CountRules.
Some methods and fields are statically implemented in Class
, at this time, we can call them without passing in an instance.
Suppose we want to get the contents of the static field TAG
this time.
The following example
Test::class.java.field {
- name = "TAG"
- type = StringClass
-}.get().string() // The type of Field is string and can be cast directly
-
Assuming that there is a non-static TAG
field with the same name in Class
, what should I do at this time?
Just add a filter.
The following example
Test::class.java.field {
- name = "TAG"
- type = StringClass
- // This field to identify the lookup needs to be static
- modifiers { isStatic }
-}.get().string() // The type of Field is string and can be cast directly
-
We can also call a static method called init
.
The following example
Test::class.java.method {
- name = "init"
- emptyParam()
-}.get().call()
-
Likewise, you can identify it as a static.
The following example
Test::class.java.method {
- name = "init"
- emptyParam()
- // This method of identity find needs to be static
- modifiers { isStatic }
-}.get().call()
-
Tips
Use modifiers { ... } to create a conditional method body, at which point you can freely use its functionality in ModifierRules.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to FieldFinder.modifiers, MethodFinder.modifiers, ConstructorFinder.modifiers methods and ModifierRules.
You may have noticed that the example Class
given here has two obfuscated field names, both of which are a
, how do we get them at this time?
There are two options.
The first option is to determine the name and type of the field.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.field {
- name = "a"
- type = BooleanType
-}.get(instance).any() // Get a field named a with type Boolean
-
The second option is to determine where the type of the field is located.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.field {
- type(BooleanType).index().first()
-}.get(instance).any() // Get the first field of type Boolean
-
In the above two cases, the corresponding field private boolean a
can be obtained.
Likewise, there are two obfuscated method names in this Class
, both of which are b
.
You can also have two options to get them.
The first option is to determine the method name and method parameters.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "b"
- param(StringClass)
-}.get(instance).call("test_string") // Get the method whose name is b and whose parameter is [String]
-
The second option is to determine where the parameters of the method are located.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- param(StringClass).index().first()
-}.get(instance).call("test_string") // Get the method whose first method parameter is [String]
-
Since it is observed that this method is last in Class
, then we have an alternative.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- order().index().last()
-}.get(instance).call("test_string") // Get the last method of the current Class
-
Notice
Please try to avoid using order to filter bytecode subscripts, they may be indeterminate unless you are sure that its position in this Class must not change.
The methods of calling bytecode described above all need to use get(instance)
to call the corresponding method.
Is there a simpler way?
At this point, you can use the current
method on any instance to create a call space.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- // Execute the doTask method
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
- // Execute the stop method
- method {
- name = "stop"
- emptyParam()
- }.call()
- // Get name
- val name = method { name = "getName" }.string()
-}
-
We can also use superClass
to call methods of the current Class
super class.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- // Execute the doBaseTask method of the parent class
- superClass().method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
-}
-
If you don't like to use a lambda to create the namespace of the current instance, you can use the current()
method directly.
The following example
// Assuming this is an instance of this Class, this Class cannot be obtained directly
-val instance = Test()
-// Execute the doTask method
-instance
- .current()
- .method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-// Execute the stop method
-instance
- .current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// Get name
-val name = instance.current().method { name = "getName" }.string()
-
Likewise, consecutive calls can be made between them, but inline calls are not allowed.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}.current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// \u2757 Note that because current() returns the CurrentClass object itself
-// It CANNOT BE CALLED like the following
-instance.current().current()
-
For Field
instances, there is also a convenience method that can directly get the object of the instance where Field
is located.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- // <Plan 1>
- field {
- name = "baseInstance"
- }.current {
- method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
- }
- // <Plan 2>
- field {
- name = "baseInstance"
- }.current()
- ?.method {
- name = "doBaseTask"
- param(StringClass)
- }?.call("task_name")
-}
-
Notice
The above current method is equivalent to calling the field { ... }.any()?.current() method in CurrentClass for you.
If there is no CurrentClass calling field, you need to use field { ... }.get(instance).current() to call it.
The problem comes again, I want to use reflection to create the following instance and call the method in it, how to do it?
The following example
Test(true).doTask("task_name")
-
Usually, we can use the standard reflection API to call.
The following example
"com.demo.Test".toClass()
- .getDeclaredConstructor(Boolean::class.java)
- .apply { isAccessible = true }
- .newInstance(true)
- .apply {
- javaClass
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(this, "task_name")
- }
-
But I feel that this approach is very troublesome.
Is there a more concise way to call it?
At this time, we can also use the buildOf
method to create an instance.
The following example
"com.demo.Test".toClass().buildOf(true) { param(BooleanType) }?.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}
-
If you want the buildOf
method to return the type of the current instance, you can include a type-generic declaration in it instead of using as
to cast
the target type.
In this case, the constructor of the instance itself is private, but the method inside is public, so we only need to create its constructor by reflection.
The following example
// Assume this Class can be obtained directly
-val test = Test::class.java.buildOf<Test>(true) { param(BooleanType) }
-test.doTask("task_name")
-
Tips
For more functions, please refer to CurrentClass and Class.buildOf method.
Suppose there are three different versions of Class
, all of which are the same Class
for different versions of this app.
There is also a method doTask
in it, assuming they function the same.
The following example of version A
public class Test {
-
- public void doTask() {
- // ...
- }
-}
-
The following example of version B
public class Test {
-
- public void doTask(String taskName) {
- // ...
- }
-}
-
The following example of version C
public class Test {
-
- public void doTask(String taskName, int type) {
- // ...
- }
-}
-
We need to get this same functionality of the doTask
method in a different version, how do we do it?
At this point, you can use RemedyPlan
to complete your needs.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- param(StringClass)
- }.onFind {
- // Found logic can be implemented here
- }
- method {
- name = "doTask"
- param(StringClass, IntType)
- }.onFind {
- // Found logic can be implemented here
- }
-}.wait(instance) {
- // Get the result of the method
-}
-
Pay Attention
The method lookup result using RemedyPlan can no longer use get to get method instance, you should use wait method.
Also, you can continue to use RemedyPlan
while using Multiple Find.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- paramCount(0..1)
- }.onFind {
- // Found logic can be implemented here
- }
- method {
- name = "doTask"
- paramCount(1..2)
- }.onFind {
- // Found logic can be implemented here
- }
-}.waitAll(instance) {
- // Get the result of the method
-}
-
Tips
For more functions, please refer to MethodFinder.RemedyPlan, ConstructorFinder.RemedyPlan, FieldFinder.RemedyPlan .
Suppose there is a Class
with the same function in different versions of the current app but only the name of the Class
is different.
The following example of version A
public class ATest {
-
- public static void doTask() {
- // ...
- }
-}
-
The following example of version B
public class BTest {
-
- public static void doTask() {
- // ...
- }
-}
-
At this time, what should we do if we want to call the doTask
method in this Class
in each version?
The usual practice is to check if Class
exists.
The following example
// First find this Class
-val currentClass =
- if("com.demo.ATest".hasClass()) "com.demo.ATest".toClass() else "com.demo.BTest".toClass()
-// Then look for this method and call
-currentClass.method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
I feel that this solution is very inelegant and cumbersome, then YukiReflection
provides you with a very convenient VariousClass
to solve this problem.
Now, you can get this Class
directly using the following methods.
The following example
VariousClass("com.demo.ATest", "com.demo.BTest").get().method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
If the current Class
exists in the specified ClassLoader
, you can fill in your ClassLoader
in get
.
The following example
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").get(customClassLoader).method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
If you are not sure that all Class
will be matched, you can use the getOrNull
method.
The following example
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").getOrNull(customClassLoader)?.method {
- name = "doTask"
- emptyParam()
-}?.get()?.call()
-
Tips
For more functions, please refer to VariousClass.
In the process of reflection, we may encounter generic problems.
In the reflection processing of generics, YukiReflection
also provides a syntactic sugar that can be used anywhere.
For example we have the following generic class.
The following example
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // ...
- }
-}
-
When we want to get a Class
instance of the generic T
or R
in the current Class
, only the following implementation is required.
The following example
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // Get the operation object of the current instance
- // Get the Class instance of T, in the 0th position of the parameter
- // The default value can not be written
- val tClass = current().generic()?.argument()
- // Get the Class instance of R, in parameter 1
- val rClass = current().generic()?.argument(index = 1)
- // You can also use the following syntax
- current().generic {
- // Get the Class instance of T
- // In the 0th position of the parameter, the default value can be left blank
- val tClass = argument()
- // Get the Class instance of R, in parameter 1
- val rClass = argument(index = 1)
- }
- }
-}
-
When we want to call this Class
externally, it can be implemented as follows.
The following example
// Assume this is the Class of T
-class TI {
-
- fun foo() {
- // ...
- }
-}
-// Assume this is an instance of T
-val tInstance: TI? = ...
-// Get the Class instance of T
-// In the 0th position of the parameter, the default value can be left blank
-// And get the method foo and call it
-TestGeneric::class.java.generic()?.argument()?.method {
- name = "foo"
- emptyParam()
-}?.get(tInstance)?.invoke<TI>()
-
Tips
For more functions, please refer to CurrentClass.generic, Class.generic methods and GenericClass.
Here are some misunderstandings that may be encountered during use for reference.
Pay Attention
In find conditions you can only use index function once except order.
The following example
method {
- name = "test"
- param(BooleanType).index(num = 2)
- // \u2757 Wrong usage, please keep only one index method
- returnType(StringClass).index(num = 1)
-}
-
The following find conditions can be used without any problems.
The following example
method {
- name = "test"
- param(BooleanType).index(num = 2)
- order().index(num = 1)
-}
-
Pay Attention
In common method find conditions, even methods without parameters need to set find conditions.
Suppose we have the following Class
.
The following example
public class TestFoo {
-
- public void foo(String string) {
- // ...
- }
-
- public void foo() {
- // ...
- }
-}
-
We want to get the public void foo()
method, which can be written as follows.
The following example
TestFoo::class.java.method {
- name = "foo"
-}
-
However, the above example is wrong.
You will find two foo
methods in this Class
, one of which takes a method parameter.
Since the above example does not set the find conditions for param
, the result will be the first method public void foo(String string)
that matches the name and matches the bytecode order, not the last method we need.
This is a frequent error, without method parameters, you will lose the use of method parameter find conditions.
The correct usage is as follows.
The following example
TestFoo::class.java.method {
- name = "foo"
- // \u2705 Correct usage, add detailed filter conditions
- emptyParam()
-}
-
At this point, the above example will perfectly match the public void foo()
method.
In the construction method find conditions, constructors without parameters do not need to fill in the find conditions.
Suppose we have the following Class
.
The following example
public class TestFoo {
-
- public TestFoo() {
- // ...
- }
-}
-
We want to get the public TestFoo()
constructor, which can be written as follows.
The following example
TestFoo::class.java.constructor { emptyParam() }
-
The above example can successfully obtain the public TestFoo()
constructor, but it feels a bit cumbersome.
Unlike normal methods, since the constructor does not need to consider the name
, when the constructor has no parameters, we can omit the emptyParam
parameter.
The following example
TestFoo::class.java.constructor()
-
Pay Attention
In the bytecode call result, the cast method can only specify the type corresponding to the bytecode.
For example we want to get a field of type Boolean
and cast it to String
.
The following is the wrong way to use it.
The following example
field {
- name = "test"
- type = BooleanType
-}.get().string() // \u2757 Wrong usage, must be cast to the bytecode target type
-
The following is the correct way to use it.
The following example
field {
- name = "test"
- type = BooleanType
-}.get().boolean().toString() // \u2705 The correct way to use, get the type and then convert
-
When find methods and fields, we usually need to specify the type in find conditions.
The following example
field {
- name = "test"
- type = Boolean::class.javaPrimitiveType
-}
-
Expressing the type of Boolean::class.javaPrimitiveType
in Kotlin
is very long and inconvenient.
Therefore, YukiReflection
encapsulates common type calls for developers, including Android related types and Java common types and primitive type keywords.
At this time, the above type can be written in the following form.
The following example
field {
- name = "test"
- type = BooleanType
-}
-
The primitive type keywords in common Java types have been encapsulated as Type(Class Name) + Type, such as IntType
, FloatType
(their bytecode types are int
, float
).
Correspondingly, array types also have convenient usage methods, assuming we want to get an array of type String[]
.
You need to write java.lang.reflect.Array.newInstance(String::class.java, 0).javaClass
to get this type.
Does it feel very troublesome, at this time we can use the method ArrayClass(StringClass)
to get this type.
At the same time, since String
is a common type, you can also directly use StringArrayClass
to get this type.
The methods found in some common requirements have their corresponding encapsulation types for use, in the format Type(Class Name) + Class.
The following are wrapper names for some special case types in Java represented in YukiReflection
.
void
\u2192 UnitType
java.lang.Void
\u2192 UnitClass
java.lang.Object
\u2192 AnyClass
java.lang.Integer
\u2192 IntClass
java.lang.Character
\u2192 CharClass
Notice
Encapsulating types with Type(Class Name) + Type will and only be represented as Java primitive type keywords.
Since the concept of primitive types does not exist in Kotlin, they will all be defined as KClass.
There are 9 primitive type keywords in Java, of which 8 are primitive type, namely boolean, char, byte, short , int, float, long, double, of which the void type is a special case.
At the same time, they all have their own corresponding package types in Java, such as java.lang.Boolean, java.lang.Integer, these types are unequal, Please note the distinction.
Similarly, arrays also have corresponding wrapper types, which also need to be distinguished from Java primitive type keywords.
For example, the encapsulation type of byte[] is ByteArrayType or ArrayClass(ByteType), and the encapsulation type of Byte[] is ByteArrayClass or ArrayClass(ByteClass), these types are also unequal.
Tips
For more types, see ComponentTypeFactory, GraphicsTypeFactory, ViewTypeFactory, VariableTypeFactory.
At the same time, you are welcome to contribute more commonly used types.
`,335);function w(T,q){const o=e("Badge"),p=e("ExternalLinkIcon");return c(),i("div",null,[d,s("h3",y,[A,u,l(o,{type:"tip",text:"Beta",vertical:"middle"})]),m,s("div",v,[C,h,s("p",null,[D,s("a",B,[b,l(p)]),F,g,f])]),k])}const S=t(r,[["render",w],["__file","features.html.vue"]]);export{S as default}; diff --git a/docs/assets/features.html.9a3194da.js b/docs/assets/features.html.9a3194da.js deleted file mode 100644 index b0ee0a3..0000000 --- a/docs/assets/features.html.9a3194da.js +++ /dev/null @@ -1,746 +0,0 @@ -import{_ as c,r as l,o as r,c as t,b as s,d as e,a,e as n}from"./app.2add9aa5.js";const i={},d=a(`\u8FD9\u91CC\u5305\u542B\u4E86
YukiReflection
\u5168\u90E8\u6838\u5FC3\u529F\u80FD\u7684\u7528\u6CD5\u793A\u4F8B\u3002
\u8FD9\u91CC\u662F Class \u5BF9\u8C61\u81EA\u8EAB\u76F8\u5173\u7684\u6269\u5C55\u529F\u80FD\u3002
\u5047\u8BBE\u6211\u4EEC\u8981\u5F97\u5230\u4E00\u4E2A\u4E0D\u80FD\u76F4\u63A5\u8C03\u7528\u7684 Class
\uFF0C\u901A\u5E38\u60C5\u51B5\u4E0B\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u6807\u51C6\u7684\u53CD\u5C04 API \u53BB\u67E5\u627E\u8FD9\u4E2A Class
\u3002
\u793A\u4F8B\u5982\u4E0B
// \u9ED8\u8BA4 ClassLoader \u73AF\u5883\u4E0B\u7684 Class
-var instance = Class.forName("com.demo.Test")
-// \u6307\u5B9A ClassLoader \u73AF\u5883\u4E0B\u7684 Class
-val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-var instance = customClassLoader?.loadClass("com.demo.Test")
-
\u8FD9\u79CD\u5199\u6CD5\u5927\u6982\u4E0D\u662F\u5F88\u53CB\u597D\uFF0C\u6B64\u65F6 YukiReflection
\u5C31\u4E3A\u4F60\u63D0\u4F9B\u4E86\u4E00\u4E2A\u53EF\u5728\u4EFB\u610F\u5730\u65B9\u4F7F\u7528\u7684\u8BED\u6CD5\u7CD6\u3002
\u4EE5\u4E0A\u5199\u6CD5\u6362\u505A YukiReflection
\u53EF\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
// \u76F4\u63A5\u5F97\u5230\u8FD9\u4E2A Class
-var instance = "com.demo.Test".toClass()
-// \u81EA\u5B9A\u4E49 Class \u6240\u5728\u7684 ClassLoader
-val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-var instance = "com.demo.Test".toClass(customClassLoader)
-
\u5982\u679C\u5F53\u524D Class
\u5E76\u4E0D\u5B58\u5728\uFF0C\u4F7F\u7528\u4E0A\u8FF0\u65B9\u6CD5\u4F1A\u629B\u51FA\u5F02\u5E38\uFF0C\u5982\u679C\u4F60\u4E0D\u786E\u5B9A Class
\u662F\u5426\u5B58\u5728\uFF0C\u53EF\u4EE5\u53C2\u8003\u4E0B\u9762\u7684\u89E3\u51B3\u65B9\u6848\u3002
\u793A\u4F8B\u5982\u4E0B
// \u76F4\u63A5\u5F97\u5230\u8FD9\u4E2A Class
-// \u5F97\u4E0D\u5230\u65F6\u7ED3\u679C\u4F1A\u4E3A null \u4F46\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38
-var instance = "com.demo.Test".toClassOrNull()
-// \u81EA\u5B9A\u4E49 Class \u6240\u5728\u7684 ClassLoader
-val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-// \u5F97\u4E0D\u5230\u65F6\u7ED3\u679C\u4F1A\u4E3A null \u4F46\u4E0D\u4F1A\u629B\u51FA\u5F02\u5E38
-var instance = "com.demo.Test".toClassOrNull(customClassLoader)
-
\u6211\u4EEC\u8FD8\u53EF\u4EE5\u901A\u8FC7\u6620\u5C04\u6765\u5F97\u5230\u4E00\u4E2A\u5B58\u5728\u7684 Class
\u5BF9\u8C61\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u4E2A Class \u662F\u80FD\u591F\u88AB\u76F4\u63A5\u5F97\u5230\u7684
-var instance = classOf<Test>()
-// \u6211\u4EEC\u540C\u6837\u53EF\u4EE5\u81EA\u5B9A\u4E49 Class \u6240\u5728\u7684 ClassLoader\uFF0C\u8FD9\u5BF9\u4E8E stub \u6765\u8BF4\u975E\u5E38\u6709\u6548
-val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-var instance = classOf<Test>(customClassLoader)
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 classOf\u3001String.toClass\u3001String.toClassOrNull \u65B9\u6CD5\u3002
\u5047\u8BBE\u6211\u4EEC\u8981\u5224\u65AD\u4E00\u4E2A Class
\u662F\u5426\u5B58\u5728\uFF0C\u901A\u5E38\u60C5\u51B5\u4E0B\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u6807\u51C6\u7684\u53CD\u5C04 API \u53BB\u67E5\u627E\u8FD9\u4E2A Class
\u901A\u8FC7\u5F02\u5E38\u6765\u5224\u65AD\u662F\u5426\u5B58\u5728\u3002
\u793A\u4F8B\u5982\u4E0B
// \u9ED8\u8BA4 ClassLoader \u73AF\u5883\u4E0B\u7684 Class
-var isExist = try {
- Class.forName("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-// \u6307\u5B9A ClassLoader \u73AF\u5883\u4E0B\u7684 Class
-val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-var isExist = try {
- customClassLoader?.loadClass("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-
\u8FD9\u79CD\u5199\u6CD5\u5927\u6982\u4E0D\u662F\u5F88\u53CB\u597D\uFF0C\u6B64\u65F6 YukiReflection
\u5C31\u4E3A\u4F60\u63D0\u4F9B\u4E86\u4E00\u4E2A\u53EF\u5728\u4EFB\u610F\u5730\u65B9\u4F7F\u7528\u7684\u8BED\u6CD5\u7CD6\u3002
\u4EE5\u4E0A\u5199\u6CD5\u6362\u505A YukiReflection
\u53EF\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5224\u65AD\u8FD9\u4E2A Class \u662F\u5426\u5B58\u5728
-var isExist = "com.demo.Test".hasClass()
-// \u81EA\u5B9A\u4E49 Class \u6240\u5728\u7684 ClassLoader
-val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-var isExist = "com.demo.Test".hasClass(customClassLoader)
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 String.hasClass \u65B9\u6CD5\u3002
\u5728 R8 \u7B49\u5DE5\u5177\u6DF7\u6DC6\u540E\u7684\u5F53\u524D APP Dex \u4E2D\u7684 Class
\u540D\u79F0\u5C06\u4F1A\u96BE\u4EE5\u5206\u8FA8\uFF0C\u4E14\u4E0D\u786E\u5B9A\u5176\u6B63\u786E\u4F4D\u7F6E\uFF0C\u4E0D\u80FD\u76F4\u63A5\u901A\u8FC7 \u5BF9\u8C61\u8F6C\u6362 \u6765\u5F97\u5230\u3002
\u6B64\u65F6\u5C31\u6709\u4E86 DexClassFinder
\uFF0C\u5B83\u7684\u4F5C\u7528\u662F\u901A\u8FC7\u9700\u8981\u67E5\u627E\u7684 Class
\u4E2D\u7684\u5B57\u8282\u7801\u7279\u5F81\u6765\u786E\u5B9A\u8FD9\u4E2A Class
\u7684\u5B9E\u4F8B\u3002
\u6CE8\u610F
\u6B64\u529F\u80FD\u4EC5\u9002\u7528\u4E8E Android \u5E73\u53F0\u3002
\u76EE\u524D DexClassFinder \u7684\u529F\u80FD\u5C1A\u5728\u8BD5\u9A8C\u9636\u6BB5\uFF0C\u7531\u4E8E\u4EC5\u901A\u8FC7 Java \u5C42\u5B9E\u73B0\u67E5\u627E\u529F\u80FD\uFF0C\u5728\u5F53\u524D APP Class \u8FC7\u591A\u65F6\u6027\u80FD\u53EF\u80FD\u4E0D\u80FD\u8FBE\u5230\u6700\u4F73\u6C34\u5E73\uFF0C\u5982\u679C\u53D1\u751F\u67E5\u627E\u4E0D\u5230\u3001\u5B9A\u4F4D\u6709\u8BEF\u7684\u95EE\u9898\u6B22\u8FCE\u5411\u6211\u4EEC\u53CD\u9988\u3002
\u7531\u4E8E\u662F\u53CD\u5C04\u5C42\u9762\u7684 API\uFF0C\u76EE\u524D\u5B83\u53EA\u80FD\u901A\u8FC7\u7C7B\u4E0E\u6210\u5458\u7684\u7279\u5F81\u6765\u5B9A\u4F4D\u6307\u5B9A\u7684 Class\uFF0C\u4E0D\u80FD\u901A\u8FC7\u6307\u5B9A\u5B57\u8282\u7801\u4E2D\u7684\u5B57\u7B26\u4E32\u548C\u65B9\u6CD5\u5185\u5BB9\u7279\u5F81\u6765\u8FDB\u884C\u5B9A\u4F4D\u3002
\u67E5\u627E Class \u7684\u901F\u5EA6\u53D6\u51B3\u4E8E\u5F53\u524D\u8BBE\u5907\u7684\u6027\u80FD\uFF0C\u76EE\u524D\u4E3B\u6D41\u7684\u79FB\u52A8\u7AEF\u5904\u7406\u5668\u5728 10~15w \u6570\u91CF\u7684 Class \u4E2D\u6761\u4EF6\u4E0D\u7B97\u590D\u6742\u7684\u60C5\u51B5\u4E0B\u5927\u6982\u5728 3~10s \u533A\u95F4\uFF0C\u6761\u4EF6\u7A0D\u5FAE\u590D\u6742\u7684\u60C5\u51B5\u4E0B\u6700\u5FEB\u901F\u5EA6\u80FD\u8FBE\u5230 25s \u4EE5\u5185\uFF0C\u5339\u914D\u5230\u7684\u540C\u7C7B\u578B Class \u8D8A\u591A\u901F\u5EA6\u8D8A\u6162\u3002
\u4E0B\u9762\u662F\u4E00\u4E2A\u7B80\u5355\u7684\u7528\u6CD5\u793A\u4F8B\u3002
\u5047\u8BBE\u4E0B\u9762\u8FD9\u4E2A Class
\u662F\u6211\u4EEC\u60F3\u8981\u5F97\u5230\u7684\uFF0C\u5176\u4E2D\u7684\u540D\u79F0\u7ECF\u8FC7\u4E86\u6DF7\u6DC6\uFF0C\u5728\u6BCF\u4E2A\u7248\u672C\u53EF\u80FD\u90FD\u4E0D\u4E00\u6837\u3002
\u793A\u4F8B\u5982\u4E0B
package com.demo;
-
-public class a extends Activity implements Serializable {
-
- public a(String var1) {
- // ...
- }
-
- private String a;
-
- private String b;
-
- private boolean a;
-
- protected void onCreate(Bundle var1) {
- // ...
- }
-
- private static void a(String var1) {
- // ...
- }
-
- private String a(boolean var1, String var2) {
- // ...
- }
-
- private void a() {
- // ...
- }
-
- public void a(boolean var1, a var2, b var3, String var4) {
- // ...
- }
-}
-
\u6B64\u65F6\uFF0C\u6211\u4EEC\u60F3\u5F97\u5230\u8FD9\u4E2A Class
\uFF0C\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 ClassLoader.searchClass
\u65B9\u6CD5\u3002
\u4E0B\u65B9\u6F14\u793A\u7684\u6761\u4EF6\u4E2D\u6BCF\u4E00\u4E2A\u90FD\u662F\u53EF\u9009\u7684\uFF0C\u6761\u4EF6\u8D8A\u590D\u6742\u5B9A\u4F4D\u8D8A\u7CBE\u786E\uFF0C\u540C\u65F6\u6027\u80FD\u4E5F\u4F1A\u8D8A\u5DEE\u3002
\u793A\u4F8B\u5982\u4E0B
searchClass {
- // \u4ECE\u6307\u5B9A\u7684\u5305\u540D\u8303\u56F4\u5F00\u59CB\u67E5\u627E\uFF0C\u5B9E\u9645\u4F7F\u7528\u65F6\uFF0C\u4F60\u53EF\u4EE5\u540C\u65F6\u6307\u5B9A\u591A\u4E2A\u5305\u540D\u8303\u56F4
- from("com.demo")
- // \u6307\u5B9A\u5F53\u524D Class \u7684 getSimpleName \u7684\u7ED3\u679C\uFF0C\u4F60\u53EF\u4EE5\u76F4\u63A5\u5BF9\u8FD9\u4E2A\u5B57\u7B26\u4E32\u8FDB\u884C\u903B\u8F91\u5224\u65AD
- // \u8FD9\u91CC\u6211\u4EEC\u4E0D\u786E\u5B9A\u5B83\u7684\u540D\u79F0\u662F\u4E0D\u662F a\uFF0C\u53EF\u4EE5\u53EA\u5224\u65AD\u5B57\u7B26\u4E32\u957F\u5EA6
- simpleName { it.length == 1 }
- // \u6307\u5B9A\u7EE7\u627F\u7684\u7236\u7C7B\u5BF9\u8C61\uFF0C\u5982\u679C\u662F\u5B58\u5728\u7684 stub\uFF0C\u53EF\u4EE5\u76F4\u63A5\u7528\u6CDB\u578B\u8868\u793A
- extends<Activity>()
- // \u6307\u5B9A\u7EE7\u627F\u7684\u7236\u7C7B\u5BF9\u8C61\uFF0C\u53EF\u4EE5\u76F4\u63A5\u5199\u4E3A\u5B8C\u6574\u7C7B\u540D\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u540C\u65F6\u6307\u5B9A\u591A\u4E2A
- extends("android.app.Activity")
- // \u6307\u5B9A\u5B9E\u73B0\u7684\u63A5\u53E3\uFF0C\u5982\u679C\u662F\u5B58\u5728\u7684 stub\uFF0C\u53EF\u4EE5\u76F4\u63A5\u7528\u6CDB\u578B\u8868\u793A
- implements<Serializable>()
- // \u6307\u5B9A\u5B9E\u73B0\u7684\u63A5\u53E3\uFF0C\u53EF\u4EE5\u76F4\u63A5\u5199\u4E3A\u5B8C\u6574\u7C7B\u540D\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u540C\u65F6\u6307\u5B9A\u591A\u4E2A
- implements("java.io.Serializable")
- // \u6307\u5B9A\u6784\u9020\u65B9\u6CD5\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- constructor { param(StringClass) }.count(num = 1)
- // \u6307\u5B9A\u53D8\u91CF\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- field { type = StringClass }.count(num = 2)
- // \u6307\u5B9A\u53D8\u91CF\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- field { type = BooleanType }.count(num = 1)
- // \u76F4\u63A5\u6307\u5B9A\u6240\u6709\u53D8\u91CF\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- field().count(num = 3)
- // \u5982\u679C\u4F60\u8BA4\u4E3A\u53D8\u91CF\u7684\u4E2A\u6570\u662F\u4E0D\u786E\u5B9A\u7684\uFF0C\u8FD8\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u81EA\u5B9A\u4E49\u6761\u4EF6
- field().count(1..3)
- field().count { it >= 3 }
- // \u6307\u5B9A\u65B9\u6CD5\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- method {
- name = "onCreate"
- param(BundleClass)
- }.count(num = 1)
- // \u6307\u5B9A\u65B9\u6CD5\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u540C\u65F6\u6307\u5B9A\u4FEE\u9970\u7B26\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- method {
- modifiers { isStatic && isPrivate }
- param(StringClass)
- returnType = UnitType
- }.count(num = 1)
- // \u6307\u5B9A\u65B9\u6CD5\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u540C\u65F6\u6307\u5B9A\u4FEE\u9970\u7B26\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, StringClass)
- returnType = StringClass
- }.count(num = 1)
- // \u6307\u5B9A\u65B9\u6CD5\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u540C\u65F6\u6307\u5B9A\u4FEE\u9970\u7B26\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- method {
- modifiers { isPrivate && isStatic.not() }
- emptyParam()
- returnType = UnitType
- }.count(num = 1)
- // \u6307\u5B9A\u65B9\u6CD5\u7684\u7C7B\u578B\u4E0E\u6837\u5F0F\uFF0C\u540C\u65F6\u6307\u5B9A\u4FEE\u9970\u7B26\u548C\u6A21\u7CCA\u7C7B\u578B VagueType\uFF0C\u4EE5\u53CA\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, VagueType, VagueType, StringClass)
- returnType = UnitType
- }.count(num = 1)
- // \u76F4\u63A5\u6307\u5B9A\u6240\u6709\u65B9\u6CD5\u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- method().count(num = 5)
- // \u5982\u679C\u4F60\u8BA4\u4E3A\u65B9\u6CD5\u7684\u4E2A\u6570\u662F\u4E0D\u786E\u5B9A\u7684\uFF0C\u8FD8\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u81EA\u5B9A\u4E49\u6761\u4EF6
- method().count(1..5)
- method().count { it >= 5 }
- // \u76F4\u63A5\u6307\u5B9A\u6240\u6709\u6210\u5458 (Member) \u5728\u5F53\u524D\u7C7B\u4E2D\u5B58\u5728\u7684\u4E2A\u6570 count
- // \u6210\u5458\u5305\u62EC\uFF1AField (\u53D8\u91CF)\u3001Method (\u65B9\u6CD5)\u3001Constructor (\u6784\u9020\u65B9\u6CD5)
- member().count(num = 9)
- // \u6240\u6709\u6210\u5458\u4E2D\u4E00\u5B9A\u5B58\u5728\u4E00\u4E2A static \u4FEE\u9970\u7B26\uFF0C\u53EF\u4EE5\u8FD9\u6837\u52A0\u5165\u6B64\u6761\u4EF6
- member {
- modifiers { isStatic }
- }
-}.get() // \u5F97\u5230\u8FD9\u4E2A Class \u672C\u8EAB\u7684\u5B9E\u4F8B\uFF0C\u627E\u4E0D\u5230\u4F1A\u8FD4\u56DE null
-
\u5C0F\u63D0\u793A
\u4E0A\u8FF0\u7528\u6CD5\u4E2D\u5BF9\u4E8E Field\u3001Method\u3001Constructor \u7684\u6761\u4EF6\u7528\u6CD5\u4E0E Member \u6269\u5C55 \u4E2D\u7684\u76F8\u5173\u7528\u6CD5\u662F\u4E00\u81F4\u7684\uFF0C\u4EC5\u6709\u5C0F\u90E8\u5206\u533A\u522B\u3002
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 MemberRules\u3001FieldRules\u3001MethodRules\u3001ConstructorRules\u3002
\u9ED8\u8BA4\u60C5\u51B5\u4E0B DexClassFinder
\u4F1A\u4F7F\u7528\u540C\u6B65\u65B9\u5F0F\u67E5\u627E Class
\uFF0C\u4F1A\u963B\u585E\u5F53\u524D\u7EBF\u7A0B\u76F4\u5230\u627E\u5230\u6216\u627E\u4E0D\u5230\u53D1\u751F\u5F02\u5E38\u4E3A\u6B62\uFF0C\u82E5\u67E5\u627E\u6D88\u8017\u7684\u65F6\u95F4\u8FC7\u957F\uFF0C\u53EF\u80FD\u4F1A\u5BFC\u81F4\u5F53\u524D APP \u53D1\u751F ANR \u95EE\u9898\u3002
\u9488\u5BF9\u4E0A\u8FF0\u95EE\u9898\uFF0C\u6211\u4EEC\u53EF\u4EE5\u542F\u7528\u5F02\u6B65\uFF0C\u53EA\u9700\u8981\u52A0\u5165\u53C2\u6570 async = true
\uFF0C\u8FD9\u5C06\u4E0D\u9700\u8981\u4F60\u518D\u6B21\u542F\u52A8\u4E00\u4E2A\u7EBF\u7A0B\uFF0CAPI \u5DF2\u5E2E\u4F60\u5904\u7406\u597D\u76F8\u5173\u95EE\u9898\u3002
\u6CE8\u610F
\u82E5\u8981\u4F7F\u7528\u6B64\u529F\u80FD\uFF0C\u4F60\u9700\u8981\u5728\u65B9\u6CD5\u53C2\u6570\u9996\u4F4D\u4F20\u5165\u5F53\u524D APP \u7684 Context\u3002
\u5BF9\u4E8E\u5F02\u6B65\u60C5\u51B5\u4E0B\u4F60\u9700\u8981\u4F7F\u7528 wait \u65B9\u6CD5\u6765\u5F97\u5230\u7ED3\u679C\uFF0Cget \u65B9\u6CD5\u5C06\u4E0D\u518D\u8D77\u4F5C\u7528\u3002
\u793A\u4F8B\u5982\u4E0B
val context: Context // \u5047\u8BBE\u8FD9\u5C31\u662F\u5F53\u524D APP \u7684 Context
-searchClass(context, async = true) {
- // ...
-}.wait { class1 ->
- // \u5F97\u5230\u5F02\u6B65\u7ED3\u679C
-}
-searchClass(context, async = true) {
- // ...
-}.wait { class2 ->
- // \u5F97\u5230\u5F02\u6B65\u7ED3\u679C
-}
-
\u8FD9\u6837\u6211\u4EEC\u7684\u67E5\u627E\u8FC7\u7A0B\u5C31\u662F\u5F02\u6B65\u8FD0\u884C\u4E86\uFF0C\u5B83\u5C06\u4E0D\u4F1A\u963B\u585E\u4E3B\u7EBF\u7A0B\uFF0C\u6BCF\u4E2A\u67E5\u627E\u90FD\u5C06\u5728\u5355\u72EC\u7684\u7EBF\u7A0B\u540C\u65F6\u8FDB\u884C\uFF0C\u53EF\u8FBE\u5230\u5E76\u884C\u4EFB\u52A1\u7684\u6548\u679C\u3002
\u7531\u4E8E\u6BCF\u6B21\u91CD\u65B0\u6253\u5F00\u5F53\u524D APP \u90FD\u4F1A\u91CD\u65B0\u8FDB\u884C\u67E5\u627E\uFF0C\u5728\u5F53\u524D APP \u7248\u672C\u4E0D\u53D8\u7684\u60C5\u51B5\u4E0B\u8FD9\u662F\u4E00\u79CD\u91CD\u590D\u6027\u80FD\u6D6A\u8D39\u3002
\u6B64\u65F6\u6211\u4EEC\u53EF\u4EE5\u901A\u8FC7\u6307\u5B9A name
\u53C2\u6570\u6765\u5BF9\u5F53\u524D APP \u7248\u672C\u7684\u67E5\u627E\u7ED3\u679C\u8FDB\u884C\u672C\u5730\u7F13\u5B58\uFF0C\u4E0B\u4E00\u6B21\u5C06\u76F4\u63A5\u4ECE\u672C\u5730\u7F13\u5B58\u4E2D\u8BFB\u53D6\u67E5\u627E\u5230\u7684\u7C7B\u540D\u3002
\u672C\u5730\u7F13\u5B58\u4F7F\u7528\u7684\u662F SharedPreferences
\uFF0C\u5B83\u5C06\u88AB\u4FDD\u5B58\u5230\u5F53\u524D APP \u7684\u6570\u636E\u76EE\u5F55\u4E2D\uFF0C\u5728\u5F53\u524D APP \u7248\u672C\u66F4\u65B0\u540E\u4F1A\u91CD\u65B0\u8FDB\u884C\u7F13\u5B58\u3002
\u542F\u7528\u672C\u5730\u7F13\u5B58\u540E\uFF0C\u5C06\u540C\u65F6\u8BBE\u7F6E async = true
\uFF0C\u4F60\u53EF\u4EE5\u4E0D\u9700\u8981\u518D\u624B\u52A8\u8FDB\u884C\u8BBE\u7F6E\u3002
\u6CE8\u610F
\u82E5\u8981\u4F7F\u7528\u6B64\u529F\u80FD\uFF0C\u4F60\u9700\u8981\u5728\u65B9\u6CD5\u53C2\u6570\u9996\u4F4D\u4F20\u5165\u5F53\u524D APP \u7684 Context\u3002
\u793A\u4F8B\u5982\u4E0B
val context: Context // \u5047\u8BBE\u8FD9\u5C31\u662F\u5F53\u524D APP \u7684 Context
-searchClass(context, name = "com.demo.class1") {
- // ...
-}.wait { class1 ->
- // \u5F97\u5230\u5F02\u6B65\u7ED3\u679C
-}
-searchClass(context, name = "com.demo.class2") {
- // ...
-}.wait { class2 ->
- // \u5F97\u5230\u5F02\u6B65\u7ED3\u679C
-}
-
\u5982\u679C\u4F60\u60F3\u624B\u52A8\u6E05\u9664\u672C\u5730\u7F13\u5B58\uFF0C\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u65B9\u6CD5\u6E05\u9664\u5F53\u524D APP \u7248\u672C\u7684\u7F13\u5B58\u3002
\u793A\u4F8B\u5982\u4E0B
val context: Context // \u5047\u8BBE\u8FD9\u5C31\u662F\u5F53\u524D APP \u7684 Context
-DexClassFinder.clearCache(context)
-
\u4F60\u8FD8\u53EF\u4EE5\u6E05\u9664\u6307\u5B9A\u7248\u672C\u7684 APP \u7F13\u5B58\u3002
\u793A\u4F8B\u5982\u4E0B
val context: Context // \u5047\u8BBE\u8FD9\u5C31\u662F\u5F53\u524D APP \u7684 Context
-DexClassFinder.clearCache(context, versionName = "1.0", versionCode = 1)
-
\u5982\u679C\u4F60\u9700\u8981\u4F7F\u7528\u56FA\u5B9A\u7684\u6761\u4EF6\u540C\u65F6\u67E5\u627E\u4E00\u7EC4 Class
\uFF0C\u90A3\u4E48\u4F60\u53EA\u9700\u8981\u4F7F\u7528 all
\u6216 waitAll
\u65B9\u6CD5\u6765\u5F97\u5230\u7ED3\u679C\u3002
// \u540C\u6B65\u67E5\u627E\uFF0C\u4F7F\u7528 all \u5F97\u5230\u6761\u4EF6\u5168\u90E8\u67E5\u627E\u5230\u7684\u7ED3\u679C
-searchClass {
- // ...
-}.all().forEach { clazz ->
- // \u5F97\u5230\u6BCF\u4E2A\u7ED3\u679C
-}
-// \u540C\u6B65\u67E5\u627E\uFF0C\u4F7F\u7528 all { ... } \u904D\u5386\u6BCF\u4E2A\u7ED3\u679C
-searchClass {
- // ...
-}.all { clazz ->
- // \u5F97\u5230\u6BCF\u4E2A\u7ED3\u679C
-}
-// \u5F02\u6B65\u67E5\u627E\uFF0C\u4F7F\u7528 waitAll \u5F97\u5230\u6761\u4EF6\u5168\u90E8\u67E5\u627E\u5230\u7684\u7ED3\u679C
-val context: Context // \u5047\u8BBE\u8FD9\u5C31\u662F\u5F53\u524D APP \u7684 Context
-searchClass(context, async = true) {
- // ...
-}.waitAll { classes ->
- classes.forEach {
- // \u5F97\u5230\u6BCF\u4E2A\u7ED3\u679C
- }
-}
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 ClassLoader.searchClass \u65B9\u6CD5\u3002
\u8FD9\u91CC\u662F Class \u5B57\u8282\u7801\u6210\u5458\u53D8\u91CF Field\u3001Method\u3001Constructor \u76F8\u5173\u7684\u6269\u5C55\u529F\u80FD\u3002
\u5C0F\u63D0\u793A
Member \u662F Field\u3001Method\u3001Constructor \u7684\u63A5\u53E3\u63CF\u8FF0\u5BF9\u8C61\uFF0C\u5B83\u5728 Java \u53CD\u5C04\u4E2D\u4E3A Class \u4E2D\u5B57\u8282\u7801\u6210\u5458\u7684\u603B\u79F0\u3002
\u5047\u8BBE\u6709\u4E00\u4E2A\u8FD9\u6837\u7684 Class
\u3002
\u793A\u4F8B\u5982\u4E0B
package com.demo;
-
-public class BaseTest {
-
- public BaseTest() {
- // ...
- }
-
- public BaseTest(boolean isInit) {
- // ...
- }
-
- private void doBaseTask(String taskName) {
- // ...
- }
-}
-
package com.demo;
-
-public class Test extends BaseTest {
-
- public Test() {
- // ...
- }
-
- public Test(boolean isInit) {
- // ...
- }
-
- private static TAG = "Test";
-
- private BaseTest baseInstance;
-
- private String a;
-
- private boolean a;
-
- private boolean isTaskRunning = false;
-
- private static void init() {
- // ...
- }
-
- private void doTask(String taskName) {
- // ...
- }
-
- private void release(String taskName, Function<boolean, String> task, boolean isFinish) {
- // ...
- }
-
- private void stop() {
- // ...
- }
-
- private String getName() {
- // ...
- }
-
- private void b() {
- // ...
- }
-
- private void b(String a) {
- // ...
- }
-}
-
\u5047\u8BBE\u6211\u4EEC\u8981\u5F97\u5230 Test
(\u4EE5\u4E0B\u7EDF\u79F0\u201C\u5F53\u524D Class
\u201D)\u7684 doTask
\u65B9\u6CD5\u5E76\u6267\u884C\uFF0C\u901A\u5E38\u60C5\u51B5\u4E0B\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u6807\u51C6\u7684\u53CD\u5C04 API \u53BB\u67E5\u627E\u8FD9\u4E2A\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528\u53CD\u5C04 API \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(instance, "task_name")
-
\u8FD9\u79CD\u5199\u6CD5\u5927\u6982\u4E0D\u662F\u5F88\u53CB\u597D\uFF0C\u6B64\u65F6 YukiReflection
\u5C31\u4E3A\u4F60\u63D0\u4F9B\u4E86\u4E00\u4E2A\u53EF\u5728\u4EFB\u610F\u5730\u65B9\u4F7F\u7528\u7684\u8BED\u6CD5\u7CD6\u3002
\u4EE5\u4E0A\u5199\u6CD5\u6362\u505A YukiReflection
\u53EF\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "doTask"
- param(StringClass)
-}.get(instance).call("task_name")
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 MethodFinder\u3002
\u540C\u6837\u5730\uFF0C\u6211\u4EEC\u9700\u8981\u5F97\u5230 isTaskRunning
\u53D8\u91CF\u4E5F\u53EF\u4EE5\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.field {
- name = "isTaskRunning"
- type = BooleanType
-}.get(instance).any() // any \u4E3A Field \u7684\u4EFB\u610F\u7C7B\u578B\u5B9E\u4F8B\u5316\u5BF9\u8C61
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 FieldFinder\u3002
\u4E5F\u8BB8\u4F60\u8FD8\u60F3\u5F97\u5230\u5F53\u524D Class
\u7684\u6784\u9020\u65B9\u6CD5\uFF0C\u540C\u6837\u53EF\u4EE5\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
Test::class.java.constructor {
- param(BooleanType)
-}.get().call(true) // \u53EF\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5B9E\u4F8B
-
\u82E5\u60F3\u5F97\u5230\u7684\u662F Class
\u7684\u65E0\u53C2\u6784\u9020\u65B9\u6CD5\uFF0C\u53EF\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
Test::class.java.constructor().get().call() // \u53EF\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5B9E\u4F8B
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 ConstructorFinder\u3002
\u5047\u8BBE\u6211\u4EEC\u8981\u5F97\u5230 Class
\u4E2D\u7684 getName
\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "getName"
- emptyParam()
- returnType = StringClass
-}.get(instance).string() // \u5F97\u5230\u65B9\u6CD5\u7684\u7ED3\u679C
-
\u901A\u8FC7\u89C2\u5BDF\u53D1\u73B0\uFF0C\u8FD9\u4E2A Class
\u4E2D\u53EA\u6709\u4E00\u4E2A\u540D\u4E3A getName
\u7684\u65B9\u6CD5\uFF0C\u90A3\u6211\u4EEC\u53EF\u4E0D\u53EF\u4EE5\u518D\u7B80\u5355\u4E00\u70B9\u5462\uFF1F
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "getName"
- emptyParam()
-}.get(instance).string() // \u5F97\u5230\u65B9\u6CD5\u7684\u7ED3\u679C
-
\u662F\u7684\uFF0C\u5BF9\u4E8E\u786E\u5207\u4E0D\u4F1A\u53D8\u5316\u7684\u65B9\u6CD5\uFF0C\u4F60\u53EF\u4EE5\u7CBE\u7B80\u67E5\u627E\u6761\u4EF6\u3002
\u5728\u53EA\u4F7F\u7528 get
\u6216 wait
\u65B9\u6CD5\u5F97\u5230\u7ED3\u679C\u65F6 YukiReflection
\u4F1A\u9ED8\u8BA4\u6309\u7167\u5B57\u8282\u7801\u987A\u5E8F\u5339\u914D\u7B2C\u4E00\u4E2A\u67E5\u627E\u5230\u7684\u7ED3\u679C\u3002
\u95EE\u9898\u53C8\u6765\u4E86\uFF0C\u8FD9\u4E2A Class
\u4E2D\u6709\u4E00\u4E2A release
\u65B9\u6CD5\uFF0C\u4F46\u662F\u5B83\u7684\u65B9\u6CD5\u53C2\u6570\u5F88\u957F\uFF0C\u800C\u4E14\u90E8\u5206\u7C7B\u578B\u53EF\u80FD\u65E0\u6CD5\u76F4\u63A5\u5F97\u5230\u3002
\u901A\u5E38\u60C5\u51B5\u4E0B\u6211\u4EEC\u4F1A\u4F7F\u7528 param(...)
\u6765\u67E5\u627E\u8FD9\u4E2A\u65B9\u6CD5\uFF0C\u4F46\u662F\u6709\u6CA1\u6709\u66F4\u7B80\u5355\u7684\u65B9\u6CD5\u5462\u3002
\u6B64\u65F6\uFF0C\u5728\u786E\u5B9A\u65B9\u6CD5\u552F\u4E00\u6027\u540E\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 paramCount
\u6765\u67E5\u627E\u5230\u8FD9\u4E2A\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "release"
- // \u6B64\u65F6\u6211\u4EEC\u4E0D\u5FC5\u786E\u5B9A\u65B9\u6CD5\u53C2\u6570\u5177\u4F53\u7C7B\u578B\uFF0C\u5199\u4E2A\u6570\u5C31\u597D
- paramCount = 3
-}.get(instance) // \u5F97\u5230\u8FD9\u4E2A\u65B9\u6CD5
-
\u4E0A\u8FF0\u793A\u4F8B\u867D\u7136\u80FD\u591F\u5339\u914D\u6210\u529F\uFF0C\u4F46\u662F\u4E0D\u7CBE\u786E\uFF0C\u6B64\u65F6\u4F60\u8FD8\u53EF\u4EE5\u4F7F\u7528 VagueType
\u6765\u586B\u5145\u4F60\u4E0D\u60F3\u586B\u5199\u7684\u65B9\u6CD5\u53C2\u6570\u7C7B\u578B\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "release"
- // \u4F7F\u7528 VagueType \u6765\u586B\u5145\u4E0D\u60F3\u586B\u5199\u7684\u7C7B\u578B\uFF0C\u540C\u65F6\u4FDD\u8BC1\u5176\u5B83\u7C7B\u578B\u80FD\u591F\u5339\u914D
- param(StringClass, VagueType, BooleanType)
-}.get(instance) // \u5F97\u5230\u8FD9\u4E2A\u65B9\u6CD5
-
\u5982\u679C\u4F60\u5E76\u4E0D\u786E\u5B9A\u6BCF\u4E00\u4E2A\u53C2\u6570\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u901A\u8FC7 param { ... }
\u65B9\u6CD5\u6765\u521B\u5EFA\u4E00\u4E2A\u6761\u4EF6\u65B9\u6CD5\u4F53\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "release"
- // \u5F97\u5230 it (Class) \u65B9\u6CD5\u53C2\u6570\u7C7B\u578B\u6570\u7EC4\u5B9E\u4F8B\u6765\u4EC5\u5224\u65AD\u5DF2\u77E5\u7684\u7C7B\u578B\u548C\u5B83\u7684\u4F4D\u7F6E
- param { it[0] == StringClass && it[2] == BooleanType }
-}.get(instance) // \u5F97\u5230\u8FD9\u4E2A\u65B9\u6CD5
-
\u5C0F\u63D0\u793A
\u4F7F\u7528 param { ... } \u521B\u5EFA\u4E00\u4E2A\u6761\u4EF6\u65B9\u6CD5\u4F53\uFF0C\u5176\u4E2D\u7684\u53D8\u91CF it \u5373\u5F53\u524D\u65B9\u6CD5\u53C2\u6570\u7684 Class \u7C7B\u578B\u6570\u7EC4\u5B9E\u4F8B\uFF0C\u6B64\u65F6\u4F60\u5C31\u53EF\u4EE5\u81EA\u7531\u4F7F\u7528 Class \u4E2D\u7684\u6240\u6709\u5BF9\u8C61\u53CA\u5176\u65B9\u6CD5\u3002
\u65B9\u6CD5\u4F53\u672B\u5C3E\u6761\u4EF6\u9700\u8981\u8FD4\u56DE\u4E00\u4E2A Boolean\uFF0C\u5373\u6700\u7EC8\u7684\u6761\u4EF6\u5224\u65AD\u7ED3\u679C\u3002
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 FieldFinder.type\u3001MethodFinder.param\u3001MethodFinder.returnType\u3001ConstructorFinder.param \u65B9\u6CD5\u3002
\u4F60\u4F1A\u6CE8\u610F\u5230 Test
\u7EE7\u627F\u4E8E BaseTest
\uFF0C\u73B0\u5728\u6211\u4EEC\u60F3\u5F97\u5230 BaseTest
\u7684 doBaseTask
\u65B9\u6CD5\uFF0C\u5728\u4E0D\u77E5\u9053\u7236\u7C7B\u540D\u79F0\u7684\u60C5\u51B5\u4E0B\uFF0C\u8981\u600E\u4E48\u505A\u5462\uFF1F
\u53C2\u7167\u4E0A\u9762\u7684\u67E5\u627E\u6761\u4EF6\uFF0C\u6211\u4EEC\u53EA\u9700\u8981\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\u52A0\u5165\u4E00\u4E2A superClass
\u5373\u53EF\u5B9E\u73B0\u8FD9\u4E2A\u529F\u80FD\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // \u53EA\u9700\u8981\u6DFB\u52A0\u8FD9\u4E2A\u6761\u4EF6
- superClass()
-}.get(instance).call("task_name")
-
\u8FD9\u4E2A\u65F6\u5019\u6211\u4EEC\u5C31\u53EF\u4EE5\u5728\u7236\u7C7B\u4E2D\u53D6\u5230\u8FD9\u4E2A\u65B9\u6CD5\u4E86\u3002
superClass
\u6709\u4E00\u4E2A\u53C2\u6570\u4E3A isOnlySuperClass
\uFF0C\u8BBE\u7F6E\u4E3A true
\u540E\uFF0C\u53EF\u4EE5\u8DF3\u8FC7\u5F53\u524D Class
\u4EC5\u67E5\u627E\u5F53\u524D Class
\u7684\u7236\u7C7B\u3002
\u7531\u4E8E\u6211\u4EEC\u73B0\u5728\u5DF2\u77E5 doBaseTask
\u65B9\u6CD5\u53EA\u5B58\u5728\u4E8E\u7236\u7C7B\uFF0C\u53EF\u4EE5\u52A0\u4E0A\u8FD9\u4E2A\u6761\u4EF6\u8282\u7701\u67E5\u627E\u65F6\u95F4\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // \u52A0\u5165\u4E00\u4E2A\u67E5\u627E\u6761\u4EF6
- superClass(isOnlySuperClass = true)
-}.get(instance).call("task_name")
-
\u8FD9\u4E2A\u65F6\u5019\u6211\u4EEC\u540C\u6837\u53EF\u4EE5\u5F97\u5230\u7236\u7C7B\u4E2D\u7684\u8FD9\u4E2A\u65B9\u6CD5\u3002
superClass
\u4E00\u65E6\u8BBE\u7F6E\u5C31\u4F1A\u81EA\u52A8\u5FAA\u73AF\u5411\u540E\u67E5\u627E\u5168\u90E8\u7EE7\u627F\u7684\u7236\u7C7B\u4E2D\u662F\u5426\u6709\u8FD9\u4E2A\u65B9\u6CD5\uFF0C\u76F4\u5230\u67E5\u627E\u5230\u76EE\u6807\u6CA1\u6709\u7236\u7C7B(\u7EE7\u627F\u5173\u7CFB\u4E3A java.lang.Object
)\u4E3A\u6B62\u3002
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 MethodFinder.superClass\u3001ConstructorFinder.superClass\u3001FieldFinder.superClass \u65B9\u6CD5\u3002
\u7279\u522B\u6CE8\u610F
\u5F53\u524D\u67E5\u627E\u7684 Method \u9664\u975E\u6307\u5B9A superClass \u6761\u4EF6\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u627E\u5230\u5F53\u524D Class \u7684 Method\uFF0C\u8FD9\u662F Java \u53CD\u5C04 API \u7684\u9ED8\u8BA4\u884C\u4E3A\u3002
\u5982\u679C\u6211\u4EEC\u60F3\u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5\u540D\u79F0\uFF0C\u4F46\u662F\u53C8\u4E0D\u786E\u5B9A\u5B83\u5728\u6BCF\u4E2A\u7248\u672C\u4E2D\u662F\u5426\u53D1\u751F\u53D8\u5316\uFF0C\u6B64\u65F6\u6211\u4EEC\u5C31\u53EF\u4EE5\u4F7F\u7528\u6A21\u7CCA\u67E5\u627E\u529F\u80FD\u3002
\u5047\u8BBE\u6211\u4EEC\u8981\u5F97\u5230 Class
\u4E2D\u7684 doTask
\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name {
- // \u8BBE\u7F6E\u540D\u79F0\u4E0D\u533A\u5206\u5927\u5C0F\u5199
- it.equals("dotask", isIgnoreCase = true)
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
\u5DF2\u77E5\u5F53\u524D Class
\u4E2D\u4EC5\u6709\u4E00\u4E2A doTask
\u65B9\u6CD5\uFF0C\u6211\u4EEC\u8FD8\u53EF\u4EE5\u5224\u65AD\u65B9\u6CD5\u540D\u79F0\u4EC5\u5305\u542B\u5176\u4E2D\u6307\u5B9A\u7684\u5B57\u7B26\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name {
- // \u4EC5\u5305\u542B oTas
- it.contains("oTas")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
\u6211\u4EEC\u8FD8\u53EF\u4EE5\u6839\u636E\u9996\u5C3E\u5B57\u7B26\u4E32\u8FDB\u884C\u5224\u65AD\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name {
- // \u5F00\u5934\u5305\u542B do\uFF0C\u7ED3\u5C3E\u5305\u542B Task
- it.startsWith("do") && it.endsWith("Task")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
\u901A\u8FC7\u89C2\u5BDF\u53D1\u73B0\u8FD9\u4E2A\u65B9\u6CD5\u540D\u79F0\u4E2D\u53EA\u5305\u542B\u5B57\u6BCD\uFF0C\u6211\u4EEC\u8FD8\u53EF\u4EE5\u518D\u589E\u52A0\u4E00\u4E2A\u7CBE\u786E\u7684\u67E5\u627E\u6761\u4EF6\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name {
- // \u5F00\u5934\u5305\u542B do\uFF0C\u7ED3\u5C3E\u5305\u542B Task\uFF0C\u4EC5\u5305\u542B\u5B57\u6BCD
- it.startsWith("do") && it.endsWith("Task") && it.isOnlyLetters()
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
\u5C0F\u63D0\u793A
\u4F7F\u7528 name { ... } \u521B\u5EFA\u4E00\u4E2A\u6761\u4EF6\u65B9\u6CD5\u4F53\uFF0C\u5176\u4E2D\u7684\u53D8\u91CF it \u5373\u5F53\u524D\u540D\u79F0\u7684\u5B57\u7B26\u4E32\uFF0C\u6B64\u65F6\u4F60\u5C31\u53EF\u4EE5\u5728 NameRules \u7684\u6269\u5C55\u65B9\u6CD5\u4E2D\u81EA\u7531\u4F7F\u7528\u5176\u4E2D\u7684\u529F\u80FD\u3002
\u65B9\u6CD5\u4F53\u672B\u5C3E\u6761\u4EF6\u9700\u8981\u8FD4\u56DE\u4E00\u4E2A Boolean\uFF0C\u5373\u6700\u7EC8\u7684\u6761\u4EF6\u5224\u65AD\u7ED3\u679C\u3002
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 FieldFinder.name\u3001MethodFinder.name \u65B9\u6CD5\u4EE5\u53CA NameRules\u3002
\u6709\u4E9B\u65F6\u5019\uFF0C\u6211\u4EEC\u53EF\u80FD\u9700\u8981\u67E5\u627E\u4E00\u4E2A Class
\u4E2D\u5177\u6709\u76F8\u540C\u7279\u5F81\u7684\u4E00\u7EC4\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\uFF0C\u6B64\u65F6\uFF0C\u6211\u4EEC\u5C31\u53EF\u4EE5\u5229\u7528\u76F8\u5BF9\u6761\u4EF6\u5339\u914D\u6765\u5B8C\u6210\u3002
\u5728\u67E5\u627E\u6761\u4EF6\u7ED3\u679C\u7684\u57FA\u7840\u4E0A\uFF0C\u6211\u4EEC\u53EA\u9700\u8981\u628A get
\u6362\u4E3A all
\u5373\u53EF\u5F97\u5230\u5339\u914D\u6761\u4EF6\u7684\u5168\u90E8\u5B57\u8282\u7801\u3002
\u5047\u8BBE\u8FD9\u6B21\u6211\u4EEC\u8981\u5F97\u5230 Class
\u4E2D\u65B9\u6CD5\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u5728 1..3
\u7684\u5168\u90E8\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- paramCount(1..3)
-}.all(instance).forEach { instance ->
- // \u8C03\u7528\u6267\u884C\u6BCF\u4E2A\u65B9\u6CD5
- instance.call(...)
-}
-
\u4E0A\u8FF0\u793A\u4F8B\u53EF\u5B8C\u7F8E\u5339\u914D\u5230\u5982\u4E0B 3 \u4E2A\u65B9\u6CD5\u3002
private void doTask(String taskName)
private void release(String taskName, Function<boolean, String> task, boolean isFinish)
private void b(String a)
\u5982\u679C\u4F60\u60F3\u66F4\u52A0\u81EA\u7531\u5730\u5B9A\u4E49\u53C2\u6570\u4E2A\u6570\u8303\u56F4\u7684\u6761\u4EF6\uFF0C\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- paramCount { it < 3 }
-}.all(instance).forEach { instance ->
- // \u8C03\u7528\u6267\u884C\u6BCF\u4E2A\u65B9\u6CD5
- instance.call(...)
-}
-
\u4E0A\u8FF0\u793A\u4F8B\u53EF\u5B8C\u7F8E\u5339\u914D\u5230\u5982\u4E0B 6 \u4E2A\u65B9\u6CD5\u3002
private static void init()
private void doTask(String taskName)
private void stop(String a)
private void getName(String a)
private void b()
private void b(String a)
\u901A\u8FC7\u89C2\u5BDF Class
\u4E2D\u6709\u4E24\u4E2A\u540D\u79F0\u4E3A b
\u7684\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "b"
-}.all(instance).forEach { instance ->
- // \u8C03\u7528\u6267\u884C\u6BCF\u4E2A\u65B9\u6CD5
- instance.call(...)
-}
-
\u4E0A\u8FF0\u793A\u4F8B\u53EF\u5B8C\u7F8E\u5339\u914D\u5230\u5982\u4E0B 2 \u4E2A\u65B9\u6CD5\u3002
private void b()
private void b(String a)
\u5C0F\u63D0\u793A
\u4F7F\u7528 paramCount { ... } \u521B\u5EFA\u4E00\u4E2A\u6761\u4EF6\u65B9\u6CD5\u4F53\uFF0C\u5176\u4E2D\u7684\u53D8\u91CF it \u5373\u5F53\u524D\u53C2\u6570\u4E2A\u6570\u7684\u6574\u6570\uFF0C\u6B64\u65F6\u4F60\u5C31\u53EF\u4EE5\u5728 CountRules \u7684\u6269\u5C55\u65B9\u6CD5\u4E2D\u81EA\u7531\u4F7F\u7528\u5176\u4E2D\u7684\u529F\u80FD\u3002
\u65B9\u6CD5\u4F53\u672B\u5C3E\u6761\u4EF6\u9700\u8981\u8FD4\u56DE\u4E00\u4E2A Boolean\uFF0C\u5373\u6700\u7EC8\u7684\u6761\u4EF6\u5224\u65AD\u7ED3\u679C\u3002
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 MethodFinder.paramCount\u3001ConstructorFinder.paramCount \u65B9\u6CD5\u4EE5\u53CA CountRules\u3002
\u6709\u4E9B\u65B9\u6CD5\u548C\u53D8\u91CF\u5728 Class
\u4E2D\u662F\u9759\u6001\u7684\u5B9E\u73B0\uFF0C\u8FD9\u4E2A\u65F6\u5019\uFF0C\u6211\u4EEC\u4E0D\u9700\u8981\u4F20\u5165\u5B9E\u4F8B\u5C31\u53EF\u4EE5\u8C03\u7528\u5B83\u4EEC\u3002
\u5047\u8BBE\u6211\u4EEC\u8FD9\u6B21\u8981\u5F97\u5230\u9759\u6001\u53D8\u91CF TAG
\u7684\u5185\u5BB9\u3002
\u793A\u4F8B\u5982\u4E0B
Test::class.java.field {
- name = "TAG"
- type = StringClass
-}.get().string() // Field \u7684\u7C7B\u578B\u662F\u5B57\u7B26\u4E32\uFF0C\u53EF\u76F4\u63A5\u8FDB\u884C cast
-
\u5047\u8BBE Class
\u4E2D\u5B58\u5728\u540C\u540D\u7684\u975E\u9759\u6001 TAG
\u53D8\u91CF\uFF0C\u8FD9\u4E2A\u65F6\u5019\u600E\u4E48\u529E\u5462\uFF1F
\u52A0\u5165\u4E00\u4E2A\u7B5B\u9009\u6761\u4EF6\u5373\u53EF\u3002
\u793A\u4F8B\u5982\u4E0B
Test::class.java.field {
- name = "TAG"
- type = StringClass
- // \u6807\u8BC6\u67E5\u627E\u7684\u8FD9\u4E2A\u53D8\u91CF\u9700\u8981\u662F\u9759\u6001
- modifiers { isStatic }
-}.get().string() // Field \u7684\u7C7B\u578B\u662F\u5B57\u7B26\u4E32\uFF0C\u53EF\u76F4\u63A5\u8FDB\u884C cast
-
\u6211\u4EEC\u8FD8\u53EF\u4EE5\u8C03\u7528\u540D\u4E3A init
\u7684\u9759\u6001\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
Test::class.java.method {
- name = "init"
- emptyParam()
-}.get().call()
-
\u540C\u6837\u5730\uFF0C\u4F60\u53EF\u4EE5\u6807\u8BC6\u5B83\u662F\u4E00\u4E2A\u9759\u6001\u3002
\u793A\u4F8B\u5982\u4E0B
Test::class.java.method {
- name = "init"
- emptyParam()
- // \u6807\u8BC6\u67E5\u627E\u7684\u8FD9\u4E2A\u65B9\u6CD5\u9700\u8981\u662F\u9759\u6001
- modifiers { isStatic }
-}.get().call()
-
\u5C0F\u63D0\u793A
\u4F7F\u7528 modifiers { ... } \u521B\u5EFA\u4E00\u4E2A\u6761\u4EF6\u65B9\u6CD5\u4F53\uFF0C\u6B64\u65F6\u4F60\u5C31\u53EF\u4EE5\u5728 ModifierRules \u4E2D\u81EA\u7531\u4F7F\u7528\u5176\u4E2D\u7684\u529F\u80FD\u3002
\u65B9\u6CD5\u4F53\u672B\u5C3E\u6761\u4EF6\u9700\u8981\u8FD4\u56DE\u4E00\u4E2A Boolean\uFF0C\u5373\u6700\u7EC8\u7684\u6761\u4EF6\u5224\u65AD\u7ED3\u679C\u3002
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 FieldFinder.modifiers\u3001MethodFinder.modifiers\u3001ConstructorFinder.modifiers \u65B9\u6CD5\u4EE5\u53CA ModifierRules\u3002
\u4F60\u53EF\u80FD\u5DF2\u7ECF\u6CE8\u610F\u5230\u4E86\uFF0C\u8FD9\u91CC\u7ED9\u51FA\u7684\u793A\u4F8B Class
\u4E2D\u6709\u4E24\u4E2A\u6DF7\u6DC6\u7684\u53D8\u91CF\u540D\u79F0\uFF0C\u5B83\u4EEC\u90FD\u662F a
\uFF0C\u8FD9\u4E2A\u65F6\u5019\u6211\u4EEC\u8981\u600E\u4E48\u5F97\u5230\u5B83\u4EEC\u5462\uFF1F
\u6709\u4E24\u79CD\u65B9\u6848\u3002
\u7B2C\u4E00\u79CD\u65B9\u6848\uFF0C\u786E\u5B9A\u53D8\u91CF\u7684\u540D\u79F0\u548C\u7C7B\u578B\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.field {
- name = "a"
- type = BooleanType
-}.get(instance).any() // \u5F97\u5230\u540D\u79F0\u4E3A a \u7C7B\u578B\u4E3A Boolean \u7684\u53D8\u91CF
-
\u7B2C\u4E8C\u79CD\u65B9\u6848\uFF0C\u786E\u5B9A\u53D8\u91CF\u7684\u7C7B\u578B\u6240\u5728\u7684\u4F4D\u7F6E\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.field {
- type(BooleanType).index().first()
-}.get(instance).any() // \u5F97\u5230\u7B2C\u4E00\u4E2A\u7C7B\u578B\u4E3A Boolean \u7684\u53D8\u91CF
-
\u4EE5\u4E0A\u4E24\u79CD\u60C5\u51B5\u5747\u53EF\u5F97\u5230\u5BF9\u5E94\u7684\u53D8\u91CF private boolean a
\u3002
\u540C\u6837\u5730\uFF0C\u8FD9\u4E2A Class
\u4E2D\u4E5F\u6709\u4E24\u4E2A\u6DF7\u6DC6\u7684\u65B9\u6CD5\u540D\u79F0\uFF0C\u5B83\u4EEC\u90FD\u662F b
\u3002
\u4F60\u4E5F\u53EF\u4EE5\u6709\u4E24\u79CD\u65B9\u6848\u6765\u5F97\u5230\u5B83\u4EEC\u3002
\u7B2C\u4E00\u79CD\u65B9\u6848\uFF0C\u786E\u5B9A\u65B9\u6CD5\u7684\u540D\u79F0\u548C\u65B9\u6CD5\u53C2\u6570\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "b"
- param(StringClass)
-}.get(instance).call("test_string") // \u5F97\u5230\u540D\u79F0\u4E3A b \u65B9\u6CD5\u53C2\u6570\u4E3A [String] \u7684\u65B9\u6CD5
-
\u7B2C\u4E8C\u79CD\u65B9\u6848\uFF0C\u786E\u5B9A\u65B9\u6CD5\u7684\u53C2\u6570\u6240\u5728\u7684\u4F4D\u7F6E\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- param(StringClass).index().first()
-}.get(instance).call("test_string") // \u5F97\u5230\u7B2C\u4E00\u4E2A\u65B9\u6CD5\u53C2\u6570\u4E3A [String] \u7684\u65B9\u6CD5
-
\u7531\u4E8E\u89C2\u5BDF\u5230\u8FD9\u4E2A\u65B9\u6CD5\u5728 Class
\u7684\u6700\u540E\u4E00\u4E2A\uFF0C\u90A3\u6211\u4EEC\u8FD8\u6709\u4E00\u4E2A\u5907\u9009\u65B9\u6848\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- order().index().last()
-}.get(instance).call("test_string") // \u5F97\u5230\u5F53\u524D Class \u7684\u6700\u540E\u4E00\u4E2A\u65B9\u6CD5
-
\u6CE8\u610F
\u8BF7\u5C3D\u91CF\u907F\u514D\u4F7F\u7528 order \u6765\u7B5B\u9009\u5B57\u8282\u7801\u7684\u4E0B\u6807\uFF0C\u5B83\u4EEC\u53EF\u80FD\u662F\u4E0D\u786E\u5B9A\u7684\uFF0C\u9664\u975E\u4F60\u786E\u5B9A\u5B83\u5728\u8FD9\u4E2A Class \u4E2D\u7684\u4F4D\u7F6E\u4E00\u5B9A\u4E0D\u4F1A\u53D8\u3002
\u4E0A\u9762\u4ECB\u7ECD\u7684\u8C03\u7528\u5B57\u8282\u7801\u7684\u65B9\u6CD5\u90FD\u9700\u8981\u4F7F\u7528 get(instance)
\u624D\u80FD\u8C03\u7528\u5BF9\u5E94\u7684\u65B9\u6CD5\uFF0C\u6709\u6CA1\u6709\u7B80\u5355\u4E00\u70B9\u7684\u529E\u6CD5\u5462\uFF1F
\u6B64\u65F6\uFF0C\u4F60\u53EF\u4EE5\u5728\u4EFB\u610F\u5B9E\u4F8B\u4E0A\u4F7F\u7528 current
\u65B9\u6CD5\u6765\u521B\u5EFA\u4E00\u4E2A\u8C03\u7528\u7A7A\u95F4\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u5047\u8BBE\u8FD9\u4E2A Class \u662F\u4E0D\u80FD\u88AB\u76F4\u63A5\u5F97\u5230\u7684
-instance.current {
- // \u6267\u884C doTask \u65B9\u6CD5
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
- // \u6267\u884C stop \u65B9\u6CD5
- method {
- name = "stop"
- emptyParam()
- }.call()
- // \u5F97\u5230 name
- val name = method { name = "getName" }.string()
-}
-
\u6211\u4EEC\u8FD8\u53EF\u4EE5\u7528 superClass
\u8C03\u7528\u5F53\u524D Class
\u7236\u7C7B\u7684\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u5047\u8BBE\u8FD9\u4E2A Class \u662F\u4E0D\u80FD\u88AB\u76F4\u63A5\u5F97\u5230\u7684
-instance.current {
- // \u6267\u884C\u7236\u7C7B\u7684 doBaseTask \u65B9\u6CD5
- superClass().method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
-}
-
\u5982\u679C\u4F60\u4E0D\u559C\u6B22\u4F7F\u7528\u4E00\u4E2A\u5927\u62EC\u53F7\u7684\u8C03\u7528\u57DF\u6765\u521B\u5EFA\u5F53\u524D\u5B9E\u4F8B\u7684\u547D\u540D\u7A7A\u95F4\uFF0C\u4F60\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 current()
\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B\uFF0C\u8FD9\u4E2A Class \u662F\u4E0D\u80FD\u88AB\u76F4\u63A5\u5F97\u5230\u7684
-val instance = Test()
-// \u6267\u884C doTask \u65B9\u6CD5
-instance
- .current()
- .method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-// \u6267\u884C stop \u65B9\u6CD5
-instance
- .current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// \u5F97\u5230 name
-val name = instance.current().method { name = "getName" }.string()
-
\u540C\u6837\u5730\uFF0C\u5B83\u4EEC\u4E4B\u95F4\u53EF\u4EE5\u8FDE\u7EED\u8C03\u7528\uFF0C\u4F46\u4E0D\u5141\u8BB8\u5185\u8054\u8C03\u7528\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u5047\u8BBE\u8FD9\u4E2A Class \u662F\u4E0D\u80FD\u88AB\u76F4\u63A5\u5F97\u5230\u7684
-instance.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}.current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// \u2757\u6CE8\u610F\uFF0C\u56E0\u4E3A current() \u8FD4\u56DE\u7684\u662F CurrentClass \u81EA\u8EAB\u5BF9\u8C61\uFF0C\u6240\u4EE5\u4E0D\u80FD\u50CF\u4E0B\u9762\u8FD9\u6837\u8C03\u7528
-instance.current().current()
-
\u9488\u5BF9 Field
\u5B9E\u4F8B\uFF0C\u8FD8\u6709\u4E00\u4E2A\u4FBF\u6377\u7684\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u76F4\u63A5\u83B7\u53D6 Field
\u6240\u5728\u5B9E\u4F8B\u7684\u5BF9\u8C61\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u5047\u8BBE\u8FD9\u4E2A Class \u662F\u4E0D\u80FD\u88AB\u76F4\u63A5\u5F97\u5230\u7684
-instance.current {
- // <\u65B9\u68481>
- field {
- name = "baseInstance"
- }.current {
- method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
- }
- // <\u65B9\u68482>
- field {
- name = "baseInstance"
- }.current()
- ?.method {
- name = "doBaseTask"
- param(StringClass)
- }?.call("task_name")
-}
-
\u6CE8\u610F
\u4E0A\u8FF0 current \u65B9\u6CD5\u76F8\u5F53\u4E8E\u5E2E\u4F60\u8C03\u7528\u4E86 CurrentClass \u4E2D\u7684 field { ... }.any()?.current() \u65B9\u6CD5\u3002
\u82E5\u4E0D\u5B58\u5728 CurrentClass \u8C03\u7528\u57DF\uFF0C\u4F60\u9700\u8981\u4F7F\u7528 field { ... }.get(instance).current() \u6765\u8FDB\u884C\u8C03\u7528\u3002
\u95EE\u9898\u53C8\u6765\u4E86\uFF0C\u6211\u60F3\u4F7F\u7528\u53CD\u5C04\u7684\u65B9\u5F0F\u521B\u5EFA\u5982\u4E0B\u7684\u5B9E\u4F8B\u5E76\u8C03\u7528\u5176\u4E2D\u7684\u65B9\u6CD5\uFF0C\u8BE5\u600E\u4E48\u505A\u5462\uFF1F
\u793A\u4F8B\u5982\u4E0B
Test(true).doTask("task_name")
-
\u901A\u5E38\u60C5\u51B5\u4E0B\uFF0C\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u6807\u51C6\u7684\u53CD\u5C04 API \u6765\u8C03\u7528\u3002
\u793A\u4F8B\u5982\u4E0B
"com.demo.Test".toClass()
- .getDeclaredConstructor(Boolean::class.java)
- .apply { isAccessible = true }
- .newInstance(true)
- .apply {
- javaClass
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(this, "task_name")
- }
-
\u4F46\u662F\u611F\u89C9\u8FD9\u79CD\u505A\u6CD5\u597D\u9EBB\u70E6\uFF0C\u6709\u6CA1\u6709\u66F4\u7B80\u6D01\u7684\u8C03\u7528\u65B9\u6CD5\u5462\uFF1F
\u8FD9\u4E2A\u65F6\u5019\uFF0C\u6211\u4EEC\u8FD8\u53EF\u4EE5\u501F\u52A9 buildOf
\u65B9\u6CD5\u6765\u521B\u5EFA\u4E00\u4E2A\u5B9E\u4F8B\u3002
\u793A\u4F8B\u5982\u4E0B
"com.demo.Test".toClass().buildOf(true) { param(BooleanType) }?.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}
-
\u82E5\u4F60\u5E0C\u671B buildOf
\u65B9\u6CD5\u8FD4\u56DE\u5F53\u524D\u5B9E\u4F8B\u7684\u7C7B\u578B\uFF0C\u4F60\u53EF\u4EE5\u5728\u5176\u4E2D\u52A0\u5165\u7C7B\u578B\u6CDB\u578B\u58F0\u660E\uFF0C\u800C\u65E0\u9700\u4F7F\u7528 as
\u6765 cast
\u76EE\u6807\u7C7B\u578B\u3002
\u8FD9\u79CD\u60C5\u51B5\u591A\u7528\u4E8E\u5B9E\u4F8B\u672C\u8EAB\u7684\u6784\u9020\u65B9\u6CD5\u662F\u79C1\u6709\u7684\uFF0C\u4F46\u662F\u91CC\u9762\u7684\u65B9\u6CD5\u662F\u516C\u6709\u7684\uFF0C\u8FD9\u6837\u6211\u4EEC\u53EA\u9700\u8981\u5BF9\u5176\u6784\u9020\u65B9\u6CD5\u8FDB\u884C\u53CD\u5C04\u521B\u5EFA\u5373\u53EF\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u4E2A Class \u662F\u80FD\u591F\u76F4\u63A5\u88AB\u5F97\u5230\u7684
-val test = Test::class.java.buildOf<Test>(true) { param(BooleanType) }
-test.doTask("task_name")
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 CurrentClass \u4EE5\u53CA Class.buildOf \u65B9\u6CD5\u3002
\u5047\u8BBE\u6709\u4E09\u4E2A\u4E0D\u540C\u7248\u672C\u7684 Class
\uFF0C\u5B83\u4EEC\u90FD\u662F\u8FD9\u4E2A APP \u4E0D\u540C\u7248\u672C\u76F8\u540C\u7684 Class
\u3002
\u8FD9\u91CC\u9762\u540C\u6837\u90FD\u6709\u4E00\u4E2A\u65B9\u6CD5 doTask
\uFF0C\u5047\u8BBE\u5B83\u4EEC\u7684\u529F\u80FD\u662F\u4E00\u6837\u7684\u3002
\u7248\u672C A \u793A\u4F8B\u5982\u4E0B
public class Test {
-
- public void doTask() {
- // ...
- }
-}
-
\u7248\u672C B \u793A\u4F8B\u5982\u4E0B
public class Test {
-
- public void doTask(String taskName) {
- // ...
- }
-}
-
\u7248\u672C C \u793A\u4F8B\u5982\u4E0B
public class Test {
-
- public void doTask(String taskName, int type) {
- // ...
- }
-}
-
\u6211\u4EEC\u9700\u8981\u5728\u4E0D\u540C\u7684\u7248\u672C\u4E2D\u5F97\u5230\u8FD9\u4E2A\u76F8\u540C\u529F\u80FD\u7684 doTask
\u65B9\u6CD5\uFF0C\u8981\u600E\u4E48\u505A\u5462\uFF1F
\u6B64\u65F6\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 RemedyPlan
\u5B8C\u6210\u4F60\u7684\u9700\u6C42\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- param(StringClass)
- }.onFind {
- // \u53EF\u5728\u8FD9\u91CC\u5B9E\u73B0\u627E\u5230\u7684\u903B\u8F91
- }
- method {
- name = "doTask"
- param(StringClass, IntType)
- }.onFind {
- // \u53EF\u5728\u8FD9\u91CC\u5B9E\u73B0\u627E\u5230\u7684\u903B\u8F91
- }
-}.wait(instance) {
- // \u5F97\u5230\u65B9\u6CD5\u7684\u7ED3\u679C
-}
-
\u7279\u522B\u6CE8\u610F
\u4F7F\u7528\u4E86 RemedyPlan \u7684\u65B9\u6CD5\u67E5\u627E\u7ED3\u679C\u4E0D\u80FD\u518D\u4F7F\u7528 get \u7684\u65B9\u5F0F\u5F97\u5230\u65B9\u6CD5\u5B9E\u4F8B\uFF0C\u5E94\u5F53\u4F7F\u7528 wait \u65B9\u6CD5\u3002
\u53E6\u5916\uFF0C\u4F60\u8FD8\u53EF\u4EE5\u5728\u4F7F\u7528 \u591A\u91CD\u67E5\u627E \u7684\u60C5\u51B5\u4E0B\u7EE7\u7EED\u4F7F\u7528 RemedyPlan
\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u5C31\u662F\u8FD9\u4E2A Class \u7684\u5B9E\u4F8B
-val instance = Test()
-// \u4F7F\u7528 YukiReflection \u8C03\u7528\u5E76\u6267\u884C
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- paramCount(0..1)
- }.onFind {
- // \u53EF\u5728\u8FD9\u91CC\u5B9E\u73B0\u627E\u5230\u7684\u903B\u8F91
- }
- method {
- name = "doTask"
- paramCount(1..2)
- }.onFind {
- // \u53EF\u5728\u8FD9\u91CC\u5B9E\u73B0\u627E\u5230\u7684\u903B\u8F91
- }
-}.waitAll(instance) {
- // \u5F97\u5230\u65B9\u6CD5\u7684\u7ED3\u679C
-}
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 MethodFinder.RemedyPlan\u3001ConstructorFinder.RemedyPlan\u3001FieldFinder.RemedyPlan\u3002
\u5047\u8BBE\u5F53\u524D APP \u4E2D\u4E0D\u540C\u7248\u672C\u4E2D\u5B58\u5728\u529F\u80FD\u76F8\u540C\u7684 Class
\u4F46\u4EC5\u6709 Class
\u7684\u540D\u79F0\u4E0D\u4E00\u6837\u3002
\u7248\u672C A \u793A\u4F8B\u5982\u4E0B
public class ATest {
-
- public static void doTask() {
- // ...
- }
-}
-
\u7248\u672C B \u793A\u4F8B\u5982\u4E0B
public class BTest {
-
- public static void doTask() {
- // ...
- }
-}
-
\u8FD9\u4E2A\u65F6\u5019\u6211\u4EEC\u60F3\u5728\u6BCF\u4E2A\u7248\u672C\u90FD\u8C03\u7528\u8FD9\u4E2A Class
\u91CC\u7684 doTask
\u65B9\u6CD5\u8BE5\u600E\u4E48\u505A\u5462\uFF1F
\u901A\u5E38\u505A\u6CD5\u662F\u5224\u65AD Class
\u662F\u5426\u5B58\u5728\u3002
\u793A\u4F8B\u5982\u4E0B
// \u9996\u5148\u67E5\u627E\u5230\u8FD9\u4E2A Class
-val currentClass =
- if("com.demo.ATest".hasClass()) "com.demo.ATest".toClass() else "com.demo.BTest".toClass()
-// \u7136\u540E\u518D\u67E5\u627E\u8FD9\u4E2A\u65B9\u6CD5\u5E76\u8C03\u7528
-currentClass.method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
\u611F\u89C9\u8FD9\u79CD\u65B9\u6848\u975E\u5E38\u7684\u4E0D\u4F18\u96C5\u4E14\u7E41\u7410\uFF0C\u90A3\u4E48\u6B64\u65F6 YukiReflection
\u5C31\u4E3A\u4F60\u63D0\u4F9B\u4E86\u4E00\u4E2A\u975E\u5E38\u65B9\u4FBF\u7684 VariousClass
\u4E13\u95E8\u6765\u89E3\u51B3\u8FD9\u4E2A\u95EE\u9898\u3002
\u73B0\u5728\uFF0C\u4F60\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528\u4EE5\u4E0B\u65B9\u5F0F\u83B7\u53D6\u5230\u8FD9\u4E2A Class
\u3002
\u793A\u4F8B\u5982\u4E0B
VariousClass("com.demo.ATest", "com.demo.BTest").get().method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
\u82E5\u5F53\u524D Class
\u5728\u6307\u5B9A\u7684 ClassLoader
\u4E2D\u5B58\u5728\uFF0C\u4F60\u53EF\u4EE5\u5728 get
\u4E2D\u586B\u5165\u4F60\u7684 ClassLoader
\u3002
\u793A\u4F8B\u5982\u4E0B
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").get(customClassLoader).method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
\u82E5\u4F60\u4E0D\u786E\u5B9A\u6240\u6709\u7684 Class
\u4E00\u5B9A\u4F1A\u88AB\u5339\u914D\u5230\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528 getOrNull
\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
val customClassLoader: ClassLoader? = ... // \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F\u4F60\u7684 ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").getOrNull(customClassLoader)?.method {
- name = "doTask"
- emptyParam()
-}?.get()?.call()
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 VariousClass\u3002
\u5728\u53CD\u5C04\u8FC7\u7A0B\u4E2D\uFF0C\u6211\u4EEC\u53EF\u80FD\u4F1A\u9047\u5230\u6CDB\u578B\u95EE\u9898\uFF0C\u5728\u6CDB\u578B\u7684\u53CD\u5C04\u5904\u7406\u4E0A\uFF0CYukiReflection
\u540C\u6837\u63D0\u4F9B\u4E86\u4E00\u4E2A\u53EF\u5728\u4EFB\u610F\u5730\u65B9\u4F7F\u7528\u7684\u8BED\u6CD5\u7CD6\u3002
\u4F8B\u5982\u6211\u4EEC\u6709\u5982\u4E0B\u7684\u6CDB\u578B\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // ...
- }
-}
-
\u5F53\u6211\u4EEC\u60F3\u5728\u5F53\u524D Class
\u4E2D\u83B7\u5F97\u6CDB\u578B T
\u6216 R
\u7684 Class
\u5B9E\u4F8B\uFF0C\u53EA\u9700\u8981\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // \u83B7\u5F97\u5F53\u524D\u5B9E\u4F8B\u7684\u64CD\u4F5C\u5BF9\u8C61
- // \u83B7\u5F97 T \u7684 Class \u5B9E\u4F8B\uFF0C\u5728\u53C2\u6570\u7B2C 0 \u4F4D\uFF0C\u9ED8\u8BA4\u503C\u53EF\u4EE5\u4E0D\u5199
- val tClass = current().generic()?.argument()
- // \u83B7\u5F97 R \u7684 Class \u5B9E\u4F8B\uFF0C\u5728\u53C2\u6570\u7B2C 1 \u4F4D
- val rClass = current().generic()?.argument(index = 1)
- // \u4F60\u8FD8\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u5199\u6CD5
- current().generic {
- // \u83B7\u5F97 T \u7684 Class \u5B9E\u4F8B\uFF0C\u5728\u53C2\u6570\u7B2C 0 \u4F4D\uFF0C\u9ED8\u8BA4\u503C\u53EF\u4EE5\u4E0D\u5199
- val tClass = argument()
- // \u83B7\u5F97 R \u7684 Class \u5B9E\u4F8B\uFF0C\u5728\u53C2\u6570\u7B2C 1 \u4F4D
- val rClass = argument(index = 1)
- }
- }
-}
-
\u5F53\u6211\u4EEC\u60F3\u5728\u5916\u90E8\u8C03\u7528\u8FD9\u4E2A Class
\u65F6\uFF0C\u5C31\u53EF\u4EE5\u6709\u5982\u4E0B\u5B9E\u73B0\u3002
\u793A\u4F8B\u5982\u4E0B
// \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F T \u7684 Class
-class TI {
-
- fun foo() {
- // ...
- }
-}
-// \u5047\u8BBE\u8FD9\u4E2A\u5C31\u662F T \u7684\u5B9E\u4F8B
-val tInstance: TI? = ...
-// \u83B7\u5F97 T \u7684 Class \u5B9E\u4F8B\uFF0C\u5728\u53C2\u6570\u7B2C 0 \u4F4D\uFF0C\u9ED8\u8BA4\u503C\u53EF\u4EE5\u4E0D\u5199\uFF0C\u5E76\u83B7\u5F97\u5176\u4E2D\u7684\u65B9\u6CD5 foo \u5E76\u8C03\u7528
-TestGeneric::class.java.generic()?.argument()?.method {
- name = "foo"
- emptyParam()
-}?.get(tInstance)?.invoke<TI>()
-
\u5C0F\u63D0\u793A
\u66F4\u591A\u529F\u80FD\u8BF7\u53C2\u8003 CurrentClass.generic\u3001Class.generic \u65B9\u6CD5\u4EE5\u53CA GenericClass\u3002
\u8FD9\u91CC\u5217\u4E3E\u4E86\u4F7F\u7528\u65F6\u53EF\u80FD\u4F1A\u9047\u5230\u7684\u8BEF\u533A\u90E8\u5206\uFF0C\u53EF\u4F9B\u53C2\u8003\u3002
\u7279\u522B\u6CE8\u610F
\u5728\u67E5\u627E\u6761\u4EF6\u4E2D\uFF0C\u9664\u4E86 order \u4F60\u53EA\u80FD\u4F7F\u7528\u4E00\u6B21 index \u529F\u80FD\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- name = "test"
- param(BooleanType).index(num = 2)
- // \u2757\u9519\u8BEF\u7684\u4F7F\u7528\u65B9\u6CD5\uFF0C\u8BF7\u4EC5\u4FDD\u7559\u4E00\u4E2A index \u65B9\u6CD5
- returnType(StringClass).index(num = 1)
-}
-
\u4EE5\u4E0B\u67E5\u627E\u6761\u4EF6\u7684\u4F7F\u7528\u662F\u6CA1\u6709\u4EFB\u4F55\u95EE\u9898\u7684\u3002
\u793A\u4F8B\u5982\u4E0B
method {
- name = "test"
- param(BooleanType).index(num = 2)
- order().index(num = 1)
-}
-
\u7279\u522B\u6CE8\u610F
\u5728\u666E\u901A\u65B9\u6CD5\u67E5\u627E\u6761\u4EF6\u4E2D\uFF0C\u5373\u4F7F\u662F\u65E0\u53C2\u7684\u65B9\u6CD5\u4E5F\u9700\u8981\u8BBE\u7F6E\u67E5\u627E\u6761\u4EF6\u3002
\u5047\u8BBE\u6211\u4EEC\u6709\u5982\u4E0B\u7684 Class
\u3002
\u793A\u4F8B\u5982\u4E0B
public class TestFoo {
-
- public void foo(String string) {
- // ...
- }
-
- public void foo() {
- // ...
- }
-}
-
\u6211\u4EEC\u8981\u5F97\u5230\u5176\u4E2D\u7684 public void foo()
\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
TestFoo::class.java.method {
- name = "foo"
-}
-
\u4F46\u662F\uFF0C\u4E0A\u9762\u7684\u4F8B\u5B50\u662F\u9519\u8BEF\u7684\u3002
\u4F60\u4F1A\u53D1\u73B0\u8FD9\u4E2A Class
\u4E2D\u6709\u4E24\u4E2A foo
\u65B9\u6CD5\uFF0C\u5176\u4E2D\u4E00\u4E2A\u5E26\u6709\u65B9\u6CD5\u53C2\u6570\u3002
\u7531\u4E8E\u4E0A\u8FF0\u4F8B\u5B50\u6CA1\u6709\u8BBE\u7F6E param
\u7684\u67E5\u627E\u6761\u4EF6\uFF0C\u5F97\u5230\u7684\u7ED3\u679C\u5C06\u4F1A\u662F\u5339\u914D\u540D\u79F0\u4E14\u5339\u914D\u5B57\u8282\u7801\u987A\u5E8F\u7684\u7B2C\u4E00\u4E2A\u65B9\u6CD5 public void foo(String string)
\uFF0C\u800C\u4E0D\u662F\u6211\u4EEC\u9700\u8981\u7684\u6700\u540E\u4E00\u4E2A\u65B9\u6CD5\u3002
\u8FD9\u662F\u4E00\u4E2A\u7ECF\u5E38\u4F1A\u51FA\u73B0\u7684\u9519\u8BEF\uFF0C\u6CA1\u6709\u65B9\u6CD5\u53C2\u6570\u5C31\u4F1A\u4E22\u5931\u65B9\u6CD5\u53C2\u6570\u67E5\u627E\u6761\u4EF6\u7684\u4F7F\u7528\u95EE\u9898\u3002
\u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u5982\u4E0B\u3002
\u793A\u4F8B\u5982\u4E0B
TestFoo::class.java.method {
- name = "foo"
- // \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\uFF0C\u6DFB\u52A0\u8BE6\u7EC6\u7684\u7B5B\u9009\u6761\u4EF6
- emptyParam()
-}
-
\u81F3\u6B64\uFF0C\u4E0A\u8FF0\u7684\u793A\u4F8B\u5C06\u53EF\u4EE5\u5B8C\u7F8E\u5730\u5339\u914D\u5230 public void foo()
\u65B9\u6CD5\u3002
\u5728\u6784\u9020\u65B9\u6CD5\u67E5\u627E\u6761\u4EF6\u4E2D\uFF0C\u65E0\u53C2\u7684\u6784\u9020\u65B9\u6CD5\u53EF\u4EE5\u4E0D\u9700\u8981\u586B\u5199\u67E5\u627E\u6761\u4EF6\u3002
\u5047\u8BBE\u6211\u4EEC\u6709\u5982\u4E0B\u7684 Class
\u3002
\u793A\u4F8B\u5982\u4E0B
public class TestFoo {
-
- public TestFoo() {
- // ...
- }
-}
-
\u6211\u4EEC\u8981\u5F97\u5230\u5176\u4E2D\u7684 public TestFoo()
\u6784\u9020\u65B9\u6CD5\uFF0C\u53EF\u4EE5\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u3002
\u793A\u4F8B\u5982\u4E0B
TestFoo::class.java.constructor { emptyParam() }
-
\u4E0A\u9762\u7684\u4F8B\u5B50\u53EF\u4EE5\u6210\u529F\u83B7\u53D6\u5230 public TestFoo()
\u6784\u9020\u65B9\u6CD5\uFF0C\u4F46\u662F\u611F\u89C9\u6709\u4E00\u4E9B\u7E41\u7410\u3002
\u4E0E\u666E\u901A\u65B9\u6CD5\u4E0D\u540C\uFF0C\u7531\u4E8E\u6784\u9020\u65B9\u6CD5\u4E0D\u9700\u8981\u8003\u8651 name
\u540D\u79F0\uFF0C\u5F53\u6784\u9020\u65B9\u6CD5\u6CA1\u6709\u53C2\u6570\u7684\u65F6\u5019\uFF0C\u6211\u4EEC\u53EF\u4EE5\u7701\u7565 emptyParam
\u53C2\u6570\u3002
\u793A\u4F8B\u5982\u4E0B
TestFoo::class.java.constructor()
-
\u7279\u522B\u6CE8\u610F
\u5728\u5B57\u8282\u7801\u8C03\u7528\u7ED3\u679C\u4E2D\uFF0Ccast \u65B9\u6CD5\u53EA\u80FD\u6307\u5B9A\u5B57\u8282\u7801\u5BF9\u5E94\u7684\u7C7B\u578B\u3002
\u4F8B\u5982\u6211\u4EEC\u60F3\u5F97\u5230\u4E00\u4E2A Boolean
\u7C7B\u578B\u7684\u53D8\u91CF\uFF0C\u628A\u4ED6\u8F6C\u6362\u4E3A String
\u3002
\u4EE5\u4E0B\u662F\u9519\u8BEF\u7684\u4F7F\u7528\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- name = "test"
- type = BooleanType
-}.get().string() // \u2757\u9519\u8BEF\u7684\u4F7F\u7528\u65B9\u6CD5\uFF0C\u5FC5\u987B cast \u4E3A\u5B57\u8282\u7801\u76EE\u6807\u7C7B\u578B
-
\u4EE5\u4E0B\u662F\u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- name = "test"
- type = BooleanType
-}.get().boolean().toString() // \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\uFF0C\u5F97\u5230\u7C7B\u578B\u540E\u518D\u8FDB\u884C\u8F6C\u6362
-
\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u53D8\u91CF\u7684\u65F6\u5019\u6211\u4EEC\u901A\u5E38\u9700\u8981\u6307\u5B9A\u6240\u67E5\u627E\u7684\u7C7B\u578B\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- name = "test"
- type = Boolean::class.javaPrimitiveType
-}
-
\u5728 Kotlin
\u4E2D\u8868\u8FBE\u51FA Boolean::class.javaPrimitiveType
\u8FD9\u4E2A\u7C7B\u578B\u7684\u5199\u6CD5\u5F88\u957F\uFF0C\u611F\u89C9\u5E76\u4E0D\u65B9\u4FBF\u3002
\u56E0\u6B64\uFF0CYukiReflection
\u4E3A\u5F00\u53D1\u8005\u5C01\u88C5\u4E86\u5E38\u89C1\u7684\u7C7B\u578B\u8C03\u7528\uFF0C\u5176\u4E2D\u5305\u542B\u4E86 Android \u7684\u76F8\u5173\u7C7B\u578B\u548C Java \u7684\u5E38\u89C1\u7C7B\u578B\u4E0E\u539F\u59CB\u7C7B\u578B\u5173\u952E\u5B57\u3002
\u8FD9\u4E2A\u65F6\u5019\u4E0A\u9762\u7684\u7C7B\u578B\u5C31\u53EF\u4EE5\u5199\u4F5C\u5982\u4E0B\u5F62\u5F0F\u4E86\u3002
\u793A\u4F8B\u5982\u4E0B
field {
- name = "test"
- type = BooleanType
-}
-
\u5728 Java \u5E38\u89C1\u7C7B\u578B\u4E2D\u7684\u539F\u59CB\u7C7B\u578B (\u6216\u57FA\u672C\u7C7B\u578B) \u5173\u952E\u5B57\u90FD\u5DF2\u88AB\u5C01\u88C5\u4E3A \u7C7B\u578B + Type \u7684\u65B9\u5F0F\uFF0C\u4F8B\u5982 IntType
\u3001FloatType
(\u5B83\u4EEC\u7684\u5B57\u8282\u7801\u7C7B\u578B\u4E3A int
\u3001float
)\u3002
\u76F8\u5E94\u5730\uFF0C\u6570\u7EC4\u7C7B\u578B\u4E5F\u6709\u65B9\u4FBF\u7684\u4F7F\u7528\u65B9\u6CD5\uFF0C\u5047\u8BBE\u6211\u4EEC\u8981\u83B7\u5F97 String[]
\u7C7B\u578B\u7684\u6570\u7EC4\u3002
\u9700\u8981\u5199\u505A java.lang.reflect.Array.newInstance(String::class.java, 0).javaClass
\u624D\u80FD\u5F97\u5230\u8FD9\u4E2A\u7C7B\u578B\u3002
\u611F\u89C9\u662F\u4E0D\u662F\u5F88\u9EBB\u70E6\uFF0C\u8FD9\u4E2A\u65F6\u5019\u6211\u4EEC\u53EF\u4EE5\u4F7F\u7528\u65B9\u6CD5 ArrayClass(StringClass)
\u6765\u5F97\u5230\u8FD9\u4E2A\u7C7B\u578B\u3002
\u540C\u65F6\u7531\u4E8E String
\u662F\u5E38\u89C1\u7C7B\u578B\uFF0C\u6240\u4EE5\u8FD8\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 StringArrayClass
\u6765\u5F97\u5230\u8FD9\u4E2A\u7C7B\u578B\u3002
\u4E00\u4E9B\u5E38\u89C1\u9700\u6C42\u4E2D\u67E5\u627E\u7684\u65B9\u6CD5\uFF0C\u90FD\u6709\u5176\u5BF9\u5E94\u7684\u5C01\u88C5\u7C7B\u578B\u4EE5\u4F9B\u4F7F\u7528\uFF0C\u683C\u5F0F\u4E3A \u7C7B\u578B + Class\u3002
\u4EE5\u4E0B\u662F Java \u4E2D\u4E00\u4E9B\u7279\u4F8B\u7C7B\u578B\u5728 YukiReflection
\u4E2D\u7684\u5C01\u88C5\u540D\u79F0\u3002
void
\u2192 UnitType
java.lang.Void
\u2192 UnitClass
java.lang.Object
\u2192 AnyClass
java.lang.Integer
\u2192 IntClass
java.lang.Character
\u2192 CharClass
\u6CE8\u610F
\u4EE5 \u7C7B\u578B + Type \u5C01\u88C5\u7C7B\u578B\u4F1A\u4E14\u4EC5\u4F1A\u8868\u793A\u4E3A Java \u539F\u59CB\u7C7B\u578B\u5173\u952E\u5B57\uFF0C\u7531\u4E8E Kotlin \u4E2D\u4E0D\u5B58\u5728\u539F\u59CB\u7C7B\u578B\u8FD9\u4E2A\u6982\u5FF5\uFF0C\u6240\u4EE5\u5B83\u4EEC\u90FD\u4F1A\u88AB\u5B9A\u4E49\u4E3A KClass\u3002
Java \u4E2D\u5171\u6709 9 \u4E2A\u539F\u59CB\u7C7B\u578B\u5173\u952E\u5B57\uFF0C\u5176\u4E2D 8 \u4E2A\u4E3A\u539F\u59CB\u7C7B\u578B\uFF0C\u5206\u522B\u4E3A boolean\u3001char\u3001byte\u3001short\u3001int\u3001float\u3001long\u3001double\uFF0C\u5176\u4E2D void \u7C7B\u578B\u662F\u4E00\u4E2A\u7279\u4F8B\u3002
\u540C\u65F6\u5B83\u4EEC\u90FD\u6709 Java \u81EA\u8EAB\u5BF9\u5E94\u7684\u5C01\u88C5\u7C7B\u578B\uFF0C\u4F8B\u5982 java.lang.Boolean\u3001java.lang.Integer\uFF0C\u8FD9\u4E9B\u7C7B\u578B\u662F\u4E0D\u76F8\u7B49\u7684\uFF0C\u8BF7\u6CE8\u610F\u533A\u5206\u3002
\u540C\u6837\u5730\uFF0C\u6570\u7EC4\u4E5F\u6709\u5BF9\u5E94\u7684\u5C01\u88C5\u7C7B\u578B\uFF0C\u5B83\u4EEC\u4E5F\u9700\u8981\u4E0E Java \u539F\u59CB\u7C7B\u578B\u5173\u952E\u5B57 \u8FDB\u884C\u533A\u5206\u3002
\u4F8B\u5982 byte[] \u7684\u5C01\u88C5\u7C7B\u578B\u4E3A ByteArrayType \u6216 ArrayClass(ByteType)\uFF0C\u800C Byte[] \u7684\u5C01\u88C5\u7C7B\u578B\u4E3A ByteArrayClass \u6216 ArrayClass(ByteClass)\uFF0C\u8FD9\u4E9B\u7C7B\u578B\u4E5F\u662F\u4E0D\u76F8\u7B49\u7684\u3002
\u5C0F\u63D0\u793A
\u66F4\u591A\u7C7B\u578B\u53EF\u67E5\u770B ComponentTypeFactory\u3001GraphicsTypeFactory\u3001ViewTypeFactory\u3001VariableTypeFactory\u3002
\u540C\u65F6\uFF0C\u6B22\u8FCE\u4F60\u80FD\u8D21\u732E\u66F4\u591A\u7684\u5E38\u7528\u7C7B\u578B\u3002
`,327);function f(T,x){const p=l("Badge"),o=l("ExternalLinkIcon");return r(),t("div",null,[d,s("h3",y,[A,u,e(p,{type:"tip",text:"Beta",vertical:"middle"})]),v,s("div",C,[D,B,s("p",null,[m,s("a",b,[F,e(o)]),g,k,h])]),q])}const P=c(i,[["render",f],["__file","features.html.vue"]]);export{P as default}; diff --git a/docs/assets/future.html.18e105a7.js b/docs/assets/future.html.18e105a7.js deleted file mode 100644 index d0f5f5e..0000000 --- a/docs/assets/future.html.18e105a7.js +++ /dev/null @@ -1,60 +0,0 @@ -import{_ as s,o as n,c as a,a as l}from"./app.2add9aa5.js";const p={},o=l(`\u672A\u6765\u662F\u7F8E\u597D\u7684\uFF0C\u4E5F\u662F\u4E0D\u786E\u5B9A\u7684\uFF0C\u8BA9\u6211\u4EEC\u5171\u540C\u671F\u5F85
YukiReflection
\u5728\u672A\u6765\u7684\u53D1\u5C55\u7A7A\u95F4\u3002
\u8FD9\u91CC\u6536\u5F55\u4E86
YukiReflection
\u53EF\u80FD\u4F1A\u5728\u540E\u671F\u6DFB\u52A0\u7684\u529F\u80FD\u3002
\u4F7F\u7528 stub
\u7684\u65B9\u5F0F\u521B\u5EFA\u4E00\u4E2A Kotlin
\u7C7B\uFF0C\u5E76\u58F0\u660E\u5176\u4E2D\u7684\u53C2\u6570\uFF0C\u4EE5\u53CA\u5176\u5728\u5404\u4E2A\u7248\u672C\u4E2D\u7684\u4E0D\u540C\u72B6\u6001\u3002
\u6BD4\u5982\u4E0B\u9762\u7684\u8FD9\u4E2A Java
\u7C7B\u5C31\u662F\u6211\u4EEC\u9700\u8981\u53CD\u5C04\u7684\u76EE\u6807\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
package com.example.test;
-
-public class MyClass {
-
- private String myField = "test";
-
- public MyClass() {
- // ...
- }
-
- private String myMethod1(String var1, int var2) {
- // ...
- }
-
- private void myMethod2() {
- // ...
- }
-
- private void myMethod3(String var1) {
- // ...
- }
-}
-
\u901A\u8FC7\u76EE\u524D API \u7684\u73B0\u6709\u7528\u6CD5\u53EF\u4EE5\u4F7F\u7528\u5982\u4E0B\u65B9\u5F0F\u53CD\u5C04\u8C03\u7528\u8FD9\u4E2A\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
classOf<MyClass>().buildOf().current {
- // \u8C03\u7528 myField
- val value = field { name = "myField" }.string()
- // \u8C03\u7528 myMethod1
- val methodValue = method { name = "myMethod1" }.string("test", 0)
- // \u8C03\u7528 myMethod2
- method { name = "myMethod2" }.call()
- // \u8C03\u7528 myMethod3
- method { name = "myMethod3" }.call("test")
-}
-
\u76EE\u524D\u8981\u5B9E\u73B0\u7684\u529F\u80FD\u662F\u53EF\u4EE5\u4F7F\u7528\u53CD\u5C04\u529F\u80FD\u76F4\u63A5\u5B9A\u4E49\u4E3A\u5982\u4E0B Kotlin
\u7C7B\u3002
\u793A\u4F8B\u5982\u4E0B
package com.example.test
-
-@ReflectClass
-class MyClass {
-
- @ReflectField
- val myField: String = fieldValueOf("none")
-
- @ReflectMethod
- fun myMethod1(var1: String, var2: Int): String = methodReturnValueOf("none")
-
- @ReflectMethod
- fun myMethod2() = MethodReturnType.Unit
-
- @ReflectMethod
- fun myMethod3(var1: String) = MethodReturnType.Unit
-}
-
\u7136\u540E\u6211\u4EEC\u5C31\u53EF\u4EE5\u76F4\u63A5\u8C03\u7528\u8FD9\u4E2A\u5B9A\u4E49\u597D\u7684 Kotlin
\u7C7B\u6765\u5B9E\u73B0\u53CD\u5C04\u529F\u80FD\uFF0CAPI \u4F1A\u6839\u636E\u6CE8\u89E3\u81EA\u52A8\u751F\u6210\u53CD\u5C04\u4EE3\u7801\u3002
\u793A\u4F8B\u5982\u4E0B
MyClass().also {
- // \u8C03\u7528 myField
- val value = it.myField
- // \u8C03\u7528 myMethod1
- val methodValue = it.myMethod1("test", 0)
- // \u8C03\u7528 myMethod2
- it.myMethod2()
- // \u8C03\u7528 myMethod3
- it.myMethod3("test")
-}
-
\u5C0F\u63D0\u793A
\u4EE5\u4E0A\u529F\u80FD\u53EF\u80FD\u4F1A\u5728\u5B9E\u9645\u63A8\u51FA\u540E\u6709\u6240\u53D8\u5316\uFF0C\u6700\u7EC8\u4EE5\u5B9E\u9645\u7248\u672C\u7684\u529F\u80FD\u4E3A\u51C6\u3002
The future is bright and uncertain, let us look forward to the future development space of
YukiReflection
.
Features that
YukiReflection
may add later are included here.
Use stub
to create a Kotlin
class, and declare the parameters in it, as well as its different states in each version.
For example, the Java
class below is the target class we need to reflect.
The following example
package com.example.test;
-
-public class MyClass {
-
- private String myField = "test";
-
- public MyClass() {
- //...
- }
-
- private String myMethod1(String var1, int var2) {
- //...
- }
-
- private void myMethod2() {
- //...
- }
-
- private void myMethod3(String var1) {
- //...
- }
-}
-
Through the existing usage of the current API, this class can be called reflectively in the following way.
The following example
classOf<MyClass>().buildOf().current {
- // Call myField
- val value = field { name = "myField" }.string()
- // Call myMethod1
- val methodValue = method { name = "myMethod1" }.string("test", 0)
- // Call myMethod2
- method { name = "myMethod2" }.call()
- // Call myMethod3
- method { name = "myMethod3" }.call("test")
-}
-
The function to be implemented at present can be directly defined as the following Kotlin
class using the reflection function.
The following example
package com.example.test
-
-@ReflectClass
-class MyClass {
-
- @ReflectField
- val myField: String = fieldValueOf("none")
-
- @ReflectMethod
- fun myMethod1(var1: String, var2: Int): String = methodReturnValueOf("none")
-
- @ReflectMethod
- fun myMethod2() = MethodReturnType.Unit
-
- @ReflectMethod
- fun myMethod3(var1: String) = MethodReturnType.Unit
-}
-
Then we can directly call this defined Kotlin
class to implement the reflection function, and the API will automatically generate the reflection code according to the annotation.
The following example
MyClass().also {
- // Call myField
- val value = it.myField
- // Call myMethod1
- val methodValue = it.myMethod1("test", 0)
- // Call myMethod2
- it.myMethod2()
- // Call myMethod3
- it.myMethod3("test")
-}
-
Tips
The above functions may change after the actual release, and the functions of the actual version shall prevail.
The document here will synchronize the relevant usage of the latest API version, please keep
YukiReflection
as the latest version to use the latest version of the function.
The function description mainly introduces the related usage and purpose of the current API.
The function examples mainly show the basic usage examples of the current API for reference.
The function of the first version will be marked as v<version>
first
;
New function added later will be marked as v<version>
added
;
Later modified function will be appended as v<version>
modified
;
Later deprecated function will be marked as v<version>
deprecated
and strikethrough;
Later removed function will be marked as v<version>
removed
and strikethrough.
kt \xA0Kotlin Static File
annotation \xA0Annotation Class
interface \xA0Interface Class
object \xA0Class (Singleton)
class \xA0Class
field \xA0Field or get
/ set
method or read-only get
method
method \xA0Method
enum \xA0Enum constant
ext-field \xA0Extension field (global)
ext-method \xA0Extension method (global)
i-ext-field \xA0Extension field (internal)
i-ext-method \xA0Extension method (internal)
\u8FD9\u91CC\u7684\u6587\u6863\u5C06\u540C\u6B65\u6700\u65B0 API \u7248\u672C\u7684\u76F8\u5173\u7528\u6CD5\uFF0C\u8BF7\u4FDD\u6301
YukiReflection
\u4E3A\u6700\u65B0\u7248\u672C\u4EE5\u4F7F\u7528\u6700\u65B0\u7248\u672C\u7684\u529F\u80FD\u3002
\u529F\u80FD\u63CF\u8FF0\u4E3B\u8981\u4ECB\u7ECD\u5F53\u524D API \u7684\u76F8\u5173\u7528\u6CD5\u548C\u7528\u9014\u3002
\u529F\u80FD\u793A\u4F8B\u4E3B\u8981\u5C55\u793A\u4E86\u5F53\u524D API \u7684\u57FA\u672C\u7528\u6CD5\u793A\u4F8B\uFF0C\u53EF\u4F9B\u53C2\u8003\u3002
\u9996\u4E2A\u7248\u672C\u7684\u529F\u80FD\u5C06\u6807\u8BB0\u4E3A v<version>
\u6DFB\u52A0
\uFF1B
\u540E\u671F\u65B0\u589E\u52A0\u7684\u529F\u80FD\u5C06\u6807\u8BB0\u4E3A v<version>
\u65B0\u589E
\uFF1B
\u540E\u671F\u4FEE\u6539\u7684\u529F\u80FD\u5C06\u88AB\u8FFD\u52A0\u4E3A v<version>
\u4FEE\u6539
\uFF1B
\u540E\u671F\u88AB\u4F5C\u5E9F\u7684\u529F\u80FD\u5C06\u6807\u8BB0\u4E3A v<version>
\u4F5C\u5E9F
\u5E76\u4F1A\u6807\u6CE8\u5220\u9664\u7EBF\uFF1B
\u540E\u671F\u88AB\u5220\u9664\u7684\u529F\u80FD\u5C06\u6807\u8BB0\u4E3A v<version>
\u79FB\u9664
\u5E76\u4F1A\u6807\u6CE8\u5220\u9664\u7EBF\u3002
kt \xA0Kotlin Static File
annotation \xA0\u6CE8\u89E3
interface \xA0\u63A5\u53E3
object \xA0\u7C7B (\u5355\u4F8B)
class \xA0\u7C7B
field \xA0\u53D8\u91CF\u6216 get
\u3001set
\u65B9\u6CD5\u6216\u53EA\u8BFB\u7684 get
\u65B9\u6CD5
method \xA0\u65B9\u6CD5
enum \xA0Enum \u5E38\u91CF
ext-field \xA0\u6269\u5C55\u7684\u53D8\u91CF (\u5168\u5C40)
ext-method \xA0\u6269\u5C55\u7684\u65B9\u6CD5 (\u5168\u5C40)
i-ext-field \xA0\u6269\u5C55\u7684\u53D8\u91CF (\u8C03\u7528\u57DF\u9650\u5236)
i-ext-method \xA0\u6269\u5C55\u7684\u65B9\u6CD5 (\u8C03\u7528\u57DF\u9650\u5236)
YukiReflection
\u662F\u4E00\u4E2A\u57FA\u4E8E Java \u548C Android \u5E73\u53F0\u7684\u53CD\u5C04 API\u3002
\u8FD9\u662F\u4E00\u4E2A\u4F7F\u7528 Kotlin
\u57FA\u4E8E Java
\u539F\u751F\u53CD\u5C04 API \u91CD\u65B0\u6253\u9020\u7684\u4E00\u5957\u7B80\u6D01\u3001\u9AD8\u6548\u7684\u53CD\u5C04 API\u3002
\u8BF7\u4F7F\u7528 Kotlin
\uFF0CAPI \u90E8\u5206\u4EE3\u7801\u6784\u6210\u540C\u6837\u517C\u5BB9 Java
\u4F46\u57FA\u7840\u53CD\u5C04\u573A\u666F\u7684\u5B9E\u73B0\u53EF\u80FD\u5B8C\u5168\u65E0\u6CD5\u4F7F\u7528\u3002
\u6587\u6863\u5168\u90E8\u7684 Demo \u793A\u4F8B\u4EE3\u7801\u90FD\u5C06\u4F7F\u7528 Kotlin
\u8FDB\u884C\u63CF\u8FF0\uFF0C\u5982\u679C\u4F60\u5B8C\u5168\u4E0D\u4F1A\u4F7F\u7528 Kotlin
\u90A3\u4F60\u5C06\u6709\u53EF\u80FD\u65E0\u6CD5\u4F7F\u7528 YukiReflection
\u3002
YukiReflection
is a Reflection API based on the Java and Android platform.
This is a set of simple and efficient Reflection API rebuilt based on Java
native Reflection API using Kotlin
.
Please use Kotlin
, the code composition of the API part is also compatible with Java
, but the implementation of the basic reflection scene may not be used at all.
All Demo sample codes in the document will be described using Kotlin
, if you don\u2019t know how to use Kotlin
at all, you may not be able to use YukiReflection
.
public class World {
-
- private void sayHello(String content) {
- System.out.println("Hello " + content + "!");
- }
-}
-
val newWorld = World()
-classOf<World>().method {
- name = "sayHello"
- param(StringClass)
- type = UnitType
-}.get(newWorld).call("YukiReflection")
-
public class World {
-
- private void sayHello(String content) {
- System.out.println("Hello " + content + "!");
- }
-}
-
val newWorld = World()
-classOf<World>().method {
- name = "sayHello"
- param(StringClass)
- type = UnitType
-}.get(newWorld).call("YukiReflection")
-
\u96C6\u6210
YukiReflection
\u5230\u4F60\u7684\u9879\u76EE\u4E2D\u3002
Windows 7 \u53CA\u4EE5\u4E0A/macOS 10.14 \u53CA\u4EE5\u4E0A/Linux \u53D1\u884C\u7248 (Arch/Debian)
Android Studio 2021.1 \u53CA\u4EE5\u4E0A
IntelliJ IDEA 2021.1 \u53CA\u4EE5\u4E0A
Kotlin 1.7.0 \u53CA\u4EE5\u4E0A
Android Gradle Plugin 7.0 \u53CA\u4EE5\u4E0A
Gradle 7.0 \u53CA\u4EE5\u4E0A
Java 11 \u53CA\u4EE5\u4E0A
\u9879\u76EE\u9700\u8981\u4F7F\u7528 Android Studio
\u6216 IntelliJ IDEA
\u521B\u5EFA\u4E14\u7C7B\u578B\u4E3A Java \u6216 Android \u9879\u76EE\u5E76\u5DF2\u96C6\u6210 Kotlin
\u73AF\u5883\u4F9D\u8D56\u3002
\u5728\u4F60\u7684\u9879\u76EE SweetDependency
\u914D\u7F6E\u6587\u4EF6\u4E2D\u6DFB\u52A0\u5B58\u50A8\u5E93\u548C\u4F9D\u8D56\u3002
\u793A\u4F8B\u5982\u4E0B
repositories:
- # MavenCentral \u6709 2 \u5C0F\u65F6\u7F13\u5B58\uFF0C\u82E5\u65E0\u6CD5\u96C6\u6210\u6700\u65B0\u7248\u672C\u8BF7\u6DFB\u52A0
- sonatype-oss-releases:
-
-libraries:
- com.highcapable.yukireflection:
- api:
- version: +
- ...
-
\u6DFB\u52A0\u5B8C\u6210\u540E\u8FD0\u884C\u4E00\u6B21 Gradle Sync\uFF0C\u6240\u6709\u4F9D\u8D56\u7248\u672C\u5C06\u81EA\u52A8\u88C5\u914D\u3002
\u63A5\u4E0B\u6765\uFF0C\u5728\u4F60\u7684\u9879\u76EE build.gradle.kts
\u4E2D\u90E8\u7F72\u4F9D\u8D56\u3002
\u793A\u4F8B\u5982\u4E0B
dependencies {
- implementation(com.highcapable.yukireflection.api)
- // ...
-}
-
\u5728\u4F60\u7684\u9879\u76EE build.gradle.kts
\u6216 build.gradle
\u4E2D\u6DFB\u52A0\u5B58\u50A8\u5E93\u3002
Kotlin DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral \u6709 2 \u5C0F\u65F6\u7F13\u5B58\uFF0C\u82E5\u65E0\u6CD5\u96C6\u6210\u6700\u65B0\u7248\u672C\u8BF7\u6DFB\u52A0\u6B64\u5730\u5740
- maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
-}
-
Groovy DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral \u6709 2 \u5C0F\u65F6\u7F13\u5B58\uFF0C\u82E5\u65E0\u6CD5\u96C6\u6210\u6700\u65B0\u7248\u672C\u8BF7\u6DFB\u52A0\u6B64\u5730\u5740
- maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
-}
-
\u5728\u4F60\u7684\u9879\u76EE build.gradle.kts
\u6216 build.gradle
\u4E2D\u6DFB\u52A0\u4F9D\u8D56\u3002
Kotlin DSL
dependencies {
- implementation("com.highcapable.yukireflection:api:<yuki-version>")
- // ...
-}
-
Groovy DSL
dependencies {
- implementation 'com.highcapable.yukireflection:api:<yuki-version>'
- // ...
-}
-
\u8BF7\u5C06 <yuki-version> \u4FEE\u6539\u4E3A \u8FD9\u91CC \u7684\u6700\u65B0\u7248\u672C\u3002
`,20),b={class:"custom-container danger"},m=s("p",{class:"custom-container-title"},"\u7279\u522B\u6CE8\u610F",-1),h=n("\u5982\u679C\u4F60\u7684\u9879\u76EE\u76EE\u524D\u6B63\u5728\u4F7F\u7528 "),D={href:"https://github.com/fankes/YukiHookAPI",target:"_blank",rel:"noopener noreferrer"},k=n("YukiHookAPI"),C=n(" \u7684 1.x.x \u7248\u672C\uFF0C\u8BF7\u4E0D\u8981\u91CD\u590D\u96C6\u6210 "),B=s("strong",null,"YukiReflection",-1),g=n("\uFF0C\u56E0\u4E3A "),_=s("strong",null,"YukiHookAPI",-1),f=n(" \u5DF2\u7ECF\u5305\u542B\u4E86\u5176\u4E2D\u7684\u529F\u80FD\u4E14\u5B58\u5728\u9488\u5BF9\u76F8\u5173\u529F\u80FD\u7684\u6539\u52A8\uFF0C\u91CD\u590D\u96C6\u6210\u4F1A\u9020\u6210\u529F\u80FD\u6027\u51B2\u7A81\u5F15\u53D1\u5F02\u5E38\uFF0C\u6B64\u65F6\u4F60\u5E94\u8BE5\u524D\u5F80 "),F=s("strong",null,"YukiHookAPI",-1),q=n(" \u7684 "),x={href:"https://fankes.github.io/YukiHookAPI/zh-cn/",target:"_blank",rel:"noopener noreferrer"},S=n("\u6587\u6863"),I=n(" \u67E5\u770B\u5BF9\u5E94\u7684\u4F7F\u7528\u6559\u7A0B\u3002"),V=s("p",null,[s("strong",null,"YukiHookAPI"),n(" \u5C06\u5728 2.x.x \u7248\u672C\u5B8C\u5168\u5206\u79BB "),s("strong",null,"YukiReflection"),n("\uFF0C\u5C4A\u65F6\u4F60\u53EF\u4EE5\u540C\u65F6\u4E0E "),s("strong",null,"YukiHookAPI"),n(" \u4F7F\u7528\u3002")],-1),J=l(`\u5728\u4F60\u7684\u9879\u76EE build.gradle.kts
\u6216 build.gradle
\u4E2D\u4FEE\u6539 Kotlin \u7684 Java \u7248\u672C\u4E3A 11 \u53CA\u4EE5\u4E0A\u3002
Kotlin DSL
android {
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = "11"
- }
-}
-
Groovy DSL
android {
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = '11'
- }
-}
-
Integrate
YukiReflection
into your project.
Windows 7 and above / macOS 10.14 and above / Linux distributions (Arch/Debian)
Android Studio 2021.1 and above
IntelliJ IDEA 2021.1 and above
Kotlin 1.7.0 and above
Android Gradle Plugin 7.0 and above
Gradle 7.0 and above
Java 11 and above
The project needs to be created using Android Studio
or IntelliJ IDEA
and the type is an Java or Android project and the Kotlin
environment dependency has been integrated.
Add the repositories and dependencies in your project's SweetDependency
configuration file.
The following example
repositories:
- # MavenCentral has a 2-hour cache,
- # if the latest version cannot be integrated, please add this
- sonatype-oss-releases:
-
-libraries:
- com.highcapable.yukireflection:
- api:
- version: +
- ...
-
After adding it, run Gradle Sync and all dependencies will be autowired.
Next, deploy dependencies in your project build.gradle.kts
.
The following example
dependencies {
- implementation(com.highcapable.yukireflection.api)
- // ...
-}
-
Add repositories in your project build.gradle.kts
or build.gradle
.
Kotlin DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL
- maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
-}
-
Groovy DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL
- maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
-}
-
Add dependencies in your project build.gradle.kts
or build.gradle
.
Kotlin DSL
dependencies {
- implementation("com.highcapable.yukireflection:api:<yuki-version>")
- // ...
-}
-
Groovy DSL
dependencies {
- implementation 'com.highcapable.yukireflection:api:<yuki-version>'
- // ...
-}
-
Please change <yuki-version> to the latest version here.
`,20),b={class:"custom-container danger"},A=s("p",{class:"custom-container-title"},"Pay Attention",-1),m=e("If your project is currently using the 1.x.x version of "),D={href:"https://github.com/fankes/YukiHookAPI",target:"_blank",rel:"noopener noreferrer"},g=e("YukiHookAPI"),k=e(", please do not integrate "),C=s("strong",null,"YukiReflection",-1),B=e(" repeatedly, because "),_=s("strong",null,"YukiHookAPI",-1),f=e(" already includes it functions and there are changes to related functions."),q=s("p",null,"Repeated integration will cause functional conflicts and cause exceptions.",-1),x=e("In this case, you should go to the "),F={href:"https://fankes.github.io/YukiHookAPI/zh-cn/",target:"_blank",rel:"noopener noreferrer"},S=e("Documentation"),I=e(" of "),j=s("strong",null,"YukiHookAPI",-1),w=e(" view the corresponding usage tutorial."),R=s("p",null,[s("strong",null,"YukiHookAPI"),e(" will be completely separated from "),s("strong",null,"YukiReflection"),e(" in version 2.x.x, by which time you can use it with "),s("strong",null,"YukiHookAPI"),e(" at the same time.")],-1),V=l(`Modify the Java version of Kotlin in your project build.gradle.kts
or build.gradle
to 11 or above.
Kotlin DSL
android {
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = "11"
- }
-}
-
Groovy DSL
android {
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = '11'
- }
-}
-
This document is powered by VuePress.
MIT License
-
-Copyright (C) 2019-2023 HighCapable
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
Copyright © 2019-2023 HighCapable
The version update history of
YukiReflection
is recorded here.
Pay Attention
We will only maintain the latest API version, if you are using an outdate API version, you voluntarily renounce any possibility of maintenance.
Notice
To avoid translation time consumption, Changelog will use Google Translation from Chinese to English, please refer to the original text for actual reference.
Time zone of version release date: UTC+8
Member
cache did not take effect and persistent storage eventually caused app out of memory (OOM), thanks to Art-ChenMember
and deprecated YukiReflection.Configs.isEnableMemberCache
Class
Sequence
, optimize the finding speed and performance of Member
Class
object declaration in Android type
If you have any questions in use, or have any constructive suggestions, you can contact us.
Join us Click to join Telegram group, Click to join Telegram group (Developer).
Find me on Twitter @fankesyooni.
Thank you for choosing and using YukiReflection
.
If you have code-related suggestions and requests, you can submit a Pull Request on GitHub.
The future is bright and uncertain, let us look forward to the future development space of
YukiReflection
.
Features that
YukiReflection
may add later are included here.
Use stub
to create a Kotlin
class, and declare the parameters in it, as well as its different states in each version.
For example, the Java
class below is the target class we need to reflect.
The following example
package com.example.test;
-
-public class MyClass {
-
- private String myField = "test";
-
- public MyClass() {
- //...
- }
-
- private String myMethod1(String var1, int var2) {
- //...
- }
-
- private void myMethod2() {
- //...
- }
-
- private void myMethod3(String var1) {
- //...
- }
-}
-
Through the existing usage of the current API, this class can be called reflectively in the following way.
The following example
classOf<MyClass>().buildOf().current {
- // Call myField
- val value = field { name = "myField" }.string()
- // Call myMethod1
- val methodValue = method { name = "myMethod1" }.string("test", 0)
- // Call myMethod2
- method { name = "myMethod2" }.call()
- // Call myMethod3
- method { name = "myMethod3" }.call("test")
-}
-
The function to be implemented at present can be directly defined as the following Kotlin
class using the reflection function.
The following example
package com.example.test
-
-@ReflectClass
-class MyClass {
-
- @ReflectField
- val myField: String = fieldValueOf("none")
-
- @ReflectMethod
- fun myMethod1(var1: String, var2: Int): String = methodReturnValueOf("none")
-
- @ReflectMethod
- fun myMethod2() = MethodReturnType.Unit
-
- @ReflectMethod
- fun myMethod3(var1: String) = MethodReturnType.Unit
-}
-
Then we can directly call this defined Kotlin
class to implement the reflection function, and the API will automatically generate the reflection code according to the annotation.
The following example
MyClass().also {
- // Call myField
- val value = it.myField
- // Call myMethod1
- val methodValue = it.myMethod1("test", 0)
- // Call myMethod2
- it.myMethod2()
- // Call myMethod3
- it.myMethod3("test")
-}
-
Tips
The above functions may change after the actual release, and the functions of the actual version shall prevail.
This page contains usage examples for all core features of
YukiReflection
.
Here are the extension functions related to the Class object itself.
Suppose we want to get a Class
that cannot be called directly.
Normally, we can use the standard reflection API to find this Class
.
The following example
// Class in the default ClassLoader environment
-var instance = Class.forName("com.demo.Test")
-// Specify the Class in the ClassLoader environment
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var instance = customClassLoader?.loadClass("com.demo.Test")
-
This is probably not very friendly, and YukiReflection
provides you with a syntactic sugar that can be used anywhere.
The above writing can be written as YukiReflection
as follows.
The following example
// Get this Class directly
-var instance = "com.demo.Test".toClass()
-// ClassLoader where the custom Class is located
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var instance = "com.demo.Test".toClass(customClassLoader)
-
If the current Class
does not exist, using the above method will throw an exception.
If you are not sure whether the Class
exists, you can refer to the following solutions.
The following example
// Get this Class directly
-// If not available, the result will be null but no exception will be thrown
-var instance = "com.demo.Test".toClassOrNull()
-// ClassLoader where the custom Class is located
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-// If not available, the result will be null but no exception will be thrown
-var instance = "com.demo.Test".toClassOrNull(customClassLoader)
-
We can also get an existing Class
object by mapping.
The following example
// Assume this Class can be obtained directly
-var instance = classOf<Test>()
-// We can also customize the ClassLoader where the Class is located, which is very effective for stubs
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var instance = classOf<Test>(customClassLoader)
-
Tips
For more functions, please refer to classOf, String.toClass, String.toClassOrNull methods.
Suppose we want to determine whether a Class
exists.
Usually, we can use the standard reflection API to find this Class
to determine whether it exists by exception.
The following example
// Class in the default ClassLoader environment
-var isExist = try {
- Class.forName("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-// Specify the Class in the ClassLoader environment
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var isExist = try {
- customClassLoader?.loadClass("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-
This is probably not very friendly, and YukiReflection
provides you with a syntactic sugar that can be used anywhere.
The above writing can be written as YukiReflection
as follows.
The following example
// Check if this class exists
-var isExist = "com.demo.Test".hasClass()
-// ClassLoader where the custom Class is located
-val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-var isExist = "com.demo.Test".hasClass(customClassLoader)
-
Tips
For more functions, please refer to String.hasClass method.
The Class
name in the current app's Dex after being obfuscated by tools such as R8 will be difficult to distinguish.
Its correct position is uncertain, and cannot be obtained directly through Object Conversion.
At this point, there is DexClassFinder
, its role is to determine the instance of this Class
by the bytecode features in the Class
that need to be searched.
Notice
This feature is only available on the Android platform.
At present, the function of DexClassFinder is still in the experimental stage.
Since the search function is only implemented through the Java layer, the performance may not reach the optimal level when there are too many current app's Class.
If something got wrong welcome to feedback.
Since it is a reflection-level API, currently it can only locate the specified Class through the characteristics of Class and Member, and cannot locate it by specifying the string and method content characteristics in the bytecode.
The speed of searching Class depends on the performance of the current device.
At present, the mainstream mobile processors are in the 3~10s range when the conditions are not complicated in the 10~15w number of Class, the fastest speed can reach within 25s under slightly complex conditions.
Please note that the more the same type Class is matched, the slower the speed.
Pay Attention
After YukiHookAPI 2.x.x released, this function will be deprecated and will be removed directly from YukiReflection.
We welcome all developers to start using DexKit, which is a high-performance runtime parsing library for Dex implemented in C++, which is more efficient than the Java layer in terms of performance, efficient and excellent, it is still in the development stage, your valuable suggestions are welcome.
Below is a simple usage example.
Suppose the following Class
is what we want, the names are obfuscated and may be different in each version.
The following example
package com.demo;
-
-public class a extends Activity implements Serializable {
-
- public a(String var1) {
- // ...
- }
-
- private String a;
-
- private String b;
-
- private boolean a;
-
- protected void onCreate(Bundle var1) {
- // ...
- }
-
- private static void a(String var1) {
- // ...
- }
-
- private String a(boolean var1, String var2) {
- // ...
- }
-
- private void a() {
- // ...
- }
-
- public void a(boolean var1, a var2, b var3, String var4) {
- // ...
- }
-}
-
At this point, we want to get this Class
, you can use the ClassLoader.searchClass
method directly.
Each of the conditions demonstrated below is optional, and the more complex the conditions, the more accurate the positioning and the worse the performance.
The following example
searchClass {
- // Start the search from the specified package name range
- // In actual use, you can specify multiple package name ranges at the same time
- from("com.demo")
- // Specify the result of getSimpleName of the current Class
- // You can directly make logical judgments on this string
- // Here we are not sure whether its name is a, we can only judge the length of the string
- simpleName { it.length == 1 }
- // Specify the inherited parent class object
- // If it is an existing stub, it can be directly represented by generics
- extends<Activity>()
- // Specify the inherited parent class object
- // Which can be written directly as the full class name
- // And you can also specify multiple objects at the same time
- extends("android.app.Activity")
- // Specify the implemented interface
- // If it exists stub, can be directly represented by generics
- implements<Serializable>()
- // Specify the implemented interface
- // Which can be written directly as a full class name, or you can specify multiple at the same time
- implements("java.io.Serializable")
- // Specify the type and style of the constructor
- // And the number count that exists in the current class
- constructor { param(StringClass) }.count(num = 1)
- // Specify the type and style of the variable
- // And the number that exists in the current class count
- field { type = StringClass }.count(num = 2)
- // Specify the type and style of the variable
- // And the number that exists in the current class count
- field { type = BooleanType }.count(num = 1)
- // Directly specify the number of all variables that exist in the current class count
- field().count(num = 3)
- // If you think the number of variables is indeterminate
- // You can also use the following custom conditions
- field().count(1..3)
- field().count { it >= 3 }
- // Specify the type and style of the method
- // And the number that exists in the current class count
- method {
- name = "onCreate"
- param(BundleClass)
- }.count(num = 1)
- // Specify the type and style of the method
- // Specify the modifier, and the number count in the current class
- method {
- modifiers { isStatic && isPrivate }
- param(StringClass)
- returnType = UnitType
- }.count(num = 1)
- // Specify the type and style of the method
- // Specify the modifier, and the number count in the current class
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, StringClass)
- returnType = StringClass
- }.count(num = 1)
- // Specify the type and style of the method
- // Specify the modifier, and the number count in the current class
- method {
- modifiers { isPrivate && isStatic.not() }
- emptyParam()
- returnType = UnitType
- }.count(num = 1)
- // Specify the type and style of the method
- // As well as the modifier and VagueType
- // And the number count that exists in the current class
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, VagueType, VagueType, StringClass)
- returnType = UnitType
- }.count(num = 1)
- // Directly specify the number of all methods that exist in the current class count
- method().count(num = 5)
- // If you think the number of methods is uncertain, you can also use the following custom conditions
- method().count(1..5)
- method().count { it >= 5 }
- // Directly specify the number of all members existing in the current class count
- // Members include: Field, Method, Constructor
- member().count(num = 9)
- // There must be a static modifier in all members, you can add this condition like this
- member {
- modifiers { isStatic }
- }
-}.get() // Get the instance of this Class itself, if not found, it will return null
-
Tips
The conditional usage of Field, Method, Constructor in the above usage is consistent with the related usage in Member Extensions, with only minor differences.
For more functions, please refer to MemberRules, FieldRules, MethodRules, ConstructorRules.
By default, DexClassFinder
will use synchronous mode to search Class
, which will block the current thread until it finds or finds an exception.
If the search takes too long, it may cause ANR problems to the current app.
In response to the above problems, we can enable asynchronous, just add the parameter async = true
, which will not require you to start a thread again, the API has already handled the related problems for you.
Notice
To use this function, you need to pass in the Context of the current app as the first method parameter.
For the asynchronous case you need to use the wait method to get the result, the get method will no longer work.
The following example
val context: Context // Assume this is the Context of the current app
-searchClass(context, async = true) {
- // ...
-}.wait { class1 ->
- // Get asynchronous result
-}
-searchClass(context, async = true) {
- // ...
-}.wait { class2 ->
- // Get asynchronous result
-}
-
In this way, our search process runs asynchronously, it will not block the main thread, and each search will be performed in a separate thread at the same time, which can achieve the effect of parallel tasks.
Since the search is performed again every time the current app is reopened, this is a waste of repetitive performance when the current app's version is unchanged.
At this point, we can locally cache the search results of the current app's version by specifying the name
parameter.
Next time, the found class name will be directly read from the local cache.
The local cache uses SharedPreferences
, which will be saved to the app's data directory and will be re-cached after the app's version is updated.
After enabling the local cache, async = true
will be set at the same time, you don't need to set it manually.
Notice
To use this function, you need to pass in the Context of the current app as the first method parameter.
The following example
val context: Context // Assume this is the Context of the current app
-searchClass(context, name = "com.demo.class1") {
- // ...
-}.wait { class1 ->
- // Get asynchronous result
-}
-searchClass(context, name = "com.demo.class2") {
- // ...
-}.wait { class2 ->
- // Get asynchronous result
-}
-
If you want to clear the local cache manually, you can use the following method to clear the current version of the current app's cache.
The following example
val context: Context // Assume this is the Context of the current app
-DexClassFinder.clearCache(context)
-
You can also clear the app's cache for a specific version.
The following example
val context: Context // Assume this is the Context of the current app
-DexClassFinder.clearCache(context, versionName = "1.0", versionCode = 1)
-
If you need to search a set of Class
at the same time using a fixed condition, then you only need to use the all
or waitAll
method to get the result.
// Synchronous search, use all to get all the results found by the conditions
-searchClass {
- // ...
-}.all().forEach { clazz ->
- // Get each result
-}
-// Synchronous search, using all { ... } to iterate over each result
-searchClass {
- // ...
-}.all { clazz ->
- // Get each result
-}
-// Asynchronous search, use waitAll to get all the results found by the conditions
-val context: Context // Assume this is the Context of the current app
-searchClass(context, async = true) {
- // ...
-}.waitAll { classes ->
- classes.forEach {
- // Get each result
- }
-}
-
Tips
For more functions, please refer to ClassLoader.searchClass method.
Here are the extension functions related to the Class bytecode member variables Field, Method, Constructor.
Tips
Member is the interface description object of Field, Method, Constructor, which is the general term for the bytecode members in Class in Java reflection.
Suppose there is such a Class
.
The following example
package com.demo;
-
-public class BaseTest {
-
- public BaseTest() {
- // ...
- }
-
- public BaseTest(boolean isInit) {
- // ...
- }
-
- private void doBaseTask(String taskName) {
- // ...
- }
-}
-
package com.demo;
-
-public class Test extends BaseTest {
-
- public Test() {
- // ...
- }
-
- public Test(boolean isInit) {
- // ...
- }
-
- private static TAG = "Test";
-
- private BaseTest baseInstance;
-
- private String a;
-
- private boolean a;
-
- private boolean isTaskRunning = false;
-
- private static void init() {
- // ...
- }
-
- private void doTask(String taskName) {
- // ...
- }
-
- private void release(String taskName, Function<boolean, String> task, boolean isFinish) {
- // ...
- }
-
- private void stop() {
- // ...
- }
-
- private String getName() {
- // ...
- }
-
- private void b() {
- // ...
- }
-
- private void b(String a) {
- // ...
- }
-}
-
Suppose we want to get the doTask
method of Test
and execute it.
Normally, we can use the standard reflection API to find this method.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using reflection API
-Test::class.java
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(instance, "task_name")
-
This is probably not very friendly, and YukiReflection
provides you with a syntactic sugar that can be used anywhere.
The above writing can be written as YukiReflection
as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doTask"
- param(StringClass)
-}.get(instance).call("task_name")
-
Tips
For more features, please refer to MethodFinder.
Similarly, we need to get the isTaskRunning
field can also be written as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.field {
- name = "isTaskRunning"
- type = BooleanType
-}.get(instance).any() // Any instantiates an object of any type of Field
-
Tips
For more features, please refer to FieldFinder.
Maybe you also want to get the current Class
constructor, the same can be achieved.
The following example
Test::class.java.constructor {
- param(BooleanType)
-}.get().call(true) // Can create a new instance
-
If you want to get the no-argument constructor of Class
, you can write it as follows.
The following example
Test::class.java.constructor().get().call() // Create a new instance
-
Tips
For more features, please refer to ConstructorFinder.
Suppose we want to get the getName
method in Class
, which can be implemented as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "getName"
- emptyParam()
- returnType = StringClass
-}.get(instance).string() // Get the result of the method
-
Through observation, it is found that there is only one method named getName
in this Class
, so can we make it simpler?
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "getName"
- emptyParam()
-}.get(instance).string() // Get the result of the method
-
Yes, you can refine your find criteria for methods that do not change exactly.
When using only get
or wait
methods to get results, YukiReflection
will match the first found result in bytecode order by default.
The problem comes again, this Class
has a release
method, but its method parameters are very long, and some types may not be directly available.
Normally we would use param(...)
to find this method, but is there an easier way.
At this point, after determining the uniqueness of the method, you can use paramCount
to find the method.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "release"
- // At this point
- // We don't have to determine the specific type of method parameters, just write the number
- paramCount = 3
-}.get(instance) // Get this method
-
Although the above example can be successfully matched, it is not accurate.
At this time, you can also use VagueType
to fill in the method parameter type that you do not want to fill in.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "release"
- // Use VagueType to fill in the type you don't want to fill in
- // While ensuring that other types can match
- param(StringClass, VagueType, BooleanType)
-}.get(instance) // Get this method
-
If you are not sure about the type of each parameter, you can create a conditional method body with the param { ... }
method.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "release"
- // Get the it (Class) method parameter type array instance
- // To only determine the known type and its position
- param { it[0] == StringClass && it[2] == BooleanType }
-}.get(instance) // Get this method
-
Tips
Use param { ... } to create a conditional method body, where the variable it is the Class type array instance of the current method parameter, and you can freely use Class all objects and their methods in.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to FieldFinder.type, MethodFinder.param, MethodFinder.returnType, ConstructorFinder.param method.
You will notice that Test
extends BaseTest
, now we want to get the doBaseTask
method of BaseTest
, how do we do it without knowing the name of the super class?
Referring to the above find conditions, we only need to add a superClass
to the find conditions to achieve this function.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // Just add this condition
- superClass()
-}.get(instance).call("task_name")
-
At this time, we can get this method in the super class.
superClass
has a parameter isOnlySuperClass
, when set to true
, you can skip the current Class
and only find the super class of the current Class
.
Since we now know that the doBaseTask
method only exists in the super class, this condition can be added to save finding time.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // Add a find condition
- superClass(isOnlySuperClass = true)
-}.get(instance).call("task_name")
-
At this time, we can also get this method in the super class.
Once superClass
is set, it will automatically cycle backward to find out whether this method exists in all extends super classes, until it finds that the target has no super class (the extends is java.lang.Object
).
Tips
For more functions, please refer to MethodFinder.superClass, ConstructorFinder.superClass, FieldFinder.superClass methods.
Pay Attention
The currently founded Method can only find the Method of the current Class unless the superClass condition is specified, which is the default behavior of the Java Reflection API.
If we want to find a method name, but are not sure if it has changed in each release, we can use vague find.
Suppose we want to get the doTask
method in Class
, which can be implemented as follows.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Set name is case insensitive
- it.equals("dotask", isIgnoreCase = true)
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
Knowing that there is currently only one doTask
method in Class
, we can also judge that the method name contains only the characters specified in it.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Only contains oTas
- it.contains("oTas")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
We can also judge based on the first and last strings.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Contains do at the beginning and Task at the end
- it.startsWith("do") && it.endsWith("Task")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
By observing that this method name contains only letters, we can add a precise search condition.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name {
- // Start with do, end with Task, just letters
- it.startsWith("do") && it.endsWith("Task") && it.isOnlyLetters()
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
Tips
Use name { ... } to create a conditional method body, where the variable it is the string of the current name, and you can freely use it in the extension method of NameRules function.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to FieldFinder.name, MethodFinder.name methods and NameRules.
Sometimes, we may need to find a set of methods, constructors, and fields with the same characteristics in a Class
.
At this time, we can use relative condition matching to complete.
Based on the result of the find condition, we only need to replace get
with all
to get all the bytecodes that match the condition.
Suppose this time we want to get all methods in Class
with the number of method parameters in the range 1..3
, you can use the following implementation.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- paramCount(1..3)
-}.all(instance).forEach { instance ->
- // Call and execute each method
- instance.call(...)
-}
-
The above example can be perfectly matched to the following 3 methods.
private void doTask(String taskName)
private void release(String taskName, Function<boolean, String> task, boolean isFinish)
private void b(String a)
If you want to define the conditions for the range of the number of parameters more freely, you can use the following implementation.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- paramCount { it < 3 }
-}.all(instance).forEach { instance ->
- // Call and execute each method
- instance.call(...)
-}
-
The above example can be perfectly matched to the following 6 methods.
private static void init()
private void doTask(String taskName)
private void stop(String a)
private void getName(String a)
private void b()
private void b(String a)
By observing that there are two methods named b
in Class
, you can use the following implementation.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "b"
-}.all(instance).forEach { instance ->
- // Call and execute each method
- instance.call(...)
-}
-
The above example can be perfectly matched to the following 2 methods.
private void b()
private void b(String a)
Tips
Use paramCount { ... } to create a conditional method body, where the variable it is the integer of the current number of parameters, and you can use it freely in the extension method of CountRules function in it.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to MethodFinder.paramCount, ConstructorFinder.paramCount methods and CountRules.
Some methods and fields are statically implemented in Class
, at this time, we can call them without passing in an instance.
Suppose we want to get the contents of the static field TAG
this time.
The following example
Test::class.java.field {
- name = "TAG"
- type = StringClass
-}.get().string() // The type of Field is string and can be cast directly
-
Assuming that there is a non-static TAG
field with the same name in Class
, what should I do at this time?
Just add a filter.
The following example
Test::class.java.field {
- name = "TAG"
- type = StringClass
- // This field to identify the lookup needs to be static
- modifiers { isStatic }
-}.get().string() // The type of Field is string and can be cast directly
-
We can also call a static method called init
.
The following example
Test::class.java.method {
- name = "init"
- emptyParam()
-}.get().call()
-
Likewise, you can identify it as a static.
The following example
Test::class.java.method {
- name = "init"
- emptyParam()
- // This method of identity find needs to be static
- modifiers { isStatic }
-}.get().call()
-
Tips
Use modifiers { ... } to create a conditional method body, at which point you can freely use its functionality in ModifierRules.
The condition at the end of the method body needs to return a Boolean, which is the final condition judgment result.
For more functions, please refer to FieldFinder.modifiers, MethodFinder.modifiers, ConstructorFinder.modifiers methods and ModifierRules.
You may have noticed that the example Class
given here has two obfuscated field names, both of which are a
, how do we get them at this time?
There are two options.
The first option is to determine the name and type of the field.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.field {
- name = "a"
- type = BooleanType
-}.get(instance).any() // Get a field named a with type Boolean
-
The second option is to determine where the type of the field is located.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.field {
- type(BooleanType).index().first()
-}.get(instance).any() // Get the first field of type Boolean
-
In the above two cases, the corresponding field private boolean a
can be obtained.
Likewise, there are two obfuscated method names in this Class
, both of which are b
.
You can also have two options to get them.
The first option is to determine the method name and method parameters.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "b"
- param(StringClass)
-}.get(instance).call("test_string") // Get the method whose name is b and whose parameter is [String]
-
The second option is to determine where the parameters of the method are located.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- param(StringClass).index().first()
-}.get(instance).call("test_string") // Get the method whose first method parameter is [String]
-
Since it is observed that this method is last in Class
, then we have an alternative.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- order().index().last()
-}.get(instance).call("test_string") // Get the last method of the current Class
-
Notice
Please try to avoid using order to filter bytecode subscripts, they may be indeterminate unless you are sure that its position in this Class must not change.
The methods of calling bytecode described above all need to use get(instance)
to call the corresponding method.
Is there a simpler way?
At this point, you can use the current
method on any instance to create a call space.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- // Execute the doTask method
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
- // Execute the stop method
- method {
- name = "stop"
- emptyParam()
- }.call()
- // Get name
- val name = method { name = "getName" }.string()
-}
-
We can also use superClass
to call methods of the current Class
super class.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- // Execute the doBaseTask method of the parent class
- superClass().method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
-}
-
If you don't like to use a lambda to create the namespace of the current instance, you can use the current()
method directly.
The following example
// Assuming this is an instance of this Class, this Class cannot be obtained directly
-val instance = Test()
-// Execute the doTask method
-instance
- .current()
- .method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-// Execute the stop method
-instance
- .current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// Get name
-val name = instance.current().method { name = "getName" }.string()
-
Likewise, consecutive calls can be made between them, but inline calls are not allowed.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}.current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// ❗ Note that because current() returns the CurrentClass object itself
-// It CANNOT BE CALLED like the following
-instance.current().current()
-
For Field
instances, there is also a convenience method that can directly get the object of the instance where Field
is located.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Assume this Class is not directly available
-instance.current {
- // <Plan 1>
- field {
- name = "baseInstance"
- }.current {
- method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
- }
- // <Plan 2>
- field {
- name = "baseInstance"
- }.current()
- ?.method {
- name = "doBaseTask"
- param(StringClass)
- }?.call("task_name")
-}
-
Notice
The above current method is equivalent to calling the field { ... }.any()?.current() method in CurrentClass for you.
If there is no CurrentClass calling field, you need to use field { ... }.get(instance).current() to call it.
The problem comes again, I want to use reflection to create the following instance and call the method in it, how to do it?
The following example
Test(true).doTask("task_name")
-
Usually, we can use the standard reflection API to call.
The following example
"com.demo.Test".toClass()
- .getDeclaredConstructor(Boolean::class.java)
- .apply { isAccessible = true }
- .newInstance(true)
- .apply {
- javaClass
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(this, "task_name")
- }
-
But I feel that this approach is very troublesome.
Is there a more concise way to call it?
At this time, we can also use the buildOf
method to create an instance.
The following example
"com.demo.Test".toClass().buildOf(true) { param(BooleanType) }?.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}
-
If you want the buildOf
method to return the type of the current instance, you can include a type-generic declaration in it instead of using as
to cast
the target type.
In this case, the constructor of the instance itself is private, but the method inside is public, so we only need to create its constructor by reflection.
The following example
// Assume this Class can be obtained directly
-val test = Test::class.java.buildOf<Test>(true) { param(BooleanType) }
-test.doTask("task_name")
-
Tips
For more functions, please refer to CurrentClass and Class.buildOf method.
Suppose there are three different versions of Class
, all of which are the same Class
for different versions of this app.
There is also a method doTask
in it, assuming they function the same.
The following example of version A
public class Test {
-
- public void doTask() {
- // ...
- }
-}
-
The following example of version B
public class Test {
-
- public void doTask(String taskName) {
- // ...
- }
-}
-
The following example of version C
public class Test {
-
- public void doTask(String taskName, int type) {
- // ...
- }
-}
-
We need to get this same functionality of the doTask
method in a different version, how do we do it?
At this point, you can use RemedyPlan
to complete your needs.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- param(StringClass)
- }.onFind {
- // Found logic can be implemented here
- }
- method {
- name = "doTask"
- param(StringClass, IntType)
- }.onFind {
- // Found logic can be implemented here
- }
-}.wait(instance) {
- // Get the result of the method
-}
-
Pay Attention
The method lookup result using RemedyPlan can no longer use get to get method instance, you should use wait method.
Also, you can continue to use RemedyPlan
while using Multiple Find.
The following example
// Assume this is an instance of this Class
-val instance = Test()
-// Call and execute using YukiReflection
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- paramCount(0..1)
- }.onFind {
- // Found logic can be implemented here
- }
- method {
- name = "doTask"
- paramCount(1..2)
- }.onFind {
- // Found logic can be implemented here
- }
-}.waitAll(instance) {
- // Get the result of the method
-}
-
Tips
For more functions, please refer to MethodFinder.RemedyPlan, ConstructorFinder.RemedyPlan, FieldFinder.RemedyPlan .
Suppose there is a Class
with the same function in different versions of the current app but only the name of the Class
is different.
The following example of version A
public class ATest {
-
- public static void doTask() {
- // ...
- }
-}
-
The following example of version B
public class BTest {
-
- public static void doTask() {
- // ...
- }
-}
-
At this time, what should we do if we want to call the doTask
method in this Class
in each version?
The usual practice is to check if Class
exists.
The following example
// First find this Class
-val currentClass =
- if("com.demo.ATest".hasClass()) "com.demo.ATest".toClass() else "com.demo.BTest".toClass()
-// Then look for this method and call
-currentClass.method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
I feel that this solution is very inelegant and cumbersome, then YukiReflection
provides you with a very convenient VariousClass
to solve this problem.
Now, you can get this Class
directly using the following methods.
The following example
VariousClass("com.demo.ATest", "com.demo.BTest").get().method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
If the current Class
exists in the specified ClassLoader
, you can fill in your ClassLoader
in get
.
The following example
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").get(customClassLoader).method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
If you are not sure that all Class
will be matched, you can use the getOrNull
method.
The following example
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").getOrNull(customClassLoader)?.method {
- name = "doTask"
- emptyParam()
-}?.get()?.call()
-
Tips
For more functions, please refer to VariousClass.
In the process of reflection, we may encounter generic problems.
In the reflection processing of generics, YukiReflection
also provides a syntactic sugar that can be used anywhere.
For example we have the following generic class.
The following example
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // ...
- }
-}
-
When we want to get a Class
instance of the generic T
or R
in the current Class
, only the following implementation is required.
The following example
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // Get the operation object of the current instance
- // Get the Class instance of T, in the 0th position of the parameter
- // The default value can not be written
- val tClass = current().generic()?.argument()
- // Get the Class instance of R, in parameter 1
- val rClass = current().generic()?.argument(index = 1)
- // You can also use the following syntax
- current().generic {
- // Get the Class instance of T
- // In the 0th position of the parameter, the default value can be left blank
- val tClass = argument()
- // Get the Class instance of R, in parameter 1
- val rClass = argument(index = 1)
- }
- }
-}
-
When we want to call this Class
externally, it can be implemented as follows.
The following example
// Assume this is the Class of T
-class TI {
-
- fun foo() {
- // ...
- }
-}
-// Assume this is an instance of T
-val tInstance: TI? = ...
-// Get the Class instance of T
-// In the 0th position of the parameter, the default value can be left blank
-// And get the method foo and call it
-TestGeneric::class.java.generic()?.argument()?.method {
- name = "foo"
- emptyParam()
-}?.get(tInstance)?.invoke<TI>()
-
Tips
For more functions, please refer to CurrentClass.generic, Class.generic methods and GenericClass.
Here are some misunderstandings that may be encountered during use for reference.
Pay Attention
In find conditions you can only use index function once except order.
The following example
method {
- name = "test"
- param(BooleanType).index(num = 2)
- // ❗ Wrong usage, please keep only one index method
- returnType(StringClass).index(num = 1)
-}
-
The following find conditions can be used without any problems.
The following example
method {
- name = "test"
- param(BooleanType).index(num = 2)
- order().index(num = 1)
-}
-
Pay Attention
In common method find conditions, even methods without parameters need to set find conditions.
Suppose we have the following Class
.
The following example
public class TestFoo {
-
- public void foo(String string) {
- // ...
- }
-
- public void foo() {
- // ...
- }
-}
-
We want to get the public void foo()
method, which can be written as follows.
The following example
TestFoo::class.java.method {
- name = "foo"
-}
-
However, the above example is wrong.
You will find two foo
methods in this Class
, one of which takes a method parameter.
Since the above example does not set the find conditions for param
, the result will be the first method public void foo(String string)
that matches the name and matches the bytecode order, not the last method we need.
This is a frequent error, without method parameters, you will lose the use of method parameter find conditions.
The correct usage is as follows.
The following example
TestFoo::class.java.method {
- name = "foo"
- // ✅ Correct usage, add detailed filter conditions
- emptyParam()
-}
-
At this point, the above example will perfectly match the public void foo()
method.
In the construction method find conditions, constructors without parameters do not need to fill in the find conditions.
Suppose we have the following Class
.
The following example
public class TestFoo {
-
- public TestFoo() {
- // ...
- }
-}
-
We want to get the public TestFoo()
constructor, which can be written as follows.
The following example
TestFoo::class.java.constructor { emptyParam() }
-
The above example can successfully obtain the public TestFoo()
constructor, but it feels a bit cumbersome.
Unlike normal methods, since the constructor does not need to consider the name
, when the constructor has no parameters, we can omit the emptyParam
parameter.
The following example
TestFoo::class.java.constructor()
-
Pay Attention
In the bytecode call result, the cast method can only specify the type corresponding to the bytecode.
For example we want to get a field of type Boolean
and cast it to String
.
The following is the wrong way to use it.
The following example
field {
- name = "test"
- type = BooleanType
-}.get().string() // ❗ Wrong usage, must be cast to the bytecode target type
-
The following is the correct way to use it.
The following example
field {
- name = "test"
- type = BooleanType
-}.get().boolean().toString() // ✅ The correct way to use, get the type and then convert
-
When find methods and fields, we usually need to specify the type in find conditions.
The following example
field {
- name = "test"
- type = Boolean::class.javaPrimitiveType
-}
-
Expressing the type of Boolean::class.javaPrimitiveType
in Kotlin
is very long and inconvenient.
Therefore, YukiReflection
encapsulates common type calls for developers, including Android related types and Java common types and primitive type keywords.
At this time, the above type can be written in the following form.
The following example
field {
- name = "test"
- type = BooleanType
-}
-
The primitive type keywords in common Java types have been encapsulated as Type(Class Name) + Type, such as IntType
, FloatType
(their bytecode types are int
, float
).
Correspondingly, array types also have convenient usage methods, assuming we want to get an array of type String[]
.
You need to write java.lang.reflect.Array.newInstance(String::class.java, 0).javaClass
to get this type.
Does it feel very troublesome, at this time we can use the method ArrayClass(StringClass)
to get this type.
At the same time, since String
is a common type, you can also directly use StringArrayClass
to get this type.
The methods found in some common requirements have their corresponding encapsulation types for use, in the format Type(Class Name) + Class.
The following are wrapper names for some special case types in Java represented in YukiReflection
.
void
→ UnitType
java.lang.Void
→ UnitClass
java.lang.Object
→ AnyClass
java.lang.Integer
→ IntClass
java.lang.Character
→ CharClass
Notice
Encapsulating types with Type(Class Name) + Type will and only be represented as Java primitive type keywords.
Since the concept of primitive types does not exist in Kotlin, they will all be defined as KClass.
There are 9 primitive type keywords in Java, of which 8 are primitive type, namely boolean, char, byte, short , int, float, long, double, of which the void type is a special case.
At the same time, they all have their own corresponding package types in Java, such as java.lang.Boolean, java.lang.Integer, these types are unequal, Please note the distinction.
Similarly, arrays also have corresponding wrapper types, which also need to be distinguished from Java primitive type keywords.
For example, the encapsulation type of byte[] is ByteArrayType or ArrayClass(ByteType), and the encapsulation type of Byte[] is ByteArrayClass or ArrayClass(ByteClass), these types are also unequal.
Tips
For more types, see ComponentTypeFactory, GraphicsTypeFactory, ViewTypeFactory, VariableTypeFactory.
At the same time, you are welcome to contribute more commonly used types.
The document here will synchronize the relevant usage of the latest API version, please keep
YukiReflection
as the latest version to use the latest version of the function.
The function description mainly introduces the related usage and purpose of the current API.
The function examples mainly show the basic usage examples of the current API for reference.
The function of the first version will be marked as v<version>
first
;
New function added later will be marked as v<version>
added
;
Later modified function will be appended as v<version>
modified
;
Later deprecated function will be marked as v<version>
deprecated
and strikethrough;
Later removed function will be marked as v<version>
removed
and strikethrough.
kt Kotlin Static File
annotation Annotation Class
interface Interface Class
object Class (Singleton)
class Class
field Field or get
/ set
method or read-only get
method
method Method
enum Enum constant
ext-field Extension field (global)
ext-method Extension method (global)
i-ext-field Extension field (internal)
i-ext-method Extension method (internal)
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
object YukiReflection
-
Change Records
v1.0.0
first
Function Illustrate
这是
YukiReflection
的装载调用类。
const val API_VERSION_NAME: String
-
Change Records
v1.0.0
first
Function Illustrate
获取当前
YukiReflection
的版本。
const val API_VERSION_CODE: Int
-
Change Records
v1.0.0
first
Function Illustrate
获取当前
YukiReflection
的版本号。
object Configs
-
Change Records
v1.0.0
first
Function Illustrate
对 API 相关功能的配置类。
var debugTag: String
-
Change Records
v1.0.0
first
Function Illustrate
这是一个调试日志的全局标识。
默认文案为 YukiReflection
。
你可以修改为你自己的文案。
var isDebug: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否启用 Debug 模式。
默认不启用,启用后将交由日志输出管理器打印详细日志 (例如反射查找功能的耗时) 到控制台。
请过滤 debugTag
即可找到每条日志。
var isAllowPrintingLogs: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否启用调试日志的输出功能。
Notice
关闭后将会停用 YukiReflection 对全部日志的输出。
Change Records
v1.0.0
first
v1.0.2
deprecated
Member
的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
inline fun configs(initiate: Configs.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
对
Configs
类实现了一个lambda
方法体。
你可以轻松地调用它进行配置。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
-
Change Records
v1.0.0
first
Function Illustrate
当前实例的类操作对象。
val name: String
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
classSet
的Class.getName
。
val simpleName: String
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
classSet
的Class.getSimpleName
。
fun generic(): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前实例中的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前实例中的泛型父类。
如果当前实例不存在泛型将返回 null
。
fun superClass(): SuperClass
-
Change Records
v1.0.0
first
Function Illustrate
调用父类实例。
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
调用当前实例中的变量。
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
调用当前实例中的方法。
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
-
Change Records
v1.0.0
first
Function Illustrate
当前类的父类实例的类操作对象。
val name: String
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
classSet
中父类的Class.getName
。
val simpleName: String
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
classSet
中父类的Class.getSimpleName
。
fun generic(): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前实例父类中的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前实例父类中的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
调用父类实例中的变量。
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
Change Records
v1.0.0
first
Function Illustrate
调用父类实例中的方法。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class GenericClass internal constructor(private val type: ParameterizedType)
-
Change Records
v1.0.0
first
Function Illustrate
当前
Class
的泛型父类操作对象。
fun argument(index: Int): Class<*>
-
inline fun <reified T> argument(index: Int): Class<T>
-
Change Records
v1.0.0
first
Function Illustrate
获得泛型参数数组下标的
Class
实例。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class VariousClass(private vararg val name: String)
-
Change Records
v1.0.0
first
Function Illustrate
这是一个不确定性
Class
类名装载器,通过name
装载Class
名称数组。
fun get(loader: ClassLoader? = null, initialize: Boolean): Class<*>
-
Change Records
v1.0.0
first
Function Illustrate
获取匹配的实体类。
使用当前 loader
装载目标 Class
。
fun getOrNull(loader: ClassLoader? = null, initialize: Boolean): Class<*>?
-
Change Records
v1.0.0
first
Function Illustrate
获取匹配的实体类。
使用当前 loader
装载目标 Class
。
匹配不到 Class
会返回 null
,不会抛出异常。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
这是自定义
Member
和Class
相关功能的查找匹配以及invoke
的封装类。
fun ClassLoader.listOfClasses(): List<String>
-
Change Records
v1.0.0
first
Function Illustrate
写出当前
ClassLoader
下所有Class
名称数组。
inline fun ClassLoader.searchClass(context: Context?, name: String, async: Boolean, initiate: ClassConditions): DexClassFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
通过当前
ClassLoader
按指定条件查找并得到 Dex 中的Class
。
Pay Attention
此方法在 Class 数量过多及查找条件复杂时会非常耗时。
建议启用 async 或设置 name 参数,name 参数将在当前 APP 不同版本中自动进行本地缓存以提升效率。
如果使用了 async 或 name 参数,则必须填写 context 参数。
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
val Class<*>.hasExtends: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
当前
Class
是否有继承关系,父类是Any
将被认为没有继承关系。
infix fun Class<*>?.extends(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
当前
Class
是否继承于other
。
如果当前 Class
就是 other
也会返回 true
。
如果当前 Class
为 null
或 other
为 null
会返回 false
。
Function Example
你可以使用此方法来判断两个 Class
是否存在继承关系。
The following example
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否继承于 B
-if (classA extends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notExtends(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
当前
Class
是否不继承于other
。
此方法相当于 extends
的反向判断。
Function Example
你可以使用此方法来判断两个 Class
是否不存在继承关系。
The following example
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否不继承于 B
-if (classA notExtends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.implements(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
当前
Class
是否实现了other
接口类。
如果当前 Class
为 null
或 other
为 null
会返回 false
。
Function Example
你可以使用此方法来判断两个 Class
是否存在依赖关系。
The following example
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否实现了 B 接口类
-if (classA implements classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notImplements(other: Class<*>?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
当前
Class
是否未实现other
接口类。
此方法相当于 implements
的反向判断。
Function Example
你可以使用此方法来判断两个 Class
是否不存在依赖关系。
The following example
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否未实现 B 接口类
-if (classA notImplements classB) {
- // Your code here.
-}
-
fun Class<*>.toJavaPrimitiveType(): Class<*>
-
Change Records
v1.0.0
first
Function Illustrate
自动转换当前
Class
为 Java 原始类型 (Primitive Type)。
如果当前 Class
为 Java 或 Kotlin 基本类型将自动执行类型转换。
当前能够自动转换的基本类型如下。
kotlin.Unit
java.lang.Void
java.lang.Boolean
java.lang.Integer
java.lang.Float
java.lang.Double
java.lang.Long
java.lang.Short
java.lang.Character
java.lang.Byte
fun String.toClass(loader: ClassLoader?, initialize: Boolean): Class<*>
-
inline fun <reified T> String.toClass(loader: ClassLoader?, initialize: Boolean): Class<T>
-
Change Records
v1.0.0
first
Function Illustrate
通过字符串类名转换为
loader
中的实体类。
Function Example
你可以直接填写你要查找的目标 Class
,必须在默认 ClassLoader
下存在。
The following example
"com.example.demo.DemoClass".toClass()
-
你还可以自定义 Class
所在的 ClassLoader
。
The following example
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-"com.example.demo.DemoClass".toClass(customClassLoader)
-
你还可以指定 Class
的目标类型。
The following example
// 指定的 DemoClass 必须存在或为可访问的 stub
-"com.example.demo.DemoClass".toClass<DemoClass>()
-
你还可以设置在获取到这个 Class
时是否自动执行其默认的静态方法块,默认情况下不会执行。
The following example
// 获取并执行 DemoClass 默认的静态方法块
-"com.example.demo.DemoClass".toClass(initialize = true)
-
默认的静态方法块在 Java 中使用如下方式定义。
The following example
public class DemoClass {
-
- static {
- // 这里是静态方法块的内容
- }
-
- public DemoClass() {
- // ...
- }
-}
-
fun String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<*>?
-
inline fun <reified T> String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<T>?
-
Change Records
v1.0.0
first
Function Illustrate
通过字符串类名转换为
loader
中的实体类。
找不到 Class
会返回 null
,不会抛出异常。
Function Example
用法请参考 String.toClass 方法。
inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class<T>
-
Change Records
v1.0.0
first
Function Illustrate
通过
T
得到其Class
实例并转换为实体类。
Function Example
我们要获取一个 Class
在 Kotlin
下不通过反射时应该这样做。
The following example
DemoClass::class.java
-
现在,你可以直接 cast
一个实例并获取它的 Class
对象,必须在当前 ClassLoader
下存在。
The following example
classOf<DemoClass>()
-
若目标存在的 Class
为 stub
,通过这种方式,你还可以自定义 Class
所在的 ClassLoader
。
The following example
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-classOf<DemoClass>(customClassLoader)
-
fun String.hasClass(loader: ClassLoader?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
通过字符串类名使用指定的
ClassLoader
查找是否存在。
Function Example
你可以轻松的使用此方法判断字符串中的类是否存在,效果等同于直接使用 Class.forName
。
The following example
if("com.example.demo.DemoClass".hasClass()) {
- // Your code here.
-}
-
填入方法中的 loader
参数可判断指定的 ClassLoader
中的 Class
是否存在。
The following example
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-if("com.example.demo.DemoClass".hasClass(customClassLoader)) {
- // Your code here.
-}
-
inline fun Class<*>.hasField(initiate: FieldConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
查找变量是否存在。
inline fun Class<*>.hasMethod(initiate: MethodConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
查找方法是否存在。
inline fun Class<*>.hasConstructor(initiate: ConstructorConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
查找构造方法是否存在。
inline fun Member.hasModifiers(conditions: ModifierConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
查找
Member
中匹配的描述符。
inline fun Class<*>.hasModifiers(conditions: ModifierConditions): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
查找
Class
中匹配的描述符。
inline fun Class<*>.field(initiate: FieldConditions): FieldFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
查找并得到变量。
inline fun Class<*>.method(initiate: MethodConditions): MethodFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
查找并得到方法。
inline fun Class<*>.constructor(initiate: ConstructorConditions): ConstructorFinder.Result
-
Change Records
v1.0.0
first
Function Illustrate
查找并得到构造方法。
fun Class<*>.generic(): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
Class
的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun Class<*>.generic(initiate: GenericClass.() -> Unit): GenericClass?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
Class
的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun <reified T : Any> T.current(ignored: Boolean): CurrentClass
-
inline fun <reified T : Any> T.current(ignored: Boolean, initiate: CurrentClass.() -> Unit): T
-
Change Records
v1.0.0
first
Function Illustrate
获得当前实例的类操作对象。
inline fun Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): Any?
-
inline fun <T> Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): T?
-
Change Records
v1.0.0
first
Function Illustrate
通过构造方法创建新实例,指定类型
T
或任意类型Any
。
inline fun Class<*>.allMethods(isAccessible: Boolean, result: (index: Int, method: Method) -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
遍历当前类中的所有方法。
inline fun Class<*>.allConstructors(isAccessible: Boolean, result: (index: Int, constructor: Constructor<*>) -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
遍历当前类中的所有构造方法。
inline fun Class<*>.allFields(isAccessible: Boolean, result: (index: Int, field: Field) -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
遍历当前类中的所有变量。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
abstract class BaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
这是
Class
与Member
查找类功能的基本类实现。
inner class IndexTypeCondition internal constructor(private val type: IndexConfigType)
-
Change Records
v1.0.0
first
Function Illustrate
字节码下标筛选实现类。
fun index(num: Int)
-
Change Records
v1.0.0
first
Function Illustrate
设置下标。
若 index
小于零则为倒序,此时可以使用 IndexTypeConditionSort.reverse
方法实现。
可使用 IndexTypeConditionSort.first
和 IndexTypeConditionSort.last
设置首位和末位筛选条件。
fun index(): IndexTypeConditionSort
-
Change Records
v1.0.0
first
Function Illustrate
得到下标。
inner class IndexTypeConditionSort internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
字节码下标排序实现类。
fun first()
-
Change Records
v1.0.0
first
Function Illustrate
设置满足条件的第一个。
fun last()
-
Change Records
v1.0.0
first
Function Illustrate
设置满足条件的最后一个。
fun reverse(num: Int)
-
Change Records
v1.0.0
first
Function Illustrate
设置倒序下标。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class CountRules private constructor()
-
Change Records
v1.0.0
first
Function Illustrate
这是一个模糊
Class
、Member
数组 (下标) 个数条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
fun Int.isZero(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否为 0。
fun Int.moreThan(count: Int): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
大于
count
。
fun Int.lessThan(count: Int): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
小于
count
。
fun Int.inInterval(countRange: IntRange): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
在
countRange
区间 A ≤ this ≤ B。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ModifierRules private constructor()
-
Change Records
v1.0.0
first
Function Illustrate
这是一个
Class
、Member
描述符条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
val isPublic: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含public
。
val isPrivate: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含private
。
val isProtected: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含protected
。
val isStatic: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含static
。
对于任意的静态 Class
、Member
可添加此描述进行确定。
Notice
Kotlin → Jvm 后的 object 类中的方法并不是静态的。
val isFinal: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含final
。
Notice
Kotlin → Jvm 后没有 open 符号标识的 Class、Member 和没有任何关联的 Class、Member 都将为 final。
val isSynchronized: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含synchronized
。
val isVolatile: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Field
类型是否包含volatile
。
val isTransient: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Field
类型是否包含transient
。
val isNative: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Method
类型是否包含native
。
对于任意 JNI 对接的 Method
可添加此描述进行确定。
val isInterface: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
类型是否包含interface
。
val isAbstract: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含abstract
。
对于任意的抽象 Class
、Member
可添加此描述进行确定。
val isStrict: Boolean
-
Change Records
v1.0.0
first
Function Illustrate
Class
、Member
类型是否包含strictfp
。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class NameRules private constructor()
-
Change Records
v1.0.0
first
Function Illustrate
这是一个模糊
Class
、Member
名称条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
fun String.isSynthetic(index: Int): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否为匿名类的主类调用对象。
fun String.isOnlySymbols(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否只有符号。
fun String.isOnlyLetters(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否只有字母。
fun String.isOnlyNumbers(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否只有数字。
fun String.isOnlyLettersNumbers(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否只有字母或数字。
fun String.isOnlyLowercase(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否只有小写字母。
在没有其它条件的情况下设置此条件允许判断对象存在字母以外的字符。
fun String.isOnlyUppercase(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
是否只有大写字母。
在没有其它条件的情况下设置此条件允许判断对象存在字母以外的字符。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ObjectRules private constructor(private val instance: Any)
-
Change Records
v1.0.0
first
Function Illustrate
这是一个任意对象条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class DexClassFinder internal constructor(
- private val context: Context?,
- internal var name: String,
- internal var async: Boolean,
- override val loaderSet: ClassLoader?
-) : ClassBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Class
查找类。
可使用 BaseDexClassLoader
通过指定条件查找指定 Class
或一组 Class
。
Notice
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
Change Records
v1.0.0
first
fun clearCache(context: Context, versionName: String?, versionCode: Long?)
-
Change Records
v1.0.0
first
Function Illustrate
清除当前
DexClassFinder
的Class
缓存。
适用于全部通过 ClassLoader.searchClass 获取的 DexClassFinder
。
var fullName: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
完整名称。
只会查找匹配到的 Class.getName
。
例如 com.demo.Test
需要填写 com.demo.Test
。
var simpleName: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
简单名称。
只会查找匹配到的 Class.getSimpleName
。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest
会为空,此时你可以使用 singleName。
var singleName: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
独立名称。
设置后将首先使用 Class.getSimpleName
,若为空则会使用 Class.getName
进行处理。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest
只需要填写 Test$InnerTest
。
fun from(vararg name: String): FromPackageRules
-
Change Records
v1.0.0
first
Function Illustrate
设置在指定包名范围查找当前
Class
。
设置后仅会在当前 name
开头匹配的包名路径下进行查找,可提升查找速度。
例如 ↓
com.demo.test
com.demo.test.demo
Notice
建议设置此参数指定查找范围,否则 Class 过多时将会非常慢。
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
标识符筛选条件。
可不设置筛选条件。
fun fullName(value: String): ClassNameRules
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
完整名称。
只会查找匹配到的 Class.getName
。
例如 com.demo.Test
需要填写 com.demo.Test
。
fun simpleName(value: String): ClassNameRules
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
简单名称。
只会查找匹配到的 Class.getSimpleName
。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest 会为空
,此时你可以使用 singleName。
fun singleName(value: String): ClassNameRules
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
独立名称。
设置后将首先使用 Class.getSimpleName
,若为空则会使用 Class.getName
进行处理。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest
只需要填写 Test$InnerTest
。
fun fullName(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
完整名称条件。
只会查找匹配到的 Class.getName
。
fun simpleName(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
简单名称条件。
只会查找匹配到的 Class.getSimpleName
。
fun singleName(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
独立名称条件。
设置后将首先使用 Class.getSimpleName
,若为空则会使用 Class.getName
进行处理。
inline fun <reified T> extends()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
继承的父类。
fun extends(vararg name: String)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
继承的父类。
会同时查找 name
中所有匹配的父类。
inline fun <reified T> implements()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
实现的接口类。
fun implements(vararg name: String)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
实现的接口类。
会同时查找 name
中所有匹配的接口类。
fun anonymous()
-
Change Records
v1.0.0
first
Function Illustrate
标识
Class
为匿名类。
例如 com.demo.Test$1
或 com.demo.Test$InnerTest
。
标识后你可以使用 enclosing 来进一步指定匿名类的 (封闭类) 主类。
fun noExtends()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
没有任何继承。
此时 Class
只应该继承于 Any
。
Notice
设置此条件后 extends 将失效。
fun noImplements()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
没有任何接口。
Notice
设置此条件后 implements 将失效。
fun noSuper()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
没有任何继承与接口。
此时 Class
只应该继承于 Any
。
Notice
设置此条件后 extends 与 implements 将失效。
inline fun <reified T> enclosing()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
匿名类的 (封闭类) 主类。
fun enclosing(vararg name: String)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
匿名类的 (封闭类) 主类。
会同时查找 name
中所有匹配的 (封闭类) 主类。
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
-
Change Records
v1.0.0
first
Function Illustrate
包名范围名称过滤匹配条件实现类。
fun absolute()
-
Change Records
v1.0.0
first
Function Illustrate
设置包名绝对匹配。
例如有如下包名 ↓
com.demo.test.a
com.demo.test.a.b
com.demo.test.active
若包名条件为 com.demo.test.a
则绝对匹配仅能匹配到第一个。
相反地,不设置以上示例会全部匹配。
inner class ClassNameRules internal constructor(private val name: ClassRulesData.NameRulesData)
-
Change Records
v1.0.0
first
Function Illustrate
类名匹配条件实现类。
fun optional()
-
Change Records
v1.0.0
first
Function Illustrate
设置类名可选。
例如有如下类名 ↓
com.demo.Test
fullName / Test
simpleName
defpackage.a
fullName / a
simpleName
这两个类名都是同一个类,但是在有些版本中被混淆有些版本没有。
此时可设置类名为 com.demo.Test
fullName / Test
simpleName。
这样就可在完全匹配类名情况下使用类名而忽略其它查找条件,否则忽略此条件继续使用其它查找条件。
inline fun member(initiate: MemberRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
满足的Member
条件。
inline fun field(initiate: FieldRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
满足的Field
条件。
inline fun method(initiate: MethodRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
满足的Method
条件。
inline fun constructor(initiate: ConstructorRules.() -> Unit): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置
Class
满足的Constructor
条件。
inner class Result internal constructor(internal var isNotFound: Boolean, internal var throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Class
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建监听结果事件方法体。
fun get(): Class<*>?
-
Change Records
v1.0.0
first
Function Illustrate
得到
Class
本身。
若有多个 Class
结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
若你设置了 async
请使用 wait 方法。
fun all(): HashSet<Class<*>>
-
Change Records
v1.0.0
first
Function Illustrate
得到
Class
本身数组。
返回全部查找条件匹配的多个 Class
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
若你设置了 async
请使用 waitAll 方法。
fun all(result: (Class<*>) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
得到
Class
本身数组 (依次遍历)。
回调全部查找条件匹配的多个 Class
实例。
在查找条件找不到任何结果的时候将不会执行。
若你设置了 async
请使用 waitAll 方法。
fun wait(result: (Class<*>?) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
得到
Class
本身 (异步)。
若有多个 Class
结果只会回调第一个。
在查找条件找不到任何结果的时候将回调 null。
你需要设置 async
后此方法才会被回调,否则请使用 get 方法。
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
得到
Class
本身数组 (异步)。
回调全部查找条件匹配的多个 Class
实例。
在查找条件找不到任何结果的时候将回调空的 HashSet
。
你需要设置 async
后此方法才会被回调,否则请使用 all 方法。
fun onNoClassDefFoundError(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
监听找不到
Class
时。
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
忽略异常并停止打印任何错误日志。
此时若要监听异常结果,你需要手动实现 onNoClassDefFoundError 方法。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
查找条件实现类。
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
标识符筛选条件。
可不设置筛选条件。
fun emptyParam()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
空参数、无参数。
fun param(vararg paramType: Any)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Constructor
中存在一些无意义又很长的类型,你可以使用 VagueType
来替代它。
Pay Attention
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
fun param(conditions: ObjectsConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数条件。
Pay Attention
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
fun paramCount(numRange: IntRange)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
fun paramCount(conditions: CountConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Field
查找条件实现类。
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
名称。
var type: Any?
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
类型。
可不填写类型。
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
标识符筛选条件。
可不设置筛选条件。
fun name(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
名称条件。
fun type(conditions: ObjectConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
类型条件。
可不填写类型。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Member
查找条件实现类。
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Member
标识符筛选条件。
可不设置筛选条件。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
-
Change Records
v1.0.0
first
Function Illustrate
Method
查找条件实现类。
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
名称。
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
var returnType: Any?
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
返回值。
可不填写返回值。
fun modifiers(conditions: ModifierConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
标识符筛选条件。
可不设置筛选条件。
fun emptyParam()
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
空参数、无参数。
fun param(vararg paramType: Any)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Method
中存在一些无意义又很长的类型,你可以使用 VagueType
来替代它。
Pay Attention
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
fun param(conditions: ObjectsConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数条件。
Pay Attention
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
fun name(conditions: NameConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
名称条件。
fun paramCount(numRange: IntRange)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
fun paramCount(conditions: CountConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
fun returnType(conditions: ObjectConditions)
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
返回值条件。
可不填写返回值。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MemberRulesResult internal constructor(private val rulesData: MemberRulesData)
-
Change Records
v1.0.0
first
Function Illustrate
当前
Member
查找条件结果实现类。
fun none(): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Member
在查找条件中个数为0
。
fun count(num: Int): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Member
在查找条件中需要全部匹配的个数。
fun count(numRange: IntRange): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Member
在查找条件中需要全部匹配的个数范围。
fun count(conditions: CountConditions): MemberRulesResult
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Member
在查找条件中需要全部匹配的个数条件。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class ConstructorFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
查找类。
可通过指定类型查找指定 Constructor
或一组 Constructor
。
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
标识符筛选条件。
可不设置筛选条件,默认模糊查找并取第一个匹配的 Constructor
。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun emptyParam(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
空参数、无参数。
fun param(vararg paramType: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Constructor
中存在一些无意义又很长的类型,你可以使用 VagueType 来替代它。
Pay Attention
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数条件。
Pay Attention
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(num: Int): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数。
若参数个数小于零则忽略并使用 param
。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(numRange: IntRange): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Constructor
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun superClass(isOnlySuperClass: Boolean)
-
Change Records
v1.0.0
first
Function Illustrate
设置在
classSet
的所有父类中查找当前Constructor
。
Notice
若当前 classSet 的父类较多可能会耗时,API 会自动循环到父类继承是 Any 前的最后一个类。
inner class RemedyPlan internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
重查找实现类,可累计失败次数直到查找成功。
inline fun constructor(initiate: ConstructorConditions)
-
Change Records
v1.0.0
first
Function Illustrate
创建需要重新查找的
Constructor
。
你可以添加多个备选 Constructor
,直到成功为止,若最后依然失败,将停止查找并输出错误日志。
inner class Result internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
RemedyPlan
结果实现类。
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
当在
RemedyPlan
中找到结果时。
Function Example
你可以方便地对重查找的 Constructor
实现 onFind
方法。
The following example
constructor {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建监听结果事件方法体。
Function Example
你可以使用 lambda
形式创建 Result
类。
The following example
constructor {
- // Your code here.
-}.result {
- get().call()
- all()
- remedys {}
- onNoSuchConstructor {}
-}
-
fun get(): Instance
-
Change Records
v1.0.0
first
Function Illustrate
获得
Constructor
实例处理类。
若有多个 Constructor
结果只会返回第一个。
Pay Attention
若你设置了 remedys 请使用 wait 回调结果方法。
Function Example
你可以通过获得方法所在实例来执行构造方法创建新的实例对象。
The following example
constructor {
- // Your code here.
-}.get().call()
-
你可以 cast
构造方法为指定类型的实例对象。
The following example
constructor {
- // Your code here.
-}.get().newInstance<TestClass>()
-
Pay Attention
若构造方法含有参数则后方参数必填。
The following example
constructor {
- // Your code here.
-}.get().newInstance<TestClass>("param1", "param2")
-
fun all(): ArrayList<Instance>
-
Change Records
v1.0.0
first
Function Illustrate
获得
Constructor
实例处理类数组。
返回全部查找条件匹配的多个 Constructor
实例结果。
Function Example
你可以通过此方法来获得当前条件结果中匹配的全部 Constructor
。
The following example
constructor {
- // Your code here.
-}.all().forEach { instance ->
- instance.call(...)
-}
-
fun give(): Constructor<*>?
-
Change Records
v1.0.0
first
Function Illustrate
得到
Constructor
本身。
若有多个 Constructor
结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
fun giveAll(): HashSet<Constructor<*>>
-
Change Records
v1.0.0
first
Function Illustrate
得到
Constructor
本身数组。
返回全部查找条件匹配的多个 Constructor
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
fun wait(initiate: Instance.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
获得
Constructor
实例处理类,配合RemedyPlan
使用。
若有多个 Constructor
结果只会返回第一个。
Pay Attention
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
获得
Constructor
实例处理类数组,配合RemedyPlan
使用。
返回全部查找条件匹配的多个 Constructor
实例结果。
Pay Attention
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建
Constructor
重查找功能。
Function Example
当你遇到一种 Constructor
可能存在不同形式的存在时,可以使用 RemedyPlan
重新查找它,而没有必要使用 onNoSuchConstructor
捕获异常二次查找 Constructor
。
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
The following example
constructor {
- // Your code here.
-}.remedys {
- constructor {
- // Your code here.
- }
- constructor {
- // Your code here.
- }
-}
-
inline fun onNoSuchConstructor(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
监听找不到
Constructor
时。
只会返回第一次的错误信息,不会返回 RemedyPlan
的错误信息。
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
忽略异常并停止打印任何错误日志。
Notice
此时若要监听异常结果,你需要手动实现 onNoSuchConstructor 方法。
inner class Instance internal constructor(private val constructor: Constructor<*>?)
-
Change Records
v1.0.0
first
Function Illustrate
Constructor
实例处理类。
fun call(vararg args: Any?): Any?
-
Change Records
v1.0.0
first
Function Illustrate
执行
Constructor
创建目标实例,不指定目标实例类型。
fun <T> newInstance(vararg args: Any?): T?
-
Change Records
v1.0.0
first
Function Illustrate
执行
Constructor
创建目标实例 ,指定T
目标实例类型。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class FieldFinder internal constructor(override val classSet: Class<*>?) : MemberBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Field
查找类。
可通过指定类型查找指定 Field
或一组 Field
。
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
名称。
Pay Attention
若不填写名称则必须存在一个其它条件。
var type: Any?
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
类型。
可不填写类型。
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
标识符筛选条件。
可不设置筛选条件。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun order(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
顺序筛选字节码的下标。
fun name(value: String): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
名称。
Pay Attention
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun name(conditions: NameConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
名称条件。
Pay Attention
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun type(value: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
类型。
可不填写类型。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun type(conditions: ObjectConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Field
类型条件。
可不填写类型。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun superClass(isOnlySuperClass: Boolean)
-
Change Records
v1.0.0
first
Function Illustrate
设置在
classSet
的所有父类中查找当前Field
。
Notice
若当前 classSet 的父类较多可能会耗时,API 会自动循环到父类继承是 Any 前的最后一个类。
inner class RemedyPlan internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
Field
重查找实现类,可累计失败次数直到查找成功。
inline fun field(initiate: FieldConditions): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建需要重新查找的
Field
。
你可以添加多个备选 Field
,直到成功为止,若最后依然失败,将停止查找并输出错误日志。
inner class Result internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
RemedyPlan
结果实现类。
fun onFind(initiate: HashSet<Field>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
当在
RemedyPlan
中找到结果时。
Function Example
你可以方便地对重查找的 Field
实现 onFind
方法。
The following example
field {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Field
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建监听结果事件方法体。
Function Example
你可以使用 lambda
形式创建 Result
类。
The following example
field {
- // Your code here.
-}.result {
- get(instance).set("something")
- get(instance).string()
- get(instance).cast<CustomClass>()
- get().boolean()
- all(instance)
- give()
- giveAll()
- onNoSuchField {}
-}
-
fun get(instance: Any?): Instance
-
Change Records
v1.0.0
first
Function Illustrate
获得
Field
实例处理类。
若有多个 Field
结果只会返回第一个。
Function Example
你可以轻松地得到 Field
的实例以及使用它进行设置实例。
The following example
field {
- // Your code here.
-}.get(instance).set("something")
-
如果你取到的是静态 Field
,可以不需要设置实例。
The following example
field {
- // Your code here.
-}.get().set("something")
-
fun all(instance: Any?): ArrayList<Instance>
-
Change Records
v1.0.0
first
Function Illustrate
获得
Field
实例处理类数组。
返回全部查找条件匹配的多个 Field
实例结果。
Function Example
你可以通过此方法来获得当前条件结果中匹配的全部 Field
,其 Field
所在实例用法与 get
相同。
The following example
field {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.self
-}
-
fun give(): Field?
-
Change Records
v1.0.0
first
Function Illustrate
得到
Field
本身。
若有多个 Field 结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
fun giveAll(): HashSet<Field>
-
Change Records
v1.0.0
first
Function Illustrate
得到
Field
本身数组。
返回全部查找条件匹配的多个 Field
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
获得
Field
实例处理类,配合RemedyPlan
使用。
若有多个 Field
结果只会返回第一个。
Pay Attention
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
获得
Field
实例处理类数组,配合RemedyPlan
使用。
返回全部查找条件匹配的多个 Field
实例结果。
Pay Attention
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建
Field
重查找功能。
Function Example
当你遇到一种 Field
可能存在不同形式的存在时,可以使用 RemedyPlan
重新查找它,而没有必要使用 onNoSuchField
捕获异常二次查找 Field
。
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
The following example
field {
- // Your code here.
-}.remedys {
- field {
- // Your code here.
- }
- field {
- // Your code here.
- }
-}
-
fun onNoSuchField(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
监听找不到
Field
时。
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
忽略异常并停止打印任何错误日志。
Notice
此时若要监听异常结果,你需要手动实现 onNoSuchField 方法。
inner class Instance internal constructor(private val instance: Any?, private val field: Field?)
-
Change Records
v1.0.0
first
Function Illustrate
Field
实例变量处理类。
fun current(ignored: Boolean): CurrentClass?
-
inline fun current(ignored: Boolean, initiate: CurrentClass.() -> Unit): Any?
-
Change Records
v1.0.0
first
Function Illustrate
获得当前
Field
自身self
实例的类操作对象CurrentClass
。
fun <T> cast(): T?
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
实例。
fun byte(): Byte?
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Byte 实例。
fun int(): Int
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Int 实例。
fun long(): Long
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Long 实例。
fun short(): Short
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Short 实例。
fun double(): Double
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Double 实例。
fun float(): Float
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Float 实例。
fun string(): String
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
String 实例。
fun char(): Char
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Char 实例。
fun boolean(): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Boolean 实例。
fun any(): Any?
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Any 实例。
inline fun <reified T> array(): Array<T>
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
Array 实例。
inline fun <reified T> list(): List<T>
-
Change Records
v1.0.0
first
Function Illustrate
得到当前
Field
List 实例。
fun set(any: Any?)
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Field
实例。
fun setTrue()
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Field
实例为true
。
Pay Attention
请确保实例对象类型为 Boolean。
fun setFalse()
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Field
实例为false
。
Pay Attention
请确保实例对象类型为 Boolean。
fun setNull()
-
Change Records
v1.0.0
first
Function Illustrate
设置当前
Field
实例为null
。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
class MethodFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
Change Records
v1.0.0
first
Function Illustrate
Method
查找类。
可通过指定类型查找指定 Method
或一组 Method
。
var name: String
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
名称。
Pay Attention
若不填写名称则必须存在一个其它条件。
var paramCount: Int
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
var returnType: Any?
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
返回值,可不填写返回值。
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
标识符筛选条件。
可不设置筛选条件。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun emptyParam(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
空参数、无参数。
fun param(vararg paramType: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Method
中存在一些无意义又很长的类型,你可以使用 VagueType 来替代它。
Pay Attention
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数条件。
Pay Attention
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun order(): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
顺序筛选字节码的下标。
fun name(value: String): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
名称。
Pay Attention
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun name(conditions: NameConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
名称条件。
Pay Attention
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(num: Int): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数。
若参数个数小于零则忽略并使用 param
。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(numRange: IntRange): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun returnType(value: Any): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
返回值。
可不填写返回值。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun returnType(conditions: ObjectConditions): IndexTypeCondition
-
Change Records
v1.0.0
first
Function Illustrate
设置
Method
返回值条件。
可不填写返回值。
Pay Attention
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun superClass(isOnlySuperClass: Boolean)
-
Change Records
v1.0.0
first
Function Illustrate
设置在
classSet
的所有父类中查找当前Method
。
Notice
若当前 classSet 的父类较多可能会耗时,API 会自动循环到父类继承是 Any 前的最后一个类。
inner class RemedyPlan internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
Method
重查找实现类,可累计失败次数直到查找成功。
inline fun method(initiate: MethodConditions): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建需要重新查找的
Method
。
你可以添加多个备选 Method
,直到成功为止,若最后依然失败,将停止查找并输出错误日志。
inner class Result internal constructor()
-
Change Records
v1.0.0
first
Function Illustrate
RemedyPlan
结果实现类。
fun onFind(initiate: HashSet<Method>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
当在
RemedyPlan
中找到结果时。
Function Example
你可以方便地对重查找的 Method
实现 onFind
方法。
The following example
method {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
Change Records
v1.0.0
first
Function Illustrate
Method
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建监听结果事件方法体。
Function Example
你可以使用 lambda
形式创建 Result
类。
The following example
method {
- // Your code here.
-}.result {
- get(instance).call()
- all(instance)
- remedys {}
- onNoSuchMethod {}
-}
-
fun get(instance: Any?): Instance
-
Change Records
v1.0.0
first
Function Illustrate
获得
Method
实例处理类。
若有多个 Method
结果只会返回第一个。
Pay Attention
若你设置了 remedys 请使用 wait 回调结果方法。
Function Example
你可以通过获得方法所在实例来执行 Method
。
The following example
method {
- // Your code here.
-}.get(instance).call()
-
若当前为静态方法,你可以不设置实例。
The following example
method {
- // Your code here.
-}.get().call()
-
fun all(instance: Any?): ArrayList<Instance>
-
Change Records
v1.0.0
first
Function Illustrate
获得
Method
实例处理类数组。
返回全部查找条件匹配的多个 Method
实例结果。
Function Example
你可以通过此方法来获得当前条件结果中匹配的全部 Method
,其方法所在实例用法与 get
相同。
The following example
method {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.call(...)
-}
-
fun give(): Method?
-
Change Records
v1.0.0
first
Function Illustrate
得到
Method
本身。
若有多个 Method
结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
fun giveAll(): HashSet<Method>
-
Change Records
v1.0.0
first
Function Illustrate
得到
Method
本身数组。
返回全部查找条件匹配的多个 Method
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
获得
Method
实例处理类,配合RemedyPlan
使用。
若有多个 Method
结果只会返回第一个。
Pay Attention
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
Change Records
v1.0.0
first
Function Illustrate
获得
Method
实例处理类数组,配合RemedyPlan
使用。
返回全部查找条件匹配的多个 Method
实例结果。
Pay Attention
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
创建
Method
重查找功能。
Function Example
当你遇到一种 Method
可能存在不同形式的存在时,可以使用 RemedyPlan
重新查找它,而没有必要使用 onNoSuchMethod
捕获异常二次查找 Method
。
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
The following example
method {
- // Your code here.
-}.remedys {
- method {
- // Your code here.
- }
- method {
- // Your code here.
- }
-}
-
inline fun onNoSuchMethod(result: (Throwable) -> Unit): Result
-
Change Records
v1.0.0
first
Function Illustrate
监听找不到
Method
时。
只会返回第一次的错误信息,不会返回 RemedyPlan
的错误信息。
fun ignored(): Result
-
Change Records
v1.0.0
first
Function Illustrate
忽略异常并停止打印任何错误日志。
Notice
此时若要监听异常结果,你需要手动实现 onNoSuchMethod 方法。
inner class Instance internal constructor(private val instance: Any?, private val method: Method?)
-
Change Records
v1.0.0
first
Function Illustrate
Method
实例处理类。
fun call(vararg args: Any?): Any?
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,不指定返回值类型。
fun <T> invoke(vararg args: Any?): T?
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定T
返回值类型。
fun byte(vararg args: Any?): Byte?
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Byte 返回值类型。
fun int(vararg args: Any?): Int
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Int 返回值类型。
fun long(vararg args: Any?): Long
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Long 返回值类型。
fun short(vararg args: Any?): Short
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Short 返回值类型。
fun double(vararg args: Any?): Double
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Double 返回值类型。
fun float(vararg args: Any?): Float
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Float 返回值类型。
fun string(vararg args: Any?): String
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 String 返回值类型。
fun char(vararg args: Any?): Char
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Char 返回值类型。
fun boolean(vararg args: Any?): Boolean
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Boolean 返回值类型。
inline fun <reified T> array(vararg args: Any?): Array<T>
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 Array 返回值类型。
inline fun <reified T> list(vararg args: Any?): List<T>
-
Change Records
v1.0.0
first
Function Illustrate
执行
Method
,指定 List 返回值类型。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
这是一个预置反射类型的常量类,主要为
Android
相关组件的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
这是一个预置反射类型的常量类,主要为
Android
相关Graphics
的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
这是一个预置反射类型的常量类,主要为
Android
相关Widget
的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
这是一个内部类型的定义常量类,主要用于反射 API 相关用法的延伸。
val VagueType: Class<*>
-
Change Records
v1.0.0
first
Function Illustrate
得到模糊类型。
Notice
The English translation of this page has not been completed, you are welcome to contribute translations to us.
You can use the Chrome Translation Plugin to translate entire pages for reference.
Change Records
v1.0.0
first
Function Illustrate
这是一个预置反射类型的常量类,主要为
Java
相关基本变量类型的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
The basic configuration method of
YukiReflection
is introduced here.
YukiReflection
can be used directly without some complex configuration, and does not conflict with Java
's native Reflection API.
You can configure some functions of YukiReflection
before using it.
You can get the current API version of YukiReflection
as follows.
The following example
// Get the version name
-val versionName = YukiReflection. API_VERSION_NAME
-// Get the version code
-val versionCode = YukiReflection. API_VERSION_CODE
-
You can judge the difference between different versions or display it in the about information by obtaining the version.
Tips
For more functions, please refer to YukiReflection.
You can configure related functions through YukiReflection.configs { ... }
method or YukiReflection.Configs
.
You can use the following methods to customize the tag of the debug log.
Logs inside the API will be printed using this tag.
The following example
// Via the configs method
-YukiReflection.configs {
- debugTag = "YourCustomTag"
-}
-// Set directly
-YukiReflection.Configs.debugTag = "YourCustomTag"
-
You can use the following methods to enable or disable Debug mode.
The Debug mode is disabled by default, and when enabled, detailed logs (such as the time spent on the reflective search function) will be printed to the console.
The following example
// Via the configs method
-YukiReflection.configs {
- isDebug = true
-}
-// Set directly
-YukiReflection.Configs.isDebug = true
-
You can use the following methods to enable or disable debug logs.
This function is enabled by default, and disable will stop YukiReflection
output all logs.
The following example
// Via the configs method
-YukiReflection.configs {
- isAllowPrintingLogs = true
-}
-// Set directly
-YukiReflection.Configs.isAllowPrintingLogs = true
-
In order to configure multiple features at once, you can directly use the YukiReflection.configs { ... }
method to configure.
The following example
YukiReflection.configs {
- debugTag = "YourCustomTag"
- isDebug = true
- isAllowPrintingLogs = true
-}
-
Tips
For more functions, please refer to YukiReflection.configs method, YukiReflection.Configs.
YukiReflection
is a Reflection API based on the Java and Android platform.
This is a set of simple and efficient Reflection API rebuilt based on Java
native Reflection API using Kotlin
.
YukiReflection
is also the core functionality that YukiHookAPI is using.
The name is taken from "ももくり" heroine Yuki Kurihara.
YukiReflection
is fully built with Kotlin
lambda
syntax.
It can replace Java's native Reflection API and implement a more complete reflection solution in a more human-friendly language.
Please use Kotlin
, the code composition of the API part is also compatible with Java
, but the implementation of the basic reflection scene may not be used at all.
All Demo sample codes in the document will be described using Kotlin
, if you don’t know how to use Kotlin
at all, you may not be able to use YukiReflection
.
YukiReflection
was originally the core function integrated in the YukiHookAPI project, and now it is decoupled so that this Reflection API can be used in any Java and Android platform project.
Now, we only need to write a small amount of code to implement a simple reflection call.
With Kotlin
elegant lambda
and YukiReflection
, you can make your reflection logic more beautiful and clear.
The following example
"android.os.SystemProperties".toClass()
- .method {
- name = "get"
- param(StringClass, StringClass)
- }.get().call("ro.system.build.fingerprint", "none")
-
Class.forName("android.os.SystemProperties")
- .getDeclaredMethod("get", String::class.java, String::class.java)
- .apply { isAccessible = true }
- .invoke(null, "ro.system.build.fingerprint", "none")
-
Integrate
YukiReflection
into your project.
Windows 7 and above / macOS 10.14 and above / Linux distributions (Arch/Debian)
Android Studio 2021.1 and above
IntelliJ IDEA 2021.1 and above
Kotlin 1.7.0 and above
Android Gradle Plugin 7.0 and above
Gradle 7.0 and above
Java 11 and above
The project needs to be created using Android Studio
or IntelliJ IDEA
and the type is an Java or Android project and the Kotlin
environment dependency has been integrated.
We recommend using Kotlin DSL as the Gradle build script language and SweetDependency to manage dependencies.
Add the repositories and dependencies in your project's SweetDependency
configuration file.
The following example
repositories:
- # MavenCentral has a 2-hour cache,
- # if the latest version cannot be integrated, please add this
- sonatype-oss-releases:
-
-libraries:
- com.highcapable.yukireflection:
- api:
- version: +
- ...
-
After adding it, run Gradle Sync and all dependencies will be autowired.
Next, deploy dependencies in your project build.gradle.kts
.
The following example
dependencies {
- implementation(com.highcapable.yukireflection.api)
- // ...
-}
-
Add repositories in your project build.gradle.kts
or build.gradle
.
Kotlin DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL
- maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
-}
-
Groovy DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral has a 2-hour cache, if the latest version cannot be integrated, please add this URL
- maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
-}
-
Add dependencies in your project build.gradle.kts
or build.gradle
.
Kotlin DSL
dependencies {
- implementation("com.highcapable.yukireflection:api:<yuki-version>")
- // ...
-}
-
Groovy DSL
dependencies {
- implementation 'com.highcapable.yukireflection:api:<yuki-version>'
- // ...
-}
-
Please change <yuki-version> to the latest version here.
Pay Attention
If your project is currently using the 1.x.x version of YukiHookAPI, please do not integrate YukiReflection repeatedly, because YukiHookAPI already includes it functions and there are changes to related functions.
Repeated integration will cause functional conflicts and cause exceptions.
In this case, you should go to the Documentation of YukiHookAPI view the corresponding usage tutorial.
YukiHookAPI will be completely separated from YukiReflection in version 2.x.x, by which time you can use it with YukiHookAPI at the same time.
Modify the Java version of Kotlin in your project build.gradle.kts
or build.gradle
to 11 or above.
Kotlin DSL
android {
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = "11"
- }
-}
-
Groovy DSL
android {
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = '11'
- }
-}
-
此文档由 VuePress 强力驱动。
MIT License
-
-Copyright (C) 2019-2023 HighCapable
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
版权所有 © 2019-2023 HighCapable
这里记录了
YukiReflection
的版本更新历史。
特别注意
我们只会对最新的 API 版本进行维护,若你正在使用过时的 API 版本则代表你自愿放弃一切维护的可能性。
Member
缓存未生效且持续存储最终引发 APP 内存溢出 (OOM),感谢 Art-ChenMember
的直接缓存功能并作废 YukiReflection.Configs.isEnableMemberCache
Class
的缓存功能Sequence
,优化 Member
的查找速度与性能type
中的错误 Class
对象声明如在使用中有任何问题,或有任何建设性的建议,都可以联系我们。
加入我们 点击加入 Telegram 群组、点击加入 Telegram 群组 (开发者)。
在 酷安 找到我 @星夜不荟。
感谢您选择并使用 YukiReflection
,如有代码相关的建议和请求,可在 GitHub 提交 Pull Request。
未来是美好的,也是不确定的,让我们共同期待
YukiReflection
在未来的发展空间。
这里收录了
YukiReflection
可能会在后期添加的功能。
使用 stub
的方式创建一个 Kotlin
类,并声明其中的参数,以及其在各个版本中的不同状态。
比如下面的这个 Java
类就是我们需要反射的目标类。
示例如下
package com.example.test;
-
-public class MyClass {
-
- private String myField = "test";
-
- public MyClass() {
- // ...
- }
-
- private String myMethod1(String var1, int var2) {
- // ...
- }
-
- private void myMethod2() {
- // ...
- }
-
- private void myMethod3(String var1) {
- // ...
- }
-}
-
通过目前 API 的现有用法可以使用如下方式反射调用这个类。
示例如下
classOf<MyClass>().buildOf().current {
- // 调用 myField
- val value = field { name = "myField" }.string()
- // 调用 myMethod1
- val methodValue = method { name = "myMethod1" }.string("test", 0)
- // 调用 myMethod2
- method { name = "myMethod2" }.call()
- // 调用 myMethod3
- method { name = "myMethod3" }.call("test")
-}
-
目前要实现的功能是可以使用反射功能直接定义为如下 Kotlin
类。
示例如下
package com.example.test
-
-@ReflectClass
-class MyClass {
-
- @ReflectField
- val myField: String = fieldValueOf("none")
-
- @ReflectMethod
- fun myMethod1(var1: String, var2: Int): String = methodReturnValueOf("none")
-
- @ReflectMethod
- fun myMethod2() = MethodReturnType.Unit
-
- @ReflectMethod
- fun myMethod3(var1: String) = MethodReturnType.Unit
-}
-
然后我们就可以直接调用这个定义好的 Kotlin
类来实现反射功能,API 会根据注解自动生成反射代码。
示例如下
MyClass().also {
- // 调用 myField
- val value = it.myField
- // 调用 myMethod1
- val methodValue = it.myMethod1("test", 0)
- // 调用 myMethod2
- it.myMethod2()
- // 调用 myMethod3
- it.myMethod3("test")
-}
-
小提示
以上功能可能会在实际推出后有所变化,最终以实际版本的功能为准。
这里包含了
YukiReflection
全部核心功能的用法示例。
这里是 Class 对象自身相关的扩展功能。
假设我们要得到一个不能直接调用的 Class
,通常情况下,我们可以使用标准的反射 API 去查找这个 Class
。
示例如下
// 默认 ClassLoader 环境下的 Class
-var instance = Class.forName("com.demo.Test")
-// 指定 ClassLoader 环境下的 Class
-val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-var instance = customClassLoader?.loadClass("com.demo.Test")
-
这种写法大概不是很友好,此时 YukiReflection
就为你提供了一个可在任意地方使用的语法糖。
以上写法换做 YukiReflection
可写作如下形式。
示例如下
// 直接得到这个 Class
-var instance = "com.demo.Test".toClass()
-// 自定义 Class 所在的 ClassLoader
-val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-var instance = "com.demo.Test".toClass(customClassLoader)
-
如果当前 Class
并不存在,使用上述方法会抛出异常,如果你不确定 Class
是否存在,可以参考下面的解决方案。
示例如下
// 直接得到这个 Class
-// 得不到时结果会为 null 但不会抛出异常
-var instance = "com.demo.Test".toClassOrNull()
-// 自定义 Class 所在的 ClassLoader
-val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-// 得不到时结果会为 null 但不会抛出异常
-var instance = "com.demo.Test".toClassOrNull(customClassLoader)
-
我们还可以通过映射来得到一个存在的 Class
对象。
示例如下
// 假设这个 Class 是能够被直接得到的
-var instance = classOf<Test>()
-// 我们同样可以自定义 Class 所在的 ClassLoader,这对于 stub 来说非常有效
-val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-var instance = classOf<Test>(customClassLoader)
-
小提示
更多功能请参考 classOf、String.toClass、String.toClassOrNull 方法。
假设我们要判断一个 Class
是否存在,通常情况下,我们可以使用标准的反射 API 去查找这个 Class
通过异常来判断是否存在。
示例如下
// 默认 ClassLoader 环境下的 Class
-var isExist = try {
- Class.forName("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-// 指定 ClassLoader 环境下的 Class
-val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-var isExist = try {
- customClassLoader?.loadClass("com.demo.Test")
- true
-} catch (_: Throwable) {
- false
-}
-
这种写法大概不是很友好,此时 YukiReflection
就为你提供了一个可在任意地方使用的语法糖。
以上写法换做 YukiReflection
可写作如下形式。
示例如下
// 判断这个 Class 是否存在
-var isExist = "com.demo.Test".hasClass()
-// 自定义 Class 所在的 ClassLoader
-val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-var isExist = "com.demo.Test".hasClass(customClassLoader)
-
小提示
更多功能请参考 String.hasClass 方法。
在 R8 等工具混淆后的当前 APP Dex 中的 Class
名称将会难以分辨,且不确定其正确位置,不能直接通过 对象转换 来得到。
此时就有了 DexClassFinder
,它的作用是通过需要查找的 Class
中的字节码特征来确定这个 Class
的实例。
注意
此功能仅适用于 Android 平台。
目前 DexClassFinder 的功能尚在试验阶段,由于仅通过 Java 层实现查找功能,在当前 APP Class 过多时性能可能不能达到最佳水平,如果发生查找不到、定位有误的问题欢迎向我们反馈。
由于是反射层面的 API,目前它只能通过类与成员的特征来定位指定的 Class,不能通过指定字节码中的字符串和方法内容特征来进行定位。
查找 Class 的速度取决于当前设备的性能,目前主流的移动端处理器在 10~15w 数量的 Class 中条件不算复杂的情况下大概在 3~10s 区间,条件稍微复杂的情况下最快速度能达到 25s 以内,匹配到的同类型 Class 越多速度越慢。
特别注意
在 YukiHookAPI 发布 2.x.x 版本后,此功能将被标记为作废,且将会直接从 YukiReflection 中移除。
我们欢迎各位开发者开始使用 DexKit,它是一个使用 C++ 实现的 Dex 高性能运行时解析库,在性能方面比 Java 层更加高效与优秀,目前尚在开发阶段,欢迎提出宝贵建议。
下面是一个简单的用法示例。
假设下面这个 Class
是我们想要得到的,其中的名称经过了混淆,在每个版本可能都不一样。
示例如下
package com.demo;
-
-public class a extends Activity implements Serializable {
-
- public a(String var1) {
- // ...
- }
-
- private String a;
-
- private String b;
-
- private boolean a;
-
- protected void onCreate(Bundle var1) {
- // ...
- }
-
- private static void a(String var1) {
- // ...
- }
-
- private String a(boolean var1, String var2) {
- // ...
- }
-
- private void a() {
- // ...
- }
-
- public void a(boolean var1, a var2, b var3, String var4) {
- // ...
- }
-}
-
此时,我们想得到这个 Class
,可以直接使用 ClassLoader.searchClass
方法。
下方演示的条件中每一个都是可选的,条件越复杂定位越精确,同时性能也会越差。
示例如下
searchClass {
- // 从指定的包名范围开始查找,实际使用时,你可以同时指定多个包名范围
- from("com.demo")
- // 指定当前 Class 的 getSimpleName 的结果,你可以直接对这个字符串进行逻辑判断
- // 这里我们不确定它的名称是不是 a,可以只判断字符串长度
- simpleName { it.length == 1 }
- // 指定继承的父类对象,如果是存在的 stub,可以直接用泛型表示
- extends<Activity>()
- // 指定继承的父类对象,可以直接写为完整类名,你还可以同时指定多个
- extends("android.app.Activity")
- // 指定实现的接口,如果是存在的 stub,可以直接用泛型表示
- implements<Serializable>()
- // 指定实现的接口,可以直接写为完整类名,你还可以同时指定多个
- implements("java.io.Serializable")
- // 指定构造方法的类型与样式,以及在当前类中存在的个数 count
- constructor { param(StringClass) }.count(num = 1)
- // 指定变量的类型与样式,以及在当前类中存在的个数 count
- field { type = StringClass }.count(num = 2)
- // 指定变量的类型与样式,以及在当前类中存在的个数 count
- field { type = BooleanType }.count(num = 1)
- // 直接指定所有变量在当前类中存在的个数 count
- field().count(num = 3)
- // 如果你认为变量的个数是不确定的,还可以使用如下自定义条件
- field().count(1..3)
- field().count { it >= 3 }
- // 指定方法的类型与样式,以及在当前类中存在的个数 count
- method {
- name = "onCreate"
- param(BundleClass)
- }.count(num = 1)
- // 指定方法的类型与样式,同时指定修饰符,以及在当前类中存在的个数 count
- method {
- modifiers { isStatic && isPrivate }
- param(StringClass)
- returnType = UnitType
- }.count(num = 1)
- // 指定方法的类型与样式,同时指定修饰符,以及在当前类中存在的个数 count
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, StringClass)
- returnType = StringClass
- }.count(num = 1)
- // 指定方法的类型与样式,同时指定修饰符,以及在当前类中存在的个数 count
- method {
- modifiers { isPrivate && isStatic.not() }
- emptyParam()
- returnType = UnitType
- }.count(num = 1)
- // 指定方法的类型与样式,同时指定修饰符和模糊类型 VagueType,以及在当前类中存在的个数 count
- method {
- modifiers { isPrivate && isStatic.not() }
- param(BooleanType, VagueType, VagueType, StringClass)
- returnType = UnitType
- }.count(num = 1)
- // 直接指定所有方法在当前类中存在的个数 count
- method().count(num = 5)
- // 如果你认为方法的个数是不确定的,还可以使用如下自定义条件
- method().count(1..5)
- method().count { it >= 5 }
- // 直接指定所有成员 (Member) 在当前类中存在的个数 count
- // 成员包括:Field (变量)、Method (方法)、Constructor (构造方法)
- member().count(num = 9)
- // 所有成员中一定存在一个 static 修饰符,可以这样加入此条件
- member {
- modifiers { isStatic }
- }
-}.get() // 得到这个 Class 本身的实例,找不到会返回 null
-
小提示
上述用法中对于 Field、Method、Constructor 的条件用法与 Member 扩展 中的相关用法是一致的,仅有小部分区别。
更多功能请参考 MemberRules、FieldRules、MethodRules、ConstructorRules。
默认情况下 DexClassFinder
会使用同步方式查找 Class
,会阻塞当前线程直到找到或找不到发生异常为止,若查找消耗的时间过长,可能会导致当前 APP 发生 ANR 问题。
针对上述问题,我们可以启用异步,只需要加入参数 async = true
,这将不需要你再次启动一个线程,API 已帮你处理好相关问题。
注意
若要使用此功能,你需要在方法参数首位传入当前 APP 的 Context。
对于异步情况下你需要使用 wait 方法来得到结果,get 方法将不再起作用。
示例如下
val context: Context // 假设这就是当前 APP 的 Context
-searchClass(context, async = true) {
- // ...
-}.wait { class1 ->
- // 得到异步结果
-}
-searchClass(context, async = true) {
- // ...
-}.wait { class2 ->
- // 得到异步结果
-}
-
这样我们的查找过程就是异步运行了,它将不会阻塞主线程,每个查找都将在单独的线程同时进行,可达到并行任务的效果。
由于每次重新打开当前 APP 都会重新进行查找,在当前 APP 版本不变的情况下这是一种重复性能浪费。
此时我们可以通过指定 name
参数来对当前 APP 版本的查找结果进行本地缓存,下一次将直接从本地缓存中读取查找到的类名。
本地缓存使用的是 SharedPreferences
,它将被保存到当前 APP 的数据目录中,在当前 APP 版本更新后会重新进行缓存。
启用本地缓存后,将同时设置 async = true
,你可以不需要再手动进行设置。
注意
若要使用此功能,你需要在方法参数首位传入当前 APP 的 Context。
示例如下
val context: Context // 假设这就是当前 APP 的 Context
-searchClass(context, name = "com.demo.class1") {
- // ...
-}.wait { class1 ->
- // 得到异步结果
-}
-searchClass(context, name = "com.demo.class2") {
- // ...
-}.wait { class2 ->
- // 得到异步结果
-}
-
如果你想手动清除本地缓存,可以使用如下方法清除当前 APP 版本的缓存。
示例如下
val context: Context // 假设这就是当前 APP 的 Context
-DexClassFinder.clearCache(context)
-
你还可以清除指定版本的 APP 缓存。
示例如下
val context: Context // 假设这就是当前 APP 的 Context
-DexClassFinder.clearCache(context, versionName = "1.0", versionCode = 1)
-
如果你需要使用固定的条件同时查找一组 Class
,那么你只需要使用 all
或 waitAll
方法来得到结果。
// 同步查找,使用 all 得到条件全部查找到的结果
-searchClass {
- // ...
-}.all().forEach { clazz ->
- // 得到每个结果
-}
-// 同步查找,使用 all { ... } 遍历每个结果
-searchClass {
- // ...
-}.all { clazz ->
- // 得到每个结果
-}
-// 异步查找,使用 waitAll 得到条件全部查找到的结果
-val context: Context // 假设这就是当前 APP 的 Context
-searchClass(context, async = true) {
- // ...
-}.waitAll { classes ->
- classes.forEach {
- // 得到每个结果
- }
-}
-
小提示
更多功能请参考 ClassLoader.searchClass 方法。
这里是 Class 字节码成员变量 Field、Method、Constructor 相关的扩展功能。
小提示
Member 是 Field、Method、Constructor 的接口描述对象,它在 Java 反射中为 Class 中字节码成员的总称。
假设有一个这样的 Class
。
示例如下
package com.demo;
-
-public class BaseTest {
-
- public BaseTest() {
- // ...
- }
-
- public BaseTest(boolean isInit) {
- // ...
- }
-
- private void doBaseTask(String taskName) {
- // ...
- }
-}
-
package com.demo;
-
-public class Test extends BaseTest {
-
- public Test() {
- // ...
- }
-
- public Test(boolean isInit) {
- // ...
- }
-
- private static TAG = "Test";
-
- private BaseTest baseInstance;
-
- private String a;
-
- private boolean a;
-
- private boolean isTaskRunning = false;
-
- private static void init() {
- // ...
- }
-
- private void doTask(String taskName) {
- // ...
- }
-
- private void release(String taskName, Function<boolean, String> task, boolean isFinish) {
- // ...
- }
-
- private void stop() {
- // ...
- }
-
- private String getName() {
- // ...
- }
-
- private void b() {
- // ...
- }
-
- private void b(String a) {
- // ...
- }
-}
-
假设我们要得到 Test
(以下统称“当前 Class
”)的 doTask
方法并执行,通常情况下,我们可以使用标准的反射 API 去查找这个方法。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用反射 API 调用并执行
-Test::class.java
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(instance, "task_name")
-
这种写法大概不是很友好,此时 YukiReflection
就为你提供了一个可在任意地方使用的语法糖。
以上写法换做 YukiReflection
可写作如下形式。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "doTask"
- param(StringClass)
-}.get(instance).call("task_name")
-
小提示
更多功能请参考 MethodFinder。
同样地,我们需要得到 isTaskRunning
变量也可以写作如下形式。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.field {
- name = "isTaskRunning"
- type = BooleanType
-}.get(instance).any() // any 为 Field 的任意类型实例化对象
-
小提示
更多功能请参考 FieldFinder。
也许你还想得到当前 Class
的构造方法,同样可以实现。
示例如下
Test::class.java.constructor {
- param(BooleanType)
-}.get().call(true) // 可创建一个新的实例
-
若想得到的是 Class
的无参构造方法,可写作如下形式。
示例如下
Test::class.java.constructor().get().call() // 可创建一个新的实例
-
小提示
更多功能请参考 ConstructorFinder。
假设我们要得到 Class
中的 getName
方法,可以使用如下实现。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "getName"
- emptyParam()
- returnType = StringClass
-}.get(instance).string() // 得到方法的结果
-
通过观察发现,这个 Class
中只有一个名为 getName
的方法,那我们可不可以再简单一点呢?
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "getName"
- emptyParam()
-}.get(instance).string() // 得到方法的结果
-
是的,对于确切不会变化的方法,你可以精简查找条件。
在只使用 get
或 wait
方法得到结果时 YukiReflection
会默认按照字节码顺序匹配第一个查找到的结果。
问题又来了,这个 Class
中有一个 release
方法,但是它的方法参数很长,而且部分类型可能无法直接得到。
通常情况下我们会使用 param(...)
来查找这个方法,但是有没有更简单的方法呢。
此时,在确定方法唯一性后,你可以使用 paramCount
来查找到这个方法。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "release"
- // 此时我们不必确定方法参数具体类型,写个数就好
- paramCount = 3
-}.get(instance) // 得到这个方法
-
上述示例虽然能够匹配成功,但是不精确,此时你还可以使用 VagueType
来填充你不想填写的方法参数类型。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "release"
- // 使用 VagueType 来填充不想填写的类型,同时保证其它类型能够匹配
- param(StringClass, VagueType, BooleanType)
-}.get(instance) // 得到这个方法
-
如果你并不确定每一个参数的类型,你可以通过 param { ... }
方法来创建一个条件方法体。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "release"
- // 得到 it (Class) 方法参数类型数组实例来仅判断已知的类型和它的位置
- param { it[0] == StringClass && it[2] == BooleanType }
-}.get(instance) // 得到这个方法
-
小提示
使用 param { ... } 创建一个条件方法体,其中的变量 it 即当前方法参数的 Class 类型数组实例,此时你就可以自由使用 Class 中的所有对象及其方法。
方法体末尾条件需要返回一个 Boolean,即最终的条件判断结果。
更多功能请参考 FieldFinder.type、MethodFinder.param、MethodFinder.returnType、ConstructorFinder.param 方法。
你会注意到 Test
继承于 BaseTest
,现在我们想得到 BaseTest
的 doBaseTask
方法,在不知道父类名称的情况下,要怎么做呢?
参照上面的查找条件,我们只需要在查找条件中加入一个 superClass
即可实现这个功能。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // 只需要添加这个条件
- superClass()
-}.get(instance).call("task_name")
-
这个时候我们就可以在父类中取到这个方法了。
superClass
有一个参数为 isOnlySuperClass
,设置为 true
后,可以跳过当前 Class
仅查找当前 Class
的父类。
由于我们现在已知 doBaseTask
方法只存在于父类,可以加上这个条件节省查找时间。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "doBaseTask"
- param(StringClass)
- // 加入一个查找条件
- superClass(isOnlySuperClass = true)
-}.get(instance).call("task_name")
-
这个时候我们同样可以得到父类中的这个方法。
superClass
一旦设置就会自动循环向后查找全部继承的父类中是否有这个方法,直到查找到目标没有父类(继承关系为 java.lang.Object
)为止。
特别注意
当前查找的 Method 除非指定 superClass 条件,否则只能查找到当前 Class 的 Method,这是 Java 反射 API 的默认行为。
如果我们想查找一个方法名称,但是又不确定它在每个版本中是否发生变化,此时我们就可以使用模糊查找功能。
假设我们要得到 Class
中的 doTask
方法,可以使用如下实现。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name {
- // 设置名称不区分大小写
- it.equals("dotask", isIgnoreCase = true)
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
已知当前 Class
中仅有一个 doTask
方法,我们还可以判断方法名称仅包含其中指定的字符。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name {
- // 仅包含 oTas
- it.contains("oTas")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
我们还可以根据首尾字符串进行判断。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name {
- // 开头包含 do,结尾包含 Task
- it.startsWith("do") && it.endsWith("Task")
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
通过观察发现这个方法名称中只包含字母,我们还可以再增加一个精确的查找条件。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name {
- // 开头包含 do,结尾包含 Task,仅包含字母
- it.startsWith("do") && it.endsWith("Task") && it.isOnlyLetters()
- }
- param(StringClass)
-}.get(instance).call("task_name")
-
小提示
使用 name { ... } 创建一个条件方法体,其中的变量 it 即当前名称的字符串,此时你就可以在 NameRules 的扩展方法中自由使用其中的功能。
方法体末尾条件需要返回一个 Boolean,即最终的条件判断结果。
更多功能请参考 FieldFinder.name、MethodFinder.name 方法以及 NameRules。
有些时候,我们可能需要查找一个 Class
中具有相同特征的一组方法、构造方法、变量,此时,我们就可以利用相对条件匹配来完成。
在查找条件结果的基础上,我们只需要把 get
换为 all
即可得到匹配条件的全部字节码。
假设这次我们要得到 Class
中方法参数个数范围在 1..3
的全部方法,可以使用如下实现。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- paramCount(1..3)
-}.all(instance).forEach { instance ->
- // 调用执行每个方法
- instance.call(...)
-}
-
上述示例可完美匹配到如下 3 个方法。
private void doTask(String taskName)
private void release(String taskName, Function<boolean, String> task, boolean isFinish)
private void b(String a)
如果你想更加自由地定义参数个数范围的条件,可以使用如下实现。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- paramCount { it < 3 }
-}.all(instance).forEach { instance ->
- // 调用执行每个方法
- instance.call(...)
-}
-
上述示例可完美匹配到如下 6 个方法。
private static void init()
private void doTask(String taskName)
private void stop(String a)
private void getName(String a)
private void b()
private void b(String a)
通过观察 Class
中有两个名称为 b
的方法,可以使用如下实现。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "b"
-}.all(instance).forEach { instance ->
- // 调用执行每个方法
- instance.call(...)
-}
-
上述示例可完美匹配到如下 2 个方法。
private void b()
private void b(String a)
小提示
使用 paramCount { ... } 创建一个条件方法体,其中的变量 it 即当前参数个数的整数,此时你就可以在 CountRules 的扩展方法中自由使用其中的功能。
方法体末尾条件需要返回一个 Boolean,即最终的条件判断结果。
更多功能请参考 MethodFinder.paramCount、ConstructorFinder.paramCount 方法以及 CountRules。
有些方法和变量在 Class
中是静态的实现,这个时候,我们不需要传入实例就可以调用它们。
假设我们这次要得到静态变量 TAG
的内容。
示例如下
Test::class.java.field {
- name = "TAG"
- type = StringClass
-}.get().string() // Field 的类型是字符串,可直接进行 cast
-
假设 Class
中存在同名的非静态 TAG
变量,这个时候怎么办呢?
加入一个筛选条件即可。
示例如下
Test::class.java.field {
- name = "TAG"
- type = StringClass
- // 标识查找的这个变量需要是静态
- modifiers { isStatic }
-}.get().string() // Field 的类型是字符串,可直接进行 cast
-
我们还可以调用名为 init
的静态方法。
示例如下
Test::class.java.method {
- name = "init"
- emptyParam()
-}.get().call()
-
同样地,你可以标识它是一个静态。
示例如下
Test::class.java.method {
- name = "init"
- emptyParam()
- // 标识查找的这个方法需要是静态
- modifiers { isStatic }
-}.get().call()
-
小提示
使用 modifiers { ... } 创建一个条件方法体,此时你就可以在 ModifierRules 中自由使用其中的功能。
方法体末尾条件需要返回一个 Boolean,即最终的条件判断结果。
更多功能请参考 FieldFinder.modifiers、MethodFinder.modifiers、ConstructorFinder.modifiers 方法以及 ModifierRules。
你可能已经注意到了,这里给出的示例 Class
中有两个混淆的变量名称,它们都是 a
,这个时候我们要怎么得到它们呢?
有两种方案。
第一种方案,确定变量的名称和类型。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.field {
- name = "a"
- type = BooleanType
-}.get(instance).any() // 得到名称为 a 类型为 Boolean 的变量
-
第二种方案,确定变量的类型所在的位置。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.field {
- type(BooleanType).index().first()
-}.get(instance).any() // 得到第一个类型为 Boolean 的变量
-
以上两种情况均可得到对应的变量 private boolean a
。
同样地,这个 Class
中也有两个混淆的方法名称,它们都是 b
。
你也可以有两种方案来得到它们。
第一种方案,确定方法的名称和方法参数。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "b"
- param(StringClass)
-}.get(instance).call("test_string") // 得到名称为 b 方法参数为 [String] 的方法
-
第二种方案,确定方法的参数所在的位置。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- param(StringClass).index().first()
-}.get(instance).call("test_string") // 得到第一个方法参数为 [String] 的方法
-
由于观察到这个方法在 Class
的最后一个,那我们还有一个备选方案。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- order().index().last()
-}.get(instance).call("test_string") // 得到当前 Class 的最后一个方法
-
注意
请尽量避免使用 order 来筛选字节码的下标,它们可能是不确定的,除非你确定它在这个 Class 中的位置一定不会变。
上面介绍的调用字节码的方法都需要使用 get(instance)
才能调用对应的方法,有没有简单一点的办法呢?
此时,你可以在任意实例上使用 current
方法来创建一个调用空间。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 假设这个 Class 是不能被直接得到的
-instance.current {
- // 执行 doTask 方法
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
- // 执行 stop 方法
- method {
- name = "stop"
- emptyParam()
- }.call()
- // 得到 name
- val name = method { name = "getName" }.string()
-}
-
我们还可以用 superClass
调用当前 Class
父类的方法。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 假设这个 Class 是不能被直接得到的
-instance.current {
- // 执行父类的 doBaseTask 方法
- superClass().method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
-}
-
如果你不喜欢使用一个大括号的调用域来创建当前实例的命名空间,你可以直接使用 current()
方法。
示例如下
// 假设这就是这个 Class 的实例,这个 Class 是不能被直接得到的
-val instance = Test()
-// 执行 doTask 方法
-instance
- .current()
- .method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-// 执行 stop 方法
-instance
- .current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// 得到 name
-val name = instance.current().method { name = "getName" }.string()
-
同样地,它们之间可以连续调用,但不允许内联调用。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 假设这个 Class 是不能被直接得到的
-instance.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}.current()
- .method {
- name = "stop"
- emptyParam()
- }.call()
-// ❗注意,因为 current() 返回的是 CurrentClass 自身对象,所以不能像下面这样调用
-instance.current().current()
-
针对 Field
实例,还有一个便捷的方法,可以直接获取 Field
所在实例的对象。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 假设这个 Class 是不能被直接得到的
-instance.current {
- // <方案1>
- field {
- name = "baseInstance"
- }.current {
- method {
- name = "doBaseTask"
- param(StringClass)
- }.call("task_name")
- }
- // <方案2>
- field {
- name = "baseInstance"
- }.current()
- ?.method {
- name = "doBaseTask"
- param(StringClass)
- }?.call("task_name")
-}
-
注意
上述 current 方法相当于帮你调用了 CurrentClass 中的 field { ... }.any()?.current() 方法。
若不存在 CurrentClass 调用域,你需要使用 field { ... }.get(instance).current() 来进行调用。
问题又来了,我想使用反射的方式创建如下的实例并调用其中的方法,该怎么做呢?
示例如下
Test(true).doTask("task_name")
-
通常情况下,我们可以使用标准的反射 API 来调用。
示例如下
"com.demo.Test".toClass()
- .getDeclaredConstructor(Boolean::class.java)
- .apply { isAccessible = true }
- .newInstance(true)
- .apply {
- javaClass
- .getDeclaredMethod("doTask", String::class.java)
- .apply { isAccessible = true }
- .invoke(this, "task_name")
- }
-
但是感觉这种做法好麻烦,有没有更简洁的调用方法呢?
这个时候,我们还可以借助 buildOf
方法来创建一个实例。
示例如下
"com.demo.Test".toClass().buildOf(true) { param(BooleanType) }?.current {
- method {
- name = "doTask"
- param(StringClass)
- }.call("task_name")
-}
-
若你希望 buildOf
方法返回当前实例的类型,你可以在其中加入类型泛型声明,而无需使用 as
来 cast
目标类型。
这种情况多用于实例本身的构造方法是私有的,但是里面的方法是公有的,这样我们只需要对其构造方法进行反射创建即可。
示例如下
// 假设这个 Class 是能够直接被得到的
-val test = Test::class.java.buildOf<Test>(true) { param(BooleanType) }
-test.doTask("task_name")
-
小提示
更多功能请参考 CurrentClass 以及 Class.buildOf 方法。
假设有三个不同版本的 Class
,它们都是这个 APP 不同版本相同的 Class
。
这里面同样都有一个方法 doTask
,假设它们的功能是一样的。
版本 A 示例如下
public class Test {
-
- public void doTask() {
- // ...
- }
-}
-
版本 B 示例如下
public class Test {
-
- public void doTask(String taskName) {
- // ...
- }
-}
-
版本 C 示例如下
public class Test {
-
- public void doTask(String taskName, int type) {
- // ...
- }
-}
-
我们需要在不同的版本中得到这个相同功能的 doTask
方法,要怎么做呢?
此时,你可以使用 RemedyPlan
完成你的需求。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- param(StringClass)
- }.onFind {
- // 可在这里实现找到的逻辑
- }
- method {
- name = "doTask"
- param(StringClass, IntType)
- }.onFind {
- // 可在这里实现找到的逻辑
- }
-}.wait(instance) {
- // 得到方法的结果
-}
-
特别注意
使用了 RemedyPlan 的方法查找结果不能再使用 get 的方式得到方法实例,应当使用 wait 方法。
另外,你还可以在使用 多重查找 的情况下继续使用 RemedyPlan
。
示例如下
// 假设这就是这个 Class 的实例
-val instance = Test()
-// 使用 YukiReflection 调用并执行
-Test::class.java.method {
- name = "doTask"
- emptyParam()
-}.remedys {
- method {
- name = "doTask"
- paramCount(0..1)
- }.onFind {
- // 可在这里实现找到的逻辑
- }
- method {
- name = "doTask"
- paramCount(1..2)
- }.onFind {
- // 可在这里实现找到的逻辑
- }
-}.waitAll(instance) {
- // 得到方法的结果
-}
-
假设当前 APP 中不同版本中存在功能相同的 Class
但仅有 Class
的名称不一样。
版本 A 示例如下
public class ATest {
-
- public static void doTask() {
- // ...
- }
-}
-
版本 B 示例如下
public class BTest {
-
- public static void doTask() {
- // ...
- }
-}
-
这个时候我们想在每个版本都调用这个 Class
里的 doTask
方法该怎么做呢?
通常做法是判断 Class
是否存在。
示例如下
// 首先查找到这个 Class
-val currentClass =
- if("com.demo.ATest".hasClass()) "com.demo.ATest".toClass() else "com.demo.BTest".toClass()
-// 然后再查找这个方法并调用
-currentClass.method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
感觉这种方案非常的不优雅且繁琐,那么此时 YukiReflection
就为你提供了一个非常方便的 VariousClass
专门来解决这个问题。
现在,你可以直接使用以下方式获取到这个 Class
。
示例如下
VariousClass("com.demo.ATest", "com.demo.BTest").get().method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
若当前 Class
在指定的 ClassLoader
中存在,你可以在 get
中填入你的 ClassLoader
。
示例如下
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").get(customClassLoader).method {
- name = "doTask"
- emptyParam()
-}.get().call()
-
若你不确定所有的 Class
一定会被匹配到,你可以使用 getOrNull
方法。
示例如下
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-VariousClass("com.demo.ATest", "com.demo.BTest").getOrNull(customClassLoader)?.method {
- name = "doTask"
- emptyParam()
-}?.get()?.call()
-
小提示
更多功能请参考 VariousClass。
在反射过程中,我们可能会遇到泛型问题,在泛型的反射处理上,YukiReflection
同样提供了一个可在任意地方使用的语法糖。
例如我们有如下的泛型类。
示例如下
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // ...
- }
-}
-
当我们想在当前 Class
中获得泛型 T
或 R
的 Class
实例,只需要如下实现。
示例如下
class TestGeneric<T, R> (t: T, r: R) {
-
- fun foo() {
- // 获得当前实例的操作对象
- // 获得 T 的 Class 实例,在参数第 0 位,默认值可以不写
- val tClass = current().generic()?.argument()
- // 获得 R 的 Class 实例,在参数第 1 位
- val rClass = current().generic()?.argument(index = 1)
- // 你还可以使用如下写法
- current().generic {
- // 获得 T 的 Class 实例,在参数第 0 位,默认值可以不写
- val tClass = argument()
- // 获得 R 的 Class 实例,在参数第 1 位
- val rClass = argument(index = 1)
- }
- }
-}
-
当我们想在外部调用这个 Class
时,就可以有如下实现。
示例如下
// 假设这个就是 T 的 Class
-class TI {
-
- fun foo() {
- // ...
- }
-}
-// 假设这个就是 T 的实例
-val tInstance: TI? = ...
-// 获得 T 的 Class 实例,在参数第 0 位,默认值可以不写,并获得其中的方法 foo 并调用
-TestGeneric::class.java.generic()?.argument()?.method {
- name = "foo"
- emptyParam()
-}?.get(tInstance)?.invoke<TI>()
-
小提示
更多功能请参考 CurrentClass.generic、Class.generic 方法以及 GenericClass。
这里列举了使用时可能会遇到的误区部分,可供参考。
特别注意
在查找条件中,除了 order 你只能使用一次 index 功能。
示例如下
method {
- name = "test"
- param(BooleanType).index(num = 2)
- // ❗错误的使用方法,请仅保留一个 index 方法
- returnType(StringClass).index(num = 1)
-}
-
以下查找条件的使用是没有任何问题的。
示例如下
method {
- name = "test"
- param(BooleanType).index(num = 2)
- order().index(num = 1)
-}
-
特别注意
在普通方法查找条件中,即使是无参的方法也需要设置查找条件。
假设我们有如下的 Class
。
示例如下
public class TestFoo {
-
- public void foo(String string) {
- // ...
- }
-
- public void foo() {
- // ...
- }
-}
-
我们要得到其中的 public void foo()
方法,可以写作如下形式。
示例如下
TestFoo::class.java.method {
- name = "foo"
-}
-
但是,上面的例子是错误的。
你会发现这个 Class
中有两个 foo
方法,其中一个带有方法参数。
由于上述例子没有设置 param
的查找条件,得到的结果将会是匹配名称且匹配字节码顺序的第一个方法 public void foo(String string)
,而不是我们需要的最后一个方法。
这是一个经常会出现的错误,没有方法参数就会丢失方法参数查找条件的使用问题。
正确的使用方法如下。
示例如下
TestFoo::class.java.method {
- name = "foo"
- // ✅ 正确的使用方法,添加详细的筛选条件
- emptyParam()
-}
-
至此,上述的示例将可以完美地匹配到 public void foo()
方法。
在构造方法查找条件中,无参的构造方法可以不需要填写查找条件。
假设我们有如下的 Class
。
示例如下
public class TestFoo {
-
- public TestFoo() {
- // ...
- }
-}
-
我们要得到其中的 public TestFoo()
构造方法,可以写作如下形式。
示例如下
TestFoo::class.java.constructor { emptyParam() }
-
上面的例子可以成功获取到 public TestFoo()
构造方法,但是感觉有一些繁琐。
与普通方法不同,由于构造方法不需要考虑 name
名称,当构造方法没有参数的时候,我们可以省略 emptyParam
参数。
示例如下
TestFoo::class.java.constructor()
-
特别注意
在字节码调用结果中,cast 方法只能指定字节码对应的类型。
例如我们想得到一个 Boolean
类型的变量,把他转换为 String
。
以下是错误的使用方法。
示例如下
field {
- name = "test"
- type = BooleanType
-}.get().string() // ❗错误的使用方法,必须 cast 为字节码目标类型
-
以下是正确的使用方法。
示例如下
field {
- name = "test"
- type = BooleanType
-}.get().boolean().toString() // ✅ 正确的使用方法,得到类型后再进行转换
-
在查找方法、变量的时候我们通常需要指定所查找的类型。
示例如下
field {
- name = "test"
- type = Boolean::class.javaPrimitiveType
-}
-
在 Kotlin
中表达出 Boolean::class.javaPrimitiveType
这个类型的写法很长,感觉并不方便。
因此,YukiReflection
为开发者封装了常见的类型调用,其中包含了 Android 的相关类型和 Java 的常见类型与原始类型关键字。
这个时候上面的类型就可以写作如下形式了。
示例如下
field {
- name = "test"
- type = BooleanType
-}
-
在 Java 常见类型中的原始类型 (或基本类型) 关键字都已被封装为 类型 + Type 的方式,例如 IntType
、FloatType
(它们的字节码类型为 int
、float
)。
相应地,数组类型也有方便的使用方法,假设我们要获得 String[]
类型的数组。
需要写做 java.lang.reflect.Array.newInstance(String::class.java, 0).javaClass
才能得到这个类型。
感觉是不是很麻烦,这个时候我们可以使用方法 ArrayClass(StringClass)
来得到这个类型。
同时由于 String
是常见类型,所以还可以直接使用 StringArrayClass
来得到这个类型。
一些常见需求中查找的方法,都有其对应的封装类型以供使用,格式为 类型 + Class。
以下是 Java 中一些特例类型在 YukiReflection
中的封装名称。
void
→ UnitType
java.lang.Void
→ UnitClass
java.lang.Object
→ AnyClass
java.lang.Integer
→ IntClass
java.lang.Character
→ CharClass
注意
以 类型 + Type 封装类型会且仅会表示为 Java 原始类型关键字,由于 Kotlin 中不存在原始类型这个概念,所以它们都会被定义为 KClass。
Java 中共有 9 个原始类型关键字,其中 8 个为原始类型,分别为 boolean、char、byte、short、int、float、long、double,其中 void 类型是一个特例。
同时它们都有 Java 自身对应的封装类型,例如 java.lang.Boolean、java.lang.Integer,这些类型是不相等的,请注意区分。
同样地,数组也有对应的封装类型,它们也需要与 Java 原始类型关键字 进行区分。
例如 byte[] 的封装类型为 ByteArrayType 或 ArrayClass(ByteType),而 Byte[] 的封装类型为 ByteArrayClass 或 ArrayClass(ByteClass),这些类型也是不相等的。
同时,欢迎你能贡献更多的常用类型。
这里的文档将同步最新 API 版本的相关用法,请保持
YukiReflection
为最新版本以使用最新版本的功能。
功能描述主要介绍当前 API 的相关用法和用途。
功能示例主要展示了当前 API 的基本用法示例,可供参考。
首个版本的功能将标记为 v<version>
添加
;
后期新增加的功能将标记为 v<version>
新增
;
后期修改的功能将被追加为 v<version>
修改
;
后期被作废的功能将标记为 v<version>
作废
并会标注删除线;
后期被删除的功能将标记为 v<version>
移除
并会标注删除线。
kt Kotlin Static File
annotation 注解
interface 接口
object 类 (单例)
class 类
field 变量或 get
、set
方法或只读的 get
方法
method 方法
enum Enum 常量
ext-field 扩展的变量 (全局)
ext-method 扩展的方法 (全局)
i-ext-field 扩展的变量 (调用域限制)
i-ext-method 扩展的方法 (调用域限制)
object YukiReflection
-
变更记录
v1.0.0
添加
功能描述
这是
YukiReflection
的装载调用类。
const val API_VERSION_NAME: String
-
变更记录
v1.0.0
添加
功能描述
获取当前
YukiReflection
的版本。
const val API_VERSION_CODE: Int
-
变更记录
v1.0.0
添加
功能描述
获取当前
YukiReflection
的版本号。
object Configs
-
变更记录
v1.0.0
添加
功能描述
对 API 相关功能的配置类。
var debugTag: String
-
变更记录
v1.0.0
添加
功能描述
这是一个调试日志的全局标识。
默认文案为 YukiReflection
。
你可以修改为你自己的文案。
var isDebug: Boolean
-
变更记录
v1.0.0
添加
功能描述
是否启用 Debug 模式。
默认不启用,启用后将交由日志输出管理器打印详细日志 (例如反射查找功能的耗时) 到控制台。
请过滤 debugTag
即可找到每条日志。
var isAllowPrintingLogs: Boolean
-
变更记录
v1.0.0
添加
功能描述
是否启用调试日志的输出功能。
注意
关闭后将会停用 YukiReflection 对全部日志的输出。
变更记录
v1.0.0
添加
v1.0.2
作废
Member
的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
inline fun configs(initiate: Configs.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
对
Configs
类实现了一个lambda
方法体。
你可以轻松地调用它进行配置。
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
-
变更记录
v1.0.0
添加
功能描述
当前实例的类操作对象。
val name: String
-
变更记录
v1.0.0
添加
功能描述
获得当前
classSet
的Class.getName
。
val simpleName: String
-
变更记录
v1.0.0
添加
功能描述
获得当前
classSet
的Class.getSimpleName
。
fun generic(): GenericClass?
-
变更记录
v1.0.0
添加
功能描述
获得当前实例中的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
变更记录
v1.0.0
添加
功能描述
获得当前实例中的泛型父类。
如果当前实例不存在泛型将返回 null
。
fun superClass(): SuperClass
-
变更记录
v1.0.0
添加
功能描述
调用父类实例。
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
变更记录
v1.0.0
添加
功能描述
调用当前实例中的变量。
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
变更记录
v1.0.0
添加
功能描述
调用当前实例中的方法。
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
-
变更记录
v1.0.0
添加
功能描述
当前类的父类实例的类操作对象。
val name: String
-
变更记录
v1.0.0
添加
功能描述
获得当前
classSet
中父类的Class.getName
。
val simpleName: String
-
变更记录
v1.0.0
添加
功能描述
获得当前
classSet
中父类的Class.getSimpleName
。
fun generic(): GenericClass?
-
变更记录
v1.0.0
添加
功能描述
获得当前实例父类中的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
-
变更记录
v1.0.0
添加
功能描述
获得当前实例父类中的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
-
变更记录
v1.0.0
添加
功能描述
调用父类实例中的变量。
inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
-
变更记录
v1.0.0
添加
功能描述
调用父类实例中的方法。
class GenericClass internal constructor(private val type: ParameterizedType)
-
变更记录
v1.0.0
添加
功能描述
当前
Class
的泛型父类操作对象。
fun argument(index: Int): Class<*>
-
inline fun <reified T> argument(index: Int): Class<T>
-
变更记录
v1.0.0
添加
功能描述
获得泛型参数数组下标的
Class
实例。
class VariousClass(private vararg val name: String)
-
变更记录
v1.0.0
添加
功能描述
这是一个不确定性
Class
类名装载器,通过name
装载Class
名称数组。
fun get(loader: ClassLoader? = null, initialize: Boolean): Class<*>
-
变更记录
v1.0.0
添加
功能描述
获取匹配的实体类。
使用当前 loader
装载目标 Class
。
fun getOrNull(loader: ClassLoader? = null, initialize: Boolean): Class<*>?
-
变更记录
v1.0.0
添加
功能描述
获取匹配的实体类。
使用当前 loader
装载目标 Class
。
匹配不到 Class
会返回 null
,不会抛出异常。
变更记录
v1.0.0
添加
功能描述
这是自定义
Member
和Class
相关功能的查找匹配以及invoke
的封装类。
fun ClassLoader.listOfClasses(): List<String>
-
变更记录
v1.0.0
添加
功能描述
写出当前
ClassLoader
下所有Class
名称数组。
inline fun ClassLoader.searchClass(context: Context?, name: String, async: Boolean, initiate: ClassConditions): DexClassFinder.Result
-
变更记录
v1.0.0
添加
功能描述
通过当前
ClassLoader
按指定条件查找并得到 Dex 中的Class
。
特别注意
此方法在 Class 数量过多及查找条件复杂时会非常耗时。
建议启用 async 或设置 name 参数,name 参数将在当前 APP 不同版本中自动进行本地缓存以提升效率。
如果使用了 async 或 name 参数,则必须填写 context 参数。
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
val Class<*>.hasExtends: Boolean
-
变更记录
v1.0.0
添加
功能描述
当前
Class
是否有继承关系,父类是Any
将被认为没有继承关系。
infix fun Class<*>?.extends(other: Class<*>?): Boolean
-
变更记录
v1.0.0
添加
功能描述
当前
Class
是否继承于other
。
如果当前 Class
就是 other
也会返回 true
。
如果当前 Class
为 null
或 other
为 null
会返回 false
。
功能示例
你可以使用此方法来判断两个 Class
是否存在继承关系。
示例如下
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否继承于 B
-if (classA extends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notExtends(other: Class<*>?): Boolean
-
变更记录
v1.0.0
添加
功能描述
当前
Class
是否不继承于other
。
此方法相当于 extends
的反向判断。
功能示例
你可以使用此方法来判断两个 Class
是否不存在继承关系。
示例如下
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否不继承于 B
-if (classA notExtends classB) {
- // Your code here.
-}
-
infix fun Class<*>?.implements(other: Class<*>?): Boolean
-
变更记录
v1.0.0
添加
功能描述
当前
Class
是否实现了other
接口类。
如果当前 Class
为 null
或 other
为 null
会返回 false
。
功能示例
你可以使用此方法来判断两个 Class
是否存在依赖关系。
示例如下
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否实现了 B 接口类
-if (classA implements classB) {
- // Your code here.
-}
-
infix fun Class<*>?.notImplements(other: Class<*>?): Boolean
-
变更记录
v1.0.0
添加
功能描述
当前
Class
是否未实现other
接口类。
此方法相当于 implements
的反向判断。
功能示例
你可以使用此方法来判断两个 Class
是否不存在依赖关系。
示例如下
// 假设下面这两个 Class 就是你需要判断的 Class
-val classA: Class<*>?
-val classB: Class<*>?
-// 判断 A 是否未实现 B 接口类
-if (classA notImplements classB) {
- // Your code here.
-}
-
fun Class<*>.toJavaPrimitiveType(): Class<*>
-
变更记录
v1.0.0
添加
功能描述
自动转换当前
Class
为 Java 原始类型 (Primitive Type)。
如果当前 Class
为 Java 或 Kotlin 基本类型将自动执行类型转换。
当前能够自动转换的基本类型如下。
kotlin.Unit
java.lang.Void
java.lang.Boolean
java.lang.Integer
java.lang.Float
java.lang.Double
java.lang.Long
java.lang.Short
java.lang.Character
java.lang.Byte
fun String.toClass(loader: ClassLoader?, initialize: Boolean): Class<*>
-
inline fun <reified T> String.toClass(loader: ClassLoader?, initialize: Boolean): Class<T>
-
变更记录
v1.0.0
添加
功能描述
通过字符串类名转换为
loader
中的实体类。
功能示例
你可以直接填写你要查找的目标 Class
,必须在默认 ClassLoader
下存在。
示例如下
"com.example.demo.DemoClass".toClass()
-
你还可以自定义 Class
所在的 ClassLoader
。
示例如下
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-"com.example.demo.DemoClass".toClass(customClassLoader)
-
你还可以指定 Class
的目标类型。
示例如下
// 指定的 DemoClass 必须存在或为可访问的 stub
-"com.example.demo.DemoClass".toClass<DemoClass>()
-
你还可以设置在获取到这个 Class
时是否自动执行其默认的静态方法块,默认情况下不会执行。
示例如下
// 获取并执行 DemoClass 默认的静态方法块
-"com.example.demo.DemoClass".toClass(initialize = true)
-
默认的静态方法块在 Java 中使用如下方式定义。
示例如下
public class DemoClass {
-
- static {
- // 这里是静态方法块的内容
- }
-
- public DemoClass() {
- // ...
- }
-}
-
fun String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<*>?
-
inline fun <reified T> String.toClassOrNull(loader: ClassLoader?, initialize: Boolean): Class<T>?
-
变更记录
v1.0.0
添加
功能描述
通过字符串类名转换为
loader
中的实体类。
找不到 Class
会返回 null
,不会抛出异常。
功能示例
用法请参考 String.toClass 方法。
inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class<T>
-
变更记录
v1.0.0
添加
功能描述
通过
T
得到其Class
实例并转换为实体类。
功能示例
我们要获取一个 Class
在 Kotlin
下不通过反射时应该这样做。
示例如下
DemoClass::class.java
-
现在,你可以直接 cast
一个实例并获取它的 Class
对象,必须在当前 ClassLoader
下存在。
示例如下
classOf<DemoClass>()
-
若目标存在的 Class
为 stub
,通过这种方式,你还可以自定义 Class
所在的 ClassLoader
。
示例如下
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-classOf<DemoClass>(customClassLoader)
-
fun String.hasClass(loader: ClassLoader?): Boolean
-
变更记录
v1.0.0
添加
功能描述
通过字符串类名使用指定的
ClassLoader
查找是否存在。
功能示例
你可以轻松的使用此方法判断字符串中的类是否存在,效果等同于直接使用 Class.forName
。
示例如下
if("com.example.demo.DemoClass".hasClass()) {
- // Your code here.
-}
-
填入方法中的 loader
参数可判断指定的 ClassLoader
中的 Class
是否存在。
示例如下
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
-if("com.example.demo.DemoClass".hasClass(customClassLoader)) {
- // Your code here.
-}
-
inline fun Class<*>.hasField(initiate: FieldConditions): Boolean
-
变更记录
v1.0.0
添加
功能描述
查找变量是否存在。
inline fun Class<*>.hasMethod(initiate: MethodConditions): Boolean
-
变更记录
v1.0.0
添加
功能描述
查找方法是否存在。
inline fun Class<*>.hasConstructor(initiate: ConstructorConditions): Boolean
-
变更记录
v1.0.0
添加
功能描述
查找构造方法是否存在。
inline fun Member.hasModifiers(conditions: ModifierConditions): Boolean
-
变更记录
v1.0.0
添加
功能描述
查找
Member
中匹配的描述符。
inline fun Class<*>.hasModifiers(conditions: ModifierConditions): Boolean
-
变更记录
v1.0.0
添加
功能描述
查找
Class
中匹配的描述符。
inline fun Class<*>.field(initiate: FieldConditions): FieldFinder.Result
-
变更记录
v1.0.0
添加
功能描述
查找并得到变量。
inline fun Class<*>.method(initiate: MethodConditions): MethodFinder.Result
-
变更记录
v1.0.0
添加
功能描述
查找并得到方法。
inline fun Class<*>.constructor(initiate: ConstructorConditions): ConstructorFinder.Result
-
变更记录
v1.0.0
添加
功能描述
查找并得到构造方法。
fun Class<*>.generic(): GenericClass?
-
变更记录
v1.0.0
添加
功能描述
获得当前
Class
的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun Class<*>.generic(initiate: GenericClass.() -> Unit): GenericClass?
-
变更记录
v1.0.0
添加
功能描述
获得当前
Class
的泛型父类。
如果当前实例不存在泛型将返回 null
。
inline fun <reified T : Any> T.current(ignored: Boolean): CurrentClass
-
inline fun <reified T : Any> T.current(ignored: Boolean, initiate: CurrentClass.() -> Unit): T
-
变更记录
v1.0.0
添加
功能描述
获得当前实例的类操作对象。
inline fun Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): Any?
-
inline fun <T> Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditions): T?
-
变更记录
v1.0.0
添加
功能描述
通过构造方法创建新实例,指定类型
T
或任意类型Any
。
inline fun Class<*>.allMethods(isAccessible: Boolean, result: (index: Int, method: Method) -> Unit)
-
变更记录
v1.0.0
添加
功能描述
遍历当前类中的所有方法。
inline fun Class<*>.allConstructors(isAccessible: Boolean, result: (index: Int, constructor: Constructor<*>) -> Unit)
-
变更记录
v1.0.0
添加
功能描述
遍历当前类中的所有构造方法。
inline fun Class<*>.allFields(isAccessible: Boolean, result: (index: Int, field: Field) -> Unit)
-
变更记录
v1.0.0
添加
功能描述
遍历当前类中的所有变量。
abstract class BaseFinder
-
变更记录
v1.0.0
添加
功能描述
这是
Class
与Member
查找类功能的基本类实现。
inner class IndexTypeCondition internal constructor(private val type: IndexConfigType)
-
变更记录
v1.0.0
添加
功能描述
字节码下标筛选实现类。
fun index(num: Int)
-
变更记录
v1.0.0
添加
功能描述
设置下标。
若 index
小于零则为倒序,此时可以使用 IndexTypeConditionSort.reverse
方法实现。
可使用 IndexTypeConditionSort.first
和 IndexTypeConditionSort.last
设置首位和末位筛选条件。
fun index(): IndexTypeConditionSort
-
变更记录
v1.0.0
添加
功能描述
得到下标。
inner class IndexTypeConditionSort internal constructor()
-
变更记录
v1.0.0
添加
功能描述
字节码下标排序实现类。
fun first()
-
变更记录
v1.0.0
添加
功能描述
设置满足条件的第一个。
fun last()
-
变更记录
v1.0.0
添加
功能描述
设置满足条件的最后一个。
fun reverse(num: Int)
-
变更记录
v1.0.0
添加
功能描述
设置倒序下标。
class CountRules private constructor()
-
变更记录
v1.0.0
添加
功能描述
这是一个模糊
Class
、Member
数组 (下标) 个数条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
fun Int.isZero(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否为 0。
fun Int.moreThan(count: Int): Boolean
-
变更记录
v1.0.0
添加
功能描述
大于
count
。
fun Int.lessThan(count: Int): Boolean
-
变更记录
v1.0.0
添加
功能描述
小于
count
。
fun Int.inInterval(countRange: IntRange): Boolean
-
变更记录
v1.0.0
添加
功能描述
在
countRange
区间 A ≤ this ≤ B。
class ModifierRules private constructor()
-
变更记录
v1.0.0
添加
功能描述
这是一个
Class
、Member
描述符条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
val isPublic: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含public
。
val isPrivate: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含private
。
val isProtected: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含protected
。
val isStatic: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含static
。
对于任意的静态 Class
、Member
可添加此描述进行确定。
注意
Kotlin → Jvm 后的 object 类中的方法并不是静态的。
val isFinal: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含final
。
注意
Kotlin → Jvm 后没有 open 符号标识的 Class、Member 和没有任何关联的 Class、Member 都将为 final。
val isSynchronized: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含synchronized
。
val isVolatile: Boolean
-
变更记录
v1.0.0
添加
功能描述
Field
类型是否包含volatile
。
val isTransient: Boolean
-
变更记录
v1.0.0
添加
功能描述
Field
类型是否包含transient
。
val isNative: Boolean
-
变更记录
v1.0.0
添加
功能描述
Method
类型是否包含native
。
对于任意 JNI 对接的 Method
可添加此描述进行确定。
val isInterface: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
类型是否包含interface
。
val isAbstract: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含abstract
。
对于任意的抽象 Class
、Member
可添加此描述进行确定。
val isStrict: Boolean
-
变更记录
v1.0.0
添加
功能描述
Class
、Member
类型是否包含strictfp
。
class NameRules private constructor()
-
变更记录
v1.0.0
添加
功能描述
这是一个模糊
Class
、Member
名称条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
fun String.isSynthetic(index: Int): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否为匿名类的主类调用对象。
fun String.isOnlySymbols(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否只有符号。
fun String.isOnlyLetters(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否只有字母。
fun String.isOnlyNumbers(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否只有数字。
fun String.isOnlyLettersNumbers(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否只有字母或数字。
fun String.isOnlyLowercase(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否只有小写字母。
在没有其它条件的情况下设置此条件允许判断对象存在字母以外的字符。
fun String.isOnlyUppercase(): Boolean
-
变更记录
v1.0.0
添加
功能描述
是否只有大写字母。
在没有其它条件的情况下设置此条件允许判断对象存在字母以外的字符。
class ObjectRules private constructor(private val instance: Any)
-
变更记录
v1.0.0
添加
功能描述
这是一个任意对象条件实现类。
可对 R8 混淆后的 Class
、Member
进行更加详细的定位。
class DexClassFinder internal constructor(
- private val context: Context?,
- internal var name: String,
- internal var async: Boolean,
- override val loaderSet: ClassLoader?
-) : ClassBaseFinder
-
变更记录
v1.0.0
添加
功能描述
Class
查找类。
可使用 BaseDexClassLoader
通过指定条件查找指定 Class
或一组 Class
。
注意
此功能尚在试验阶段,性能与稳定性可能仍然存在问题,使用过程遇到问题请向我们报告并帮助我们改进。
变更记录
v1.0.0
添加
fun clearCache(context: Context, versionName: String?, versionCode: Long?)
-
变更记录
v1.0.0
添加
功能描述
清除当前
DexClassFinder
的Class
缓存。
适用于全部通过 ClassLoader.searchClass 获取的 DexClassFinder
。
var fullName: String
-
变更记录
v1.0.0
添加
功能描述
设置
Class
完整名称。
只会查找匹配到的 Class.getName
。
例如 com.demo.Test
需要填写 com.demo.Test
。
var simpleName: String
-
变更记录
v1.0.0
添加
功能描述
设置
Class
简单名称。
只会查找匹配到的 Class.getSimpleName
。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest
会为空,此时你可以使用 singleName。
var singleName: String
-
变更记录
v1.0.0
添加
功能描述
设置
Class
独立名称。
设置后将首先使用 Class.getSimpleName
,若为空则会使用 Class.getName
进行处理。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest
只需要填写 Test$InnerTest
。
fun from(vararg name: String): FromPackageRules
-
变更记录
v1.0.0
添加
功能描述
设置在指定包名范围查找当前
Class
。
设置后仅会在当前 name
开头匹配的包名路径下进行查找,可提升查找速度。
例如 ↓
com.demo.test
com.demo.test.demo
注意
建议设置此参数指定查找范围,否则 Class 过多时将会非常慢。
fun modifiers(conditions: ModifierConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
标识符筛选条件。
可不设置筛选条件。
fun fullName(value: String): ClassNameRules
-
变更记录
v1.0.0
添加
功能描述
设置
Class
完整名称。
只会查找匹配到的 Class.getName
。
例如 com.demo.Test
需要填写 com.demo.Test
。
fun simpleName(value: String): ClassNameRules
-
变更记录
v1.0.0
添加
功能描述
设置
Class
简单名称。
只会查找匹配到的 Class.getSimpleName
。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest 会为空
,此时你可以使用 singleName。
fun singleName(value: String): ClassNameRules
-
变更记录
v1.0.0
添加
功能描述
设置
Class
独立名称。
设置后将首先使用 Class.getSimpleName
,若为空则会使用 Class.getName
进行处理。
例如 com.demo.Test
只需要填写 Test
。
对于匿名类例如 com.demo.Test$InnerTest
只需要填写 Test$InnerTest
。
fun fullName(conditions: NameConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
完整名称条件。
只会查找匹配到的 Class.getName
。
fun simpleName(conditions: NameConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
简单名称条件。
只会查找匹配到的 Class.getSimpleName
。
fun singleName(conditions: NameConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
独立名称条件。
设置后将首先使用 Class.getSimpleName
,若为空则会使用 Class.getName
进行处理。
inline fun <reified T> extends()
-
变更记录
v1.0.0
添加
功能描述
设置
Class
继承的父类。
fun extends(vararg name: String)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
继承的父类。
会同时查找 name
中所有匹配的父类。
inline fun <reified T> implements()
-
变更记录
v1.0.0
添加
功能描述
设置
Class
实现的接口类。
fun implements(vararg name: String)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
实现的接口类。
会同时查找 name
中所有匹配的接口类。
fun anonymous()
-
变更记录
v1.0.0
添加
功能描述
标识
Class
为匿名类。
例如 com.demo.Test$1
或 com.demo.Test$InnerTest
。
标识后你可以使用 enclosing 来进一步指定匿名类的 (封闭类) 主类。
fun noExtends()
-
变更记录
v1.0.0
添加
功能描述
设置
Class
没有任何继承。
此时 Class
只应该继承于 Any
。
注意
设置此条件后 extends 将失效。
fun noImplements()
-
变更记录
v1.0.0
添加
功能描述
设置
Class
没有任何接口。
注意
设置此条件后 implements 将失效。
fun noSuper()
-
变更记录
v1.0.0
添加
功能描述
设置
Class
没有任何继承与接口。
此时 Class
只应该继承于 Any
。
注意
设置此条件后 extends 与 implements 将失效。
inline fun <reified T> enclosing()
-
变更记录
v1.0.0
添加
功能描述
设置
Class
匿名类的 (封闭类) 主类。
fun enclosing(vararg name: String)
-
变更记录
v1.0.0
添加
功能描述
设置
Class
匿名类的 (封闭类) 主类。
会同时查找 name
中所有匹配的 (封闭类) 主类。
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
-
变更记录
v1.0.0
添加
功能描述
包名范围名称过滤匹配条件实现类。
fun absolute()
-
变更记录
v1.0.0
添加
功能描述
设置包名绝对匹配。
例如有如下包名 ↓
com.demo.test.a
com.demo.test.a.b
com.demo.test.active
若包名条件为 com.demo.test.a
则绝对匹配仅能匹配到第一个。
相反地,不设置以上示例会全部匹配。
inner class ClassNameRules internal constructor(private val name: ClassRulesData.NameRulesData)
-
变更记录
v1.0.0
添加
功能描述
类名匹配条件实现类。
fun optional()
-
变更记录
v1.0.0
添加
功能描述
设置类名可选。
例如有如下类名 ↓
com.demo.Test
fullName / Test
simpleName
defpackage.a
fullName / a
simpleName
这两个类名都是同一个类,但是在有些版本中被混淆有些版本没有。
此时可设置类名为 com.demo.Test
fullName / Test
simpleName。
这样就可在完全匹配类名情况下使用类名而忽略其它查找条件,否则忽略此条件继续使用其它查找条件。
inline fun member(initiate: MemberRules.() -> Unit): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置
Class
满足的Member
条件。
inline fun field(initiate: FieldRules.() -> Unit): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置
Class
满足的Field
条件。
inline fun method(initiate: MethodRules.() -> Unit): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置
Class
满足的Method
条件。
inline fun constructor(initiate: ConstructorRules.() -> Unit): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置
Class
满足的Constructor
条件。
inner class Result internal constructor(internal var isNotFound: Boolean, internal var throwable: Throwable?) : BaseResult
-
变更记录
v1.0.0
添加
功能描述
Class
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建监听结果事件方法体。
fun get(): Class<*>?
-
变更记录
v1.0.0
添加
功能描述
得到
Class
本身。
若有多个 Class
结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
若你设置了 async
请使用 wait 方法。
fun all(): HashSet<Class<*>>
-
变更记录
v1.0.0
添加
功能描述
得到
Class
本身数组。
返回全部查找条件匹配的多个 Class
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
若你设置了 async
请使用 waitAll 方法。
fun all(result: (Class<*>) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
得到
Class
本身数组 (依次遍历)。
回调全部查找条件匹配的多个 Class
实例。
在查找条件找不到任何结果的时候将不会执行。
若你设置了 async
请使用 waitAll 方法。
fun wait(result: (Class<*>?) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
得到
Class
本身 (异步)。
若有多个 Class
结果只会回调第一个。
在查找条件找不到任何结果的时候将回调 null。
你需要设置 async
后此方法才会被回调,否则请使用 get 方法。
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
得到
Class
本身数组 (异步)。
回调全部查找条件匹配的多个 Class
实例。
在查找条件找不到任何结果的时候将回调空的 HashSet
。
你需要设置 async
后此方法才会被回调,否则请使用 all 方法。
fun onNoClassDefFoundError(result: (Throwable) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
监听找不到
Class
时。
fun ignored(): Result
-
变更记录
v1.0.0
添加
功能描述
忽略异常并停止打印任何错误日志。
此时若要监听异常结果,你需要手动实现 onNoClassDefFoundError 方法。
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
-
变更记录
v1.0.0
添加
功能描述
Constructor
查找条件实现类。
var paramCount: Int
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
fun modifiers(conditions: ModifierConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
标识符筛选条件。
可不设置筛选条件。
fun emptyParam()
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
空参数、无参数。
fun param(vararg paramType: Any)
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Constructor
中存在一些无意义又很长的类型,你可以使用 VagueType
来替代它。
特别注意
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
fun param(conditions: ObjectsConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数条件。
特别注意
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
fun paramCount(numRange: IntRange)
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
fun paramCount(conditions: CountConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
-
变更记录
v1.0.0
添加
功能描述
Field
查找条件实现类。
var name: String
-
变更记录
v1.0.0
添加
功能描述
设置
Field
名称。
var type: Any?
-
变更记录
v1.0.0
添加
功能描述
设置
Field
类型。
可不填写类型。
fun modifiers(conditions: ModifierConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Field
标识符筛选条件。
可不设置筛选条件。
fun name(conditions: NameConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Field
名称条件。
fun type(conditions: ObjectConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Field
类型条件。
可不填写类型。
class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
-
变更记录
v1.0.0
添加
功能描述
Member
查找条件实现类。
fun modifiers(conditions: ModifierConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Member
标识符筛选条件。
可不设置筛选条件。
class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
-
变更记录
v1.0.0
添加
功能描述
Method
查找条件实现类。
var name: String
-
变更记录
v1.0.0
添加
功能描述
设置
Method
名称。
var paramCount: Int
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
var returnType: Any?
-
变更记录
v1.0.0
添加
功能描述
设置
Method
返回值。
可不填写返回值。
fun modifiers(conditions: ModifierConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
标识符筛选条件。
可不设置筛选条件。
fun emptyParam()
-
变更记录
v1.0.0
添加
功能描述
设置
Method
空参数、无参数。
fun param(vararg paramType: Any)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Method
中存在一些无意义又很长的类型,你可以使用 VagueType
来替代它。
特别注意
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
fun param(conditions: ObjectsConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数条件。
特别注意
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
fun name(conditions: NameConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
名称条件。
fun paramCount(numRange: IntRange)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
fun paramCount(conditions: CountConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
fun returnType(conditions: ObjectConditions)
-
变更记录
v1.0.0
添加
功能描述
设置
Method
返回值条件。
可不填写返回值。
class MemberRulesResult internal constructor(private val rulesData: MemberRulesData)
-
变更记录
v1.0.0
添加
功能描述
当前
Member
查找条件结果实现类。
fun none(): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置当前
Member
在查找条件中个数为0
。
fun count(num: Int): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置当前
Member
在查找条件中需要全部匹配的个数。
fun count(numRange: IntRange): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置当前
Member
在查找条件中需要全部匹配的个数范围。
fun count(conditions: CountConditions): MemberRulesResult
-
变更记录
v1.0.0
添加
功能描述
设置当前
Member
在查找条件中需要全部匹配的个数条件。
class ConstructorFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
变更记录
v1.0.0
添加
功能描述
Constructor
查找类。
可通过指定类型查找指定 Constructor
或一组 Constructor
。
var paramCount: Int
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
标识符筛选条件。
可不设置筛选条件,默认模糊查找并取第一个匹配的 Constructor
。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun emptyParam(): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
空参数、无参数。
fun param(vararg paramType: Any): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Constructor
中存在一些无意义又很长的类型,你可以使用 VagueType 来替代它。
特别注意
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数条件。
特别注意
无参 Constructor 请使用 emptyParam 设置查找条件。
有参 Constructor 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(num: Int): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数。
若参数个数小于零则忽略并使用 param
。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(numRange: IntRange): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Constructor
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun superClass(isOnlySuperClass: Boolean)
-
变更记录
v1.0.0
添加
功能描述
设置在
classSet
的所有父类中查找当前Constructor
。
注意
若当前 classSet 的父类较多可能会耗时,API 会自动循环到父类继承是 Any 前的最后一个类。
inner class RemedyPlan internal constructor()
-
变更记录
v1.0.0
添加
功能描述
Constructor
重查找实现类,可累计失败次数直到查找成功。
inline fun constructor(initiate: ConstructorConditions)
-
变更记录
v1.0.0
添加
功能描述
创建需要重新查找的
Constructor
。
你可以添加多个备选 Constructor
,直到成功为止,若最后依然失败,将停止查找并输出错误日志。
inner class Result internal constructor()
-
变更记录
v1.0.0
添加
功能描述
RemedyPlan
结果实现类。
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
当在
RemedyPlan
中找到结果时。
功能示例
你可以方便地对重查找的 Constructor
实现 onFind
方法。
示例如下
constructor {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
-
变更记录
v1.0.0
添加
功能描述
Constructor
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建监听结果事件方法体。
功能示例
你可以使用 lambda
形式创建 Result
类。
示例如下
constructor {
- // Your code here.
-}.result {
- get().call()
- all()
- remedys {}
- onNoSuchConstructor {}
-}
-
fun get(): Instance
-
变更记录
v1.0.0
添加
功能描述
获得
Constructor
实例处理类。
若有多个 Constructor
结果只会返回第一个。
特别注意
若你设置了 remedys 请使用 wait 回调结果方法。
功能示例
你可以通过获得方法所在实例来执行构造方法创建新的实例对象。
示例如下
constructor {
- // Your code here.
-}.get().call()
-
你可以 cast
构造方法为指定类型的实例对象。
示例如下
constructor {
- // Your code here.
-}.get().newInstance<TestClass>()
-
特别注意
若构造方法含有参数则后方参数必填。
示例如下
constructor {
- // Your code here.
-}.get().newInstance<TestClass>("param1", "param2")
-
fun all(): ArrayList<Instance>
-
变更记录
v1.0.0
添加
功能描述
获得
Constructor
实例处理类数组。
返回全部查找条件匹配的多个 Constructor
实例结果。
功能示例
你可以通过此方法来获得当前条件结果中匹配的全部 Constructor
。
示例如下
constructor {
- // Your code here.
-}.all().forEach { instance ->
- instance.call(...)
-}
-
fun give(): Constructor<*>?
-
变更记录
v1.0.0
添加
功能描述
得到
Constructor
本身。
若有多个 Constructor
结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
fun giveAll(): HashSet<Constructor<*>>
-
变更记录
v1.0.0
添加
功能描述
得到
Constructor
本身数组。
返回全部查找条件匹配的多个 Constructor
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
fun wait(initiate: Instance.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
获得
Constructor
实例处理类,配合RemedyPlan
使用。
若有多个 Constructor
结果只会返回第一个。
特别注意
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
获得
Constructor
实例处理类数组,配合RemedyPlan
使用。
返回全部查找条件匹配的多个 Constructor
实例结果。
特别注意
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建
Constructor
重查找功能。
功能示例
当你遇到一种 Constructor
可能存在不同形式的存在时,可以使用 RemedyPlan
重新查找它,而没有必要使用 onNoSuchConstructor
捕获异常二次查找 Constructor
。
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
示例如下
constructor {
- // Your code here.
-}.remedys {
- constructor {
- // Your code here.
- }
- constructor {
- // Your code here.
- }
-}
-
inline fun onNoSuchConstructor(result: (Throwable) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
监听找不到
Constructor
时。
只会返回第一次的错误信息,不会返回 RemedyPlan
的错误信息。
fun ignored(): Result
-
变更记录
v1.0.0
添加
功能描述
忽略异常并停止打印任何错误日志。
注意
此时若要监听异常结果,你需要手动实现 onNoSuchConstructor 方法。
inner class Instance internal constructor(private val constructor: Constructor<*>?)
-
变更记录
v1.0.0
添加
功能描述
Constructor
实例处理类。
fun call(vararg args: Any?): Any?
-
变更记录
v1.0.0
添加
功能描述
执行
Constructor
创建目标实例,不指定目标实例类型。
fun <T> newInstance(vararg args: Any?): T?
-
变更记录
v1.0.0
添加
功能描述
执行
Constructor
创建目标实例 ,指定T
目标实例类型。
class FieldFinder internal constructor(override val classSet: Class<*>?) : MemberBaseFinder
-
变更记录
v1.0.0
添加
功能描述
Field
查找类。
可通过指定类型查找指定 Field
或一组 Field
。
var name: String
-
变更记录
v1.0.0
添加
功能描述
设置
Field
名称。
特别注意
若不填写名称则必须存在一个其它条件。
var type: Any?
-
变更记录
v1.0.0
添加
功能描述
设置
Field
类型。
可不填写类型。
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Field
标识符筛选条件。
可不设置筛选条件。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun order(): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
顺序筛选字节码的下标。
fun name(value: String): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Field
名称。
特别注意
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun name(conditions: NameConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Field
名称条件。
特别注意
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun type(value: Any): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Field
类型。
可不填写类型。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun type(conditions: ObjectConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Field
类型条件。
可不填写类型。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun superClass(isOnlySuperClass: Boolean)
-
变更记录
v1.0.0
添加
功能描述
设置在
classSet
的所有父类中查找当前Field
。
注意
若当前 classSet 的父类较多可能会耗时,API 会自动循环到父类继承是 Any 前的最后一个类。
inner class RemedyPlan internal constructor()
-
变更记录
v1.0.0
添加
功能描述
Field
重查找实现类,可累计失败次数直到查找成功。
inline fun field(initiate: FieldConditions): Result
-
变更记录
v1.0.0
添加
功能描述
创建需要重新查找的
Field
。
你可以添加多个备选 Field
,直到成功为止,若最后依然失败,将停止查找并输出错误日志。
inner class Result internal constructor()
-
变更记录
v1.0.0
添加
功能描述
RemedyPlan
结果实现类。
fun onFind(initiate: HashSet<Field>.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
当在
RemedyPlan
中找到结果时。
功能示例
你可以方便地对重查找的 Field
实现 onFind
方法。
示例如下
field {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
变更记录
v1.0.0
添加
功能描述
Field
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建监听结果事件方法体。
功能示例
你可以使用 lambda
形式创建 Result
类。
示例如下
field {
- // Your code here.
-}.result {
- get(instance).set("something")
- get(instance).string()
- get(instance).cast<CustomClass>()
- get().boolean()
- all(instance)
- give()
- giveAll()
- onNoSuchField {}
-}
-
fun get(instance: Any?): Instance
-
变更记录
v1.0.0
添加
功能描述
获得
Field
实例处理类。
若有多个 Field
结果只会返回第一个。
功能示例
你可以轻松地得到 Field
的实例以及使用它进行设置实例。
示例如下
field {
- // Your code here.
-}.get(instance).set("something")
-
如果你取到的是静态 Field
,可以不需要设置实例。
示例如下
field {
- // Your code here.
-}.get().set("something")
-
fun all(instance: Any?): ArrayList<Instance>
-
变更记录
v1.0.0
添加
功能描述
获得
Field
实例处理类数组。
返回全部查找条件匹配的多个 Field
实例结果。
功能示例
你可以通过此方法来获得当前条件结果中匹配的全部 Field
,其 Field
所在实例用法与 get
相同。
示例如下
field {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.self
-}
-
fun give(): Field?
-
变更记录
v1.0.0
添加
功能描述
得到
Field
本身。
若有多个 Field 结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
fun giveAll(): HashSet<Field>
-
变更记录
v1.0.0
添加
功能描述
得到
Field
本身数组。
返回全部查找条件匹配的多个 Field
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
获得
Field
实例处理类,配合RemedyPlan
使用。
若有多个 Field
结果只会返回第一个。
特别注意
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
获得
Field
实例处理类数组,配合RemedyPlan
使用。
返回全部查找条件匹配的多个 Field
实例结果。
特别注意
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建
Field
重查找功能。
功能示例
当你遇到一种 Field
可能存在不同形式的存在时,可以使用 RemedyPlan
重新查找它,而没有必要使用 onNoSuchField
捕获异常二次查找 Field
。
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
示例如下
field {
- // Your code here.
-}.remedys {
- field {
- // Your code here.
- }
- field {
- // Your code here.
- }
-}
-
fun onNoSuchField(result: (Throwable) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
监听找不到
Field
时。
fun ignored(): Result
-
变更记录
v1.0.0
添加
功能描述
忽略异常并停止打印任何错误日志。
注意
此时若要监听异常结果,你需要手动实现 onNoSuchField 方法。
inner class Instance internal constructor(private val instance: Any?, private val field: Field?)
-
变更记录
v1.0.0
添加
功能描述
Field
实例变量处理类。
fun current(ignored: Boolean): CurrentClass?
-
inline fun current(ignored: Boolean, initiate: CurrentClass.() -> Unit): Any?
-
变更记录
v1.0.0
添加
功能描述
获得当前
Field
自身self
实例的类操作对象CurrentClass
。
fun <T> cast(): T?
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
实例。
fun byte(): Byte?
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Byte 实例。
fun int(): Int
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Int 实例。
fun long(): Long
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Long 实例。
fun short(): Short
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Short 实例。
fun double(): Double
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Double 实例。
fun float(): Float
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Float 实例。
fun string(): String
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
String 实例。
fun char(): Char
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Char 实例。
fun boolean(): Boolean
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Boolean 实例。
fun any(): Any?
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Any 实例。
inline fun <reified T> array(): Array<T>
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
Array 实例。
inline fun <reified T> list(): List<T>
-
变更记录
v1.0.0
添加
功能描述
得到当前
Field
List 实例。
fun set(any: Any?)
-
变更记录
v1.0.0
添加
功能描述
设置当前
Field
实例。
fun setTrue()
-
变更记录
v1.0.0
添加
功能描述
设置当前
Field
实例为true
。
特别注意
请确保实例对象类型为 Boolean。
fun setFalse()
-
变更记录
v1.0.0
添加
功能描述
设置当前
Field
实例为false
。
特别注意
请确保实例对象类型为 Boolean。
fun setNull()
-
变更记录
v1.0.0
添加
功能描述
设置当前
Field
实例为null
。
class MethodFinder internal constructor(override val classSet: Class<*>) : MemberBaseFinder
-
变更记录
v1.0.0
添加
功能描述
Method
查找类。
可通过指定类型查找指定 Method
或一组 Method
。
var name: String
-
变更记录
v1.0.0
添加
功能描述
设置
Method
名称。
特别注意
若不填写名称则必须存在一个其它条件。
var paramCount: Int
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数。
你可以不使用 param
指定参数类型而是仅使用此变量指定参数个数。
若参数个数小于零则忽略并使用 param
。
var returnType: Any?
-
变更记录
v1.0.0
添加
功能描述
设置
Method
返回值,可不填写返回值。
fun modifiers(conditions: ModifierConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
标识符筛选条件。
可不设置筛选条件。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun emptyParam(): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
空参数、无参数。
fun param(vararg paramType: Any): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数。
如果同时使用了 paramCount
则 paramType
的数量必须与 paramCount
完全匹配。
如果 Method
中存在一些无意义又很长的类型,你可以使用 VagueType 来替代它。
特别注意
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun param(conditions: ObjectsConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数条件。
特别注意
无参 Method 请使用 emptyParam 设置查找条件。
有参 Method 必须使用此方法设定参数或使用 paramCount 指定个数。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun order(): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
顺序筛选字节码的下标。
fun name(value: String): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
名称。
特别注意
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun name(conditions: NameConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
名称条件。
特别注意
若不填写名称则必须存在一个其它条件。
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(num: Int): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数。
若参数个数小于零则忽略并使用 param
。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(numRange: IntRange): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数范围。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数范围。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun paramCount(conditions: CountConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
参数个数条件。
你可以不使用 param
指定参数类型而是仅使用此方法指定参数个数条件。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun returnType(value: Any): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
返回值。
可不填写返回值。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun returnType(conditions: ObjectConditions): IndexTypeCondition
-
变更记录
v1.0.0
添加
功能描述
设置
Method
返回值条件。
可不填写返回值。
特别注意
存在多个 IndexTypeCondition 时除了 order 只会生效最后一个。
fun superClass(isOnlySuperClass: Boolean)
-
变更记录
v1.0.0
添加
功能描述
设置在
classSet
的所有父类中查找当前Method
。
注意
若当前 classSet 的父类较多可能会耗时,API 会自动循环到父类继承是 Any 前的最后一个类。
inner class RemedyPlan internal constructor()
-
变更记录
v1.0.0
添加
功能描述
Method
重查找实现类,可累计失败次数直到查找成功。
inline fun method(initiate: MethodConditions): Result
-
变更记录
v1.0.0
添加
功能描述
创建需要重新查找的
Method
。
你可以添加多个备选 Method
,直到成功为止,若最后依然失败,将停止查找并输出错误日志。
inner class Result internal constructor()
-
变更记录
v1.0.0
添加
功能描述
RemedyPlan
结果实现类。
fun onFind(initiate: HashSet<Method>.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
当在
RemedyPlan
中找到结果时。
功能示例
你可以方便地对重查找的 Method
实现 onFind
方法。
示例如下
method {
- // Your code here.
-}.onFind {
- // Your code here.
-}
-
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
-
变更记录
v1.0.0
添加
功能描述
Method
查找结果实现类。
inline fun result(initiate: Result.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建监听结果事件方法体。
功能示例
你可以使用 lambda
形式创建 Result
类。
示例如下
method {
- // Your code here.
-}.result {
- get(instance).call()
- all(instance)
- remedys {}
- onNoSuchMethod {}
-}
-
fun get(instance: Any?): Instance
-
变更记录
v1.0.0
添加
功能描述
获得
Method
实例处理类。
若有多个 Method
结果只会返回第一个。
特别注意
若你设置了 remedys 请使用 wait 回调结果方法。
功能示例
你可以通过获得方法所在实例来执行 Method
。
示例如下
method {
- // Your code here.
-}.get(instance).call()
-
若当前为静态方法,你可以不设置实例。
示例如下
method {
- // Your code here.
-}.get().call()
-
fun all(instance: Any?): ArrayList<Instance>
-
变更记录
v1.0.0
添加
功能描述
获得
Method
实例处理类数组。
返回全部查找条件匹配的多个 Method
实例结果。
功能示例
你可以通过此方法来获得当前条件结果中匹配的全部 Method
,其方法所在实例用法与 get
相同。
示例如下
method {
- // Your code here.
-}.all(instance).forEach { instance ->
- instance.call(...)
-}
-
fun give(): Method?
-
变更记录
v1.0.0
添加
功能描述
得到
Method
本身。
若有多个 Method
结果只会返回第一个。
在查找条件找不到任何结果的时候将返回 null
。
fun giveAll(): HashSet<Method>
-
变更记录
v1.0.0
添加
功能描述
得到
Method
本身数组。
返回全部查找条件匹配的多个 Method
实例。
在查找条件找不到任何结果的时候将返回空的 HashSet
。
fun wait(instance: Any?, initiate: Instance.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
获得
Method
实例处理类,配合RemedyPlan
使用。
若有多个 Method
结果只会返回第一个。
特别注意
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
-
变更记录
v1.0.0
添加
功能描述
获得
Method
实例处理类数组,配合RemedyPlan
使用。
返回全部查找条件匹配的多个 Method
实例结果。
特别注意
若你设置了 remedys 必须使用此方法才能获得结果。
若你没有设置 remedys 此方法将不会被回调。
inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
创建
Method
重查找功能。
功能示例
当你遇到一种 Method
可能存在不同形式的存在时,可以使用 RemedyPlan
重新查找它,而没有必要使用 onNoSuchMethod
捕获异常二次查找 Method
。
若第一次查找失败了,你还可以在这里继续添加此方法体直到成功为止。
示例如下
method {
- // Your code here.
-}.remedys {
- method {
- // Your code here.
- }
- method {
- // Your code here.
- }
-}
-
inline fun onNoSuchMethod(result: (Throwable) -> Unit): Result
-
变更记录
v1.0.0
添加
功能描述
监听找不到
Method
时。
只会返回第一次的错误信息,不会返回 RemedyPlan
的错误信息。
fun ignored(): Result
-
变更记录
v1.0.0
添加
功能描述
忽略异常并停止打印任何错误日志。
注意
此时若要监听异常结果,你需要手动实现 onNoSuchMethod 方法。
inner class Instance internal constructor(private val instance: Any?, private val method: Method?)
-
变更记录
v1.0.0
添加
功能描述
Method
实例处理类。
fun call(vararg args: Any?): Any?
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,不指定返回值类型。
fun <T> invoke(vararg args: Any?): T?
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定T
返回值类型。
fun byte(vararg args: Any?): Byte?
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Byte 返回值类型。
fun int(vararg args: Any?): Int
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Int 返回值类型。
fun long(vararg args: Any?): Long
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Long 返回值类型。
fun short(vararg args: Any?): Short
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Short 返回值类型。
fun double(vararg args: Any?): Double
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Double 返回值类型。
fun float(vararg args: Any?): Float
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Float 返回值类型。
fun string(vararg args: Any?): String
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 String 返回值类型。
fun char(vararg args: Any?): Char
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Char 返回值类型。
fun boolean(vararg args: Any?): Boolean
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Boolean 返回值类型。
inline fun <reified T> array(vararg args: Any?): Array<T>
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 Array 返回值类型。
inline fun <reified T> list(vararg args: Any?): List<T>
-
变更记录
v1.0.0
添加
功能描述
执行
Method
,指定 List 返回值类型。
变更记录
v1.0.0
添加
功能描述
这是一个预置反射类型的常量类,主要为
Android
相关组件的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
变更记录
v1.0.0
添加
功能描述
这是一个预置反射类型的常量类,主要为
Android
相关Graphics
的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
变更记录
v1.0.0
添加
功能描述
这是一个预置反射类型的常量类,主要为
Android
相关Widget
的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
变更记录
v1.0.0
添加
功能描述
这是一个内部类型的定义常量类,主要用于反射 API 相关用法的延伸。
val VagueType: Class<*>
-
变更记录
v1.0.0
添加
功能描述
得到模糊类型。
变更记录
v1.0.0
添加
功能描述
这是一个预置反射类型的常量类,主要为
Java
相关基本变量类型的Class
内容,跟随版本更新会逐一进行增加。
详情可 点击这里 进行查看。
这里介绍了
YukiReflection
的基本配置方法。
YukiReflection
无需一些复杂的配置即可直接开始使用,且不会与 Java
原生的反射 API 冲突。
你可以在使用之前对 YukiReflection
进行一些功能配置。
你可以通过如下方式获取当前 YukiReflection
的 API 版本。
示例如下
// 获取版本名称
-val versionName = YukiReflection.API_VERSION_NAME
-// 获取版本号
-val versionCode = YukiReflection.API_VERSION_CODE
-
你可以通过获取版本进行一些不同版本差异的判断或用于显示在关于信息中。
小提示
更多功能请参考 YukiReflection。
你可以通过 YukiReflection.configs { ... }
方法或 YukiReflection.Configs
来配置相关功能。
你可以使用如下方式来自定义调试日志的标签。
API 内部的日志将会使用此标签进行打印。
示例如下
// 通过 configs 方法
-YukiReflection.configs {
- debugTag = "YourCustomTag"
-}
-// 直接设置
-YukiReflection.Configs.debugTag = "YourCustomTag"
-
你可以使用如下方式来启用或禁用 Debug 模式。
Debug 模式默认是关闭的,启用后将会打印详细日志 (例如反射查找功能的耗时) 到控制台。
示例如下
// 通过 configs 方法
-YukiReflection.configs {
- isDebug = true
-}
-// 直接设置
-YukiReflection.Configs.isDebug = true
-
你可以使用如下方式来启用或禁用调试日志的输出功能。
此功能默认启用,关闭后将会停用 YukiReflection
对全部日志的输出。
示例如下
// 通过 configs 方法
-YukiReflection.configs {
- isAllowPrintingLogs = true
-}
-// 直接设置
-YukiReflection.Configs.isAllowPrintingLogs = true
-
为了一次性配置多个功能,你可以直接使用 YukiReflection.configs { ... }
方法进行配置。
示例如下
YukiReflection.configs {
- debugTag = "YourCustomTag"
- isDebug = true
- isAllowPrintingLogs = true
-}
-
小提示
更多功能请参考 YukiReflection.configs 方法、YukiReflection.Configs。
YukiReflection
是一个基于 Java 和 Android 平台的反射 API。
这是一个使用 Kotlin
基于 Java
原生反射 API 重新打造的一套简洁、高效的反射 API。
YukiReflection
同时也是 YukiHookAPI 正在使用的核心功能。
名称取自 《ももくり》女主 栗原 雪(Yuki)。
YukiReflection
完全采用 Kotlin
lambda
语法构建。
它能取代 Java 原生的反射 API,使用更加人性化的语言实现一套更加完善的反射方案。
请使用 Kotlin
,API 部分代码构成同样兼容 Java
但基础反射场景的实现可能完全无法使用。
文档全部的 Demo 示例代码都将使用 Kotlin
进行描述,如果你完全不会使用 Kotlin
那你将有可能无法使用 YukiReflection
。
YukiReflection
最初是集成在 YukiHookAPI 项目中的核心功能,现在进行了解耦合,使得这套反射 API 可以在任何 Java 和 Android 平台的项目中使用。
现在,我们只需要编写少量的代码,就能实现一个简单的反射调用。
借助 Kotlin
优雅的 lambda
写法以及 YukiReflection
,可以让你的反射逻辑更加美观清晰。
示例如下
"android.os.SystemProperties".toClass()
- .method {
- name = "get"
- param(StringClass, StringClass)
- }.get().call("ro.system.build.fingerprint", "none")
-
Class.forName("android.os.SystemProperties")
- .getDeclaredMethod("get", String::class.java, String::class.java)
- .apply { isAccessible = true }
- .invoke(null, "ro.system.build.fingerprint", "none")
-
集成
YukiReflection
到你的项目中。
Windows 7 及以上/macOS 10.14 及以上/Linux 发行版 (Arch/Debian)
Android Studio 2021.1 及以上
IntelliJ IDEA 2021.1 及以上
Kotlin 1.7.0 及以上
Android Gradle Plugin 7.0 及以上
Gradle 7.0 及以上
Java 11 及以上
项目需要使用 Android Studio
或 IntelliJ IDEA
创建且类型为 Java 或 Android 项目并已集成 Kotlin
环境依赖。
我们推荐使用 Kotlin DSL 作为 Gradle 构建脚本语言并推荐使用 SweetDependency 来管理依赖。
在你的项目 SweetDependency
配置文件中添加存储库和依赖。
示例如下
repositories:
- # MavenCentral 有 2 小时缓存,若无法集成最新版本请添加
- sonatype-oss-releases:
-
-libraries:
- com.highcapable.yukireflection:
- api:
- version: +
- ...
-
添加完成后运行一次 Gradle Sync,所有依赖版本将自动装配。
接下来,在你的项目 build.gradle.kts
中部署依赖。
示例如下
dependencies {
- implementation(com.highcapable.yukireflection.api)
- // ...
-}
-
在你的项目 build.gradle.kts
或 build.gradle
中添加存储库。
Kotlin DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址
- maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
-}
-
Groovy DSL
repositories {
- google()
- mavenCentral()
- // MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址
- maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
-}
-
在你的项目 build.gradle.kts
或 build.gradle
中添加依赖。
Kotlin DSL
dependencies {
- implementation("com.highcapable.yukireflection:api:<yuki-version>")
- // ...
-}
-
Groovy DSL
dependencies {
- implementation 'com.highcapable.yukireflection:api:<yuki-version>'
- // ...
-}
-
请将 <yuki-version> 修改为 这里 的最新版本。
特别注意
如果你的项目目前正在使用 YukiHookAPI 的 1.x.x 版本,请不要重复集成 YukiReflection,因为 YukiHookAPI 已经包含了其中的功能且存在针对相关功能的改动,重复集成会造成功能性冲突引发异常,此时你应该前往 YukiHookAPI 的 文档 查看对应的使用教程。
YukiHookAPI 将在 2.x.x 版本完全分离 YukiReflection,届时你可以同时与 YukiHookAPI 使用。
在你的项目 build.gradle.kts
或 build.gradle
中修改 Kotlin 的 Java 版本为 11 及以上。
Kotlin DSL
android {
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = "11"
- }
-}
-
Groovy DSL
android {
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = '11'
- }
-}
-