mirror of
https://github.com/HighCapable/YukiReflection.git
synced 2025-09-07 11:09:52 +08:00
Compare commits
132 Commits
Author | SHA1 | Date | |
---|---|---|---|
10643305ec
|
|||
47d590d6a1
|
|||
d4ccd19ecd
|
|||
a92e4e0dcb
|
|||
b1fa277bc1
|
|||
6fc3448c2d
|
|||
20ead7a981
|
|||
c58771eb1c
|
|||
453c8757a2
|
|||
efeb3aa12a
|
|||
a43ff83fed
|
|||
864a6db24a
|
|||
eb669f3ad5
|
|||
fcaf83b930
|
|||
a3173ab245
|
|||
32910b8348
|
|||
1ec33a30fe
|
|||
7b6262e9a6
|
|||
a13b1d326e
|
|||
5152b895c3
|
|||
8d113ce2ce
|
|||
364f13462c
|
|||
a9ec361c3e
|
|||
9f34d3d975
|
|||
e63cd6341e
|
|||
370a5cfb97
|
|||
217b7d5efe
|
|||
748116bbde
|
|||
1cbb12f9e1
|
|||
dcf0f57648
|
|||
a8c9a3afe1
|
|||
ae372587b7
|
|||
a92328268e
|
|||
be9ae3bde7
|
|||
aa2a057067
|
|||
353e85c03e
|
|||
6a0ff96492
|
|||
12a63e51d8
|
|||
51f411ab39
|
|||
e14a7273d2
|
|||
bcdf203f1f
|
|||
7112845958
|
|||
7c62a6c42a
|
|||
47961b9673
|
|||
414c7ac447
|
|||
b05c18eb10
|
|||
d84fdd6af1
|
|||
99abe9190c
|
|||
98a0c212de
|
|||
7aea96f3fc
|
|||
bed0d42de0
|
|||
6f26fbc73e
|
|||
7a49112446
|
|||
bd68a85171
|
|||
26c2d4c775
|
|||
8faf5f73a7
|
|||
ac40842d9d
|
|||
4f25c89ea7
|
|||
a572c65677
|
|||
a681ac61f7
|
|||
8b7de28e33
|
|||
2fa397f8ac
|
|||
5e34d66f96
|
|||
6e435244f6
|
|||
1ec7fcd33c
|
|||
184701e563
|
|||
7c066af116
|
|||
bb9c38cde9
|
|||
3a0c8cfef6
|
|||
c0a1ab0e1d
|
|||
194fc4425c
|
|||
809220d243
|
|||
6704b06dfa
|
|||
5093caf46e
|
|||
e456636644
|
|||
f1500f0733
|
|||
373899ba5a
|
|||
a85b795a06
|
|||
6b4b33a804
|
|||
25d907ff1e
|
|||
de4b50944e
|
|||
623c55f6fd
|
|||
74fcd0c290
|
|||
8718c14e1b
|
|||
f2b90caab0
|
|||
ac04eacbd4
|
|||
6f8072dd52
|
|||
ce0dd89a05
|
|||
32cd9f4f4c
|
|||
6a8f4d52f6
|
|||
a89176de16
|
|||
03206bb5c9
|
|||
998ad8cd02
|
|||
32702e01f4
|
|||
3c779850f9
|
|||
cbad9c903a
|
|||
b03cd3bf77
|
|||
7a62fc2894
|
|||
98b1c0556e
|
|||
0d386153a2
|
|||
bfcad65dc8
|
|||
1c205afd37
|
|||
d02a5f8282
|
|||
fd79c4ef0d
|
|||
7f15ad57d9
|
|||
4a0cffdb7f
|
|||
47c7600a6b
|
|||
25cb5e773f
|
|||
97d3adc006
|
|||
9d0dcf19df
|
|||
6067ce9123
|
|||
2b90d7ebb6
|
|||
78a399c501
|
|||
0728b5e167
|
|||
aad3f146f8
|
|||
9593ef3408
|
|||
e9219a51f3
|
|||
df6f698629
|
|||
e6cc545fe2
|
|||
9e093e427c
|
|||
44927b534a
|
|||
b79547b9e7
|
|||
f516f2de52
|
|||
3e1d86a57c
|
|||
bb2bfb0dda
|
|||
082fa898df
|
|||
e610fd74e3
|
|||
792ec98a91
|
|||
ff4456aedc
|
|||
33742ef53c
|
|||
2ea858a53f
|
|||
178ebe390f
|
35
.editorconfig
Normal file
35
.editorconfig
Normal file
@@ -0,0 +1,35 @@
|
||||
# noinspection EditorConfigKeyCorrectness
|
||||
[{*.kt,*.kts}]
|
||||
ktlint_standard_annotation = disabled
|
||||
ktlint_standard_filename = disabled
|
||||
ktlint_standard_wrapping = disabled
|
||||
ktlint_standard_import-ordering = enabled
|
||||
ktlint_standard_max-line-length = disabled
|
||||
ktlint_standard_multiline-if-else = disabled
|
||||
ktlint_standard_argument-list-wrapping = disabled
|
||||
ktlint_standard_parameter-list-wrapping = disabled
|
||||
ktlint_standard_trailing-comma-on-declaration-site = disabled
|
||||
ktlint_function_signature_body_expression_wrapping = multiline
|
||||
ktlint_standard_string-template-indent = disabled
|
||||
ktlint_standard_function-signature = disabled
|
||||
ktlint_standard_trailing-comma-on-call-site = disabled
|
||||
ktlint_standard_multiline-expression-wrapping = disabled
|
||||
ktlint_standard_no-empty-first-line-in-class-body = disabled
|
||||
ktlint_standard_if-else-wrapping = disabled
|
||||
ktlint_standard_if-else-bracing = disabled
|
||||
ktlint_standard_statement-wrapping = disabled
|
||||
ktlint_standard_blank-line-before-declaration = disabled
|
||||
ktlint_standard_no-empty-file = disabled
|
||||
ktlint_standard_property-naming = disabled
|
||||
ktlint_standard_function-naming = disabled
|
||||
ktlint_standard_chain-method-continuation = disabled
|
||||
ktlint_standard_class-signature = disabled
|
||||
ktlint_standard_condition-wrapping = disabled
|
||||
ktlint_standard_class-signature = disabled
|
||||
ktlint_standard_no-trailing-spaces = disabled
|
||||
ktlint_standard_multiline-loop = disabled
|
||||
ij_continuation_indent_size = 2
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
max_line_length = 150
|
37
.github/workflows/docs-deploy.yml
vendored
Normal file
37
.github/workflows/docs-deploy.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Deploy to GitHub pages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'docs-source/**'
|
||||
- '.github/workflows/**'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
if: ${{ success() }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Build VuePress site
|
||||
run: |
|
||||
cd docs-source
|
||||
yarn -i
|
||||
yarn docs:build-gh-pages
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: crazy-max/ghaction-github-pages@v4
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: docs-source/dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
117
.gitignore
vendored
117
.gitignore
vendored
@@ -1,15 +1,110 @@
|
||||
## Fully .gtignore for IntelliJ, Android Studio and Gradle based Java projects
|
||||
## References:
|
||||
## - https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
## - https://github.com/android/platform-samples/blob/main/.gitignore
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# AWS User-specific
|
||||
.idea/**/aws.xml
|
||||
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
.idea/.name
|
||||
.idea/artifacts
|
||||
.idea/compiler.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/modules.xml
|
||||
.idea/*.iml
|
||||
.idea/modules
|
||||
.idea/caches
|
||||
.idea/material_theme**
|
||||
.idea/other.xml
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
*.ipr
|
||||
|
||||
# Kotlin
|
||||
.kotlin
|
||||
|
||||
# Misc
|
||||
.idea/misc.xml
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# SonarLint plugin
|
||||
.idea/sonarlint/
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
# Android studio 3.1+ additional
|
||||
.idea/deployment*.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/androidTestResultsUserPreferences.xml
|
||||
|
||||
# Android projects
|
||||
**/local.properties
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
|
||||
# Gradle projects
|
||||
.gradle
|
||||
build/
|
||||
|
||||
# Mkdocs temporary serving folder
|
||||
docs-gen
|
||||
site
|
||||
*.bak
|
||||
.idea/appInsightsSettings.xml
|
||||
|
||||
# Mac OS
|
||||
.DS_Store
|
4
.idea/.gitignore
generated
vendored
4
.idea/.gitignore
generated
vendored
@@ -1,3 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
/gradle.xml
|
||||
/misc.xml
|
||||
/workspace.xml
|
6
.idea/AndroidProjectSystem.xml
generated
Normal file
6
.idea/AndroidProjectSystem.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
6
.idea/compiler.xml
generated
6
.idea/compiler.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
20
.idea/gradle.xml
generated
20
.idea/gradle.xml
generated
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/demo-app" />
|
||||
<option value="$PROJECT_DIR$/yukireflection" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
52
.idea/inspectionProfiles/Project_Default.xml
generated
52
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,11 +1,63 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="CheckImageSize" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ClassCanBeRecord" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="myIgnoredAnnotations">
|
||||
<list>
|
||||
<option value="io.micronaut.*" />
|
||||
<option value="jakarta.*" />
|
||||
<option value="javax.*" />
|
||||
<option value="org.springframework.*" />
|
||||
<option value="java.lang.SuppressWarnings" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="FieldCanBeLocal" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="UnstableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
6
.idea/kotlinc.xml
generated
Normal file
6
.idea/kotlinc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="2.1.10" />
|
||||
</component>
|
||||
</project>
|
7
.idea/ktlint-plugin.xml
generated
Normal file
7
.idea/ktlint-plugin.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KtLint plugin">
|
||||
<ktlintMode>MANUAL</ktlintMode>
|
||||
<formatOnSave>false</formatOnSave>
|
||||
</component>
|
||||
</project>
|
11
.idea/ktlint.xml
generated
Normal file
11
.idea/ktlint.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KtlintProjectConfiguration">
|
||||
<treatAsErrors>false</treatAsErrors>
|
||||
<disabledRules>
|
||||
<list>
|
||||
<option value="package-name" />
|
||||
</list>
|
||||
</disabledRules>
|
||||
</component>
|
||||
</project>
|
10
.idea/migrations.xml
generated
Normal file
10
.idea/migrations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
10
.idea/misc.xml
generated
10
.idea/misc.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
17
.idea/runConfigurations.xml
generated
Normal file
17
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
215
LICENSE
215
LICENSE
@@ -1,21 +1,202 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 HighCapable
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
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:
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Definitions.
|
||||
|
||||
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.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright HighCapable [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
102
README-zh-CN.md
102
README-zh-CN.md
@@ -1,80 +1,72 @@
|
||||
# Yuki Reflection
|
||||
|
||||

|
||||

|
||||
[](https://t.me/YukiReflection)
|
||||
<br/><br/>
|
||||
<img src="https://github.com/fankes/YukiReflection/blob/master/img-src/icon.png?raw=true" width = "100" height = "100"/>
|
||||
<br/>
|
||||
<br/>
|
||||
🌴️ 一个使用 Kotlin 构建的 Android 平台高效反射 API。
|
||||
<br/>
|
||||
[](https://github.com/HighCapable/YukiReflection/blob/master/LICENSE)
|
||||
[](https://github.com/HighCapable/YukiReflection/releases)
|
||||
[](https://t.me/YukiReflection)
|
||||
[](https://t.me/HighCapable_Dev)
|
||||
[](https://qm.qq.com/cgi-bin/qm/qr?k=Pnsc5RY6N2mBKFjOLPiYldbAbprAU3V7&jump_from=webapi&authKey=X5EsOVzLXt1dRunge8ryTxDRrh9/IiW1Pua75eDLh9RE3KXE+bwXIYF5cWri/9lf)
|
||||
|
||||
[English](https://github.com/fankes/YukiReflection/blob/master/README.md) | 简体中文
|
||||
<img src="img-src/icon.png" width = "100" height = "100" alt="LOGO"/>
|
||||
|
||||
🌴️ 一个使用 Kotlin 构建的用于 Java 和 Android 平台高效反射 API。
|
||||
|
||||
[English](README.md) | 简体中文
|
||||
|
||||
| <img src="https://github.com/HighCapable/.github/blob/main/img-src/logo.jpg?raw=true" width = "30" height = "30" alt="LOGO"/> | [HighCapable](https://github.com/HighCapable) |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
|
||||
这个项目属于上述组织,**点击上方链接关注这个组织**,发现更多好项目。
|
||||
|
||||
## 🚨 此项目已停止维护
|
||||
|
||||
此项目由于很多未能解决的黑盒问题已被弃用,我们不再推荐任何人使用它,现在请迁移到全新设计的 [KavaRef](https://github.com/HighCapable/KavaRef)。
|
||||
|
||||
## 这是什么
|
||||
|
||||
- 这是一个使用 Kotlin 基于 Java 原生反射 API 重新打造的一套简洁、高效的反射 API,同时也是 [YukiHookAPI](https://github.com/fankes/YukiHookAPI) 正在使用的核心功能
|
||||
- 名称取自 [《ももくり》女主 栗原 雪(Yuki)](https://www.bilibili.com/bangumi/play/ss5016)
|
||||
这是一个使用 Kotlin 基于 Java 原生反射 API 重新打造的一套简洁、高效的反射 API,同时也是 [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI)
|
||||
正在使用的核心功能。
|
||||
|
||||
## 它能做什么
|
||||
|
||||
- 取代 Java 原生的反射 API,使用更加人性化的语言实现一套更加完善的反射方案
|
||||
- 使用注解的方式声明需要反射的类或方法、变量,构造一个 `stub`,直接调用即可实现与反射 API 相同的功能,更加优雅高效 (正在开发,预计在后期逐渐实现此功能)
|
||||
名称取自 [《ももくり》女主 栗原 雪(Yuki)](https://www.bilibili.com/bangumi/play/ss5016)。
|
||||
|
||||
## 开始使用
|
||||
|
||||
- [点击这里](https://fankes.github.io/YukiReflection/zh-cn/) 前往文档页面查看更多详细教程和内容。
|
||||
[点击这里](https://highcapable.github.io/YukiReflection/zh-cn/) 前往文档页面查看更多详细教程和内容。
|
||||
|
||||
## 联系我们
|
||||
## 项目推广
|
||||
|
||||
- [点击加入 Telegram 群组](https://t.me/YukiReflection)
|
||||
<!--suppress HtmlDeprecatedAttribute -->
|
||||
<div align="center">
|
||||
<h2>嘿,还请君留步!👋</h2>
|
||||
<h3>这里有 Android 开发工具、UI 设计、Gradle 插件、Xposed 模块和实用软件等相关项目。</h3>
|
||||
<h3>如果下方的项目能为你提供帮助,不妨为我点个 star 吧!</h3>
|
||||
<h3>所有项目免费、开源,遵循对应开源许可协议。</h3>
|
||||
<h1><a href="https://github.com/fankes/fankes/blob/main/project-promote/README-zh-CN.md">→ 查看更多关于我的项目,请点击这里 ←</a></h1>
|
||||
</div>
|
||||
|
||||
## 展望未来
|
||||
## Star History
|
||||
|
||||
如果你喜欢 `YukiReflection` 项目,欢迎为此项目贡献你的代码 **PR**,可以是任何改进的建议以及新增的功能。
|
||||
|
||||
## 合作项目
|
||||
|
||||
以下是经过合作并稳定使用 `YukiReflection` 的项目。
|
||||
|
||||
| Repository | Developer |
|
||||
|------------------------------------------------------|------------------------------------------|
|
||||
| [YukiHookAPI](https://github.com/fankes/YukiHookAPI) | [fankesyooni](https://github.com/fankes) |
|
||||
|
||||
你也在使用 `YukiReflection` 吗?快来 **PR** 将你的存储仓库添加到上方的列表 (私有仓库可以不需要注明网页链接)。
|
||||
|
||||
## 捐赠支持
|
||||
|
||||
- 工作不易,无意外情况此项目将继续维护下去,提供更多可能,欢迎打赏。<br/><br/>
|
||||
<img src="https://github.com/fankes/YukiReflection/blob/master/img-src/wechat_code.jpg?raw=true" width = "200" height = "200"/>
|
||||

|
||||
|
||||
## 许可证
|
||||
|
||||
- [MIT](https://choosealicense.com/licenses/mit)
|
||||
- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
```
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
||||
版权所有 © 2019-2023 HighCapable
|
||||
版权所有 © 2019 HighCapable
|
102
README.md
102
README.md
@@ -1,79 +1,73 @@
|
||||
# Yuki Reflection
|
||||
|
||||

|
||||

|
||||
[](https://t.me/YukiReflection)
|
||||
<br/><br/>
|
||||
<img src="https://github.com/fankes/YukiReflection/blob/master/img-src/icon.png?raw=true" width = "100" height = "100"/>
|
||||
<br/>
|
||||
<br/>
|
||||
🌴️ An efficient Reflection API for the Android platform built in Kotlin.
|
||||
<br/>
|
||||
[](https://github.com/HighCapable/YukiReflection/blob/master/LICENSE)
|
||||
[](https://github.com/HighCapable/YukiReflection/releases)
|
||||
[](https://t.me/YukiReflection)
|
||||
[](https://t.me/HighCapable_Dev)
|
||||
[](https://qm.qq.com/cgi-bin/qm/qr?k=Pnsc5RY6N2mBKFjOLPiYldbAbprAU3V7&jump_from=webapi&authKey=X5EsOVzLXt1dRunge8ryTxDRrh9/IiW1Pua75eDLh9RE3KXE+bwXIYF5cWri/9lf)
|
||||
|
||||
English | [简体中文](https://github.com/fankes/YukiReflection/blob/master/README-zh-CN.md)
|
||||
<img src="img-src/icon.png" width = "100" height = "100" alt="LOGO"/>
|
||||
|
||||
🌴️ An efficient Reflection API for Java and Android built in Kotlin.
|
||||
|
||||
English | [简体中文](README-zh-CN.md)
|
||||
|
||||
| <img src="https://github.com/HighCapable/.github/blob/main/img-src/logo.jpg?raw=true" width = "30" height = "30" alt="LOGO"/> | [HighCapable](https://github.com/HighCapable) |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
|
||||
This project belongs to the above-mentioned organization, **click the link above to follow this organization** and discover more good projects.
|
||||
|
||||
## 🚨 Maintenance of this project has been stopped
|
||||
|
||||
The `YukiReflection` project has been deprecated due to many unsolved black box issues, so we no longer recommend anyone to use it.
|
||||
Please now migrate to the brand new design [KavaRef](https://github.com/HighCapable/KavaRef).
|
||||
|
||||
## What's this
|
||||
|
||||
- This is a concise and efficient Reflection API rebuilt based on Java's native Reflection API using Kotlin, and it is also the core function
|
||||
being used by [YukiHookAPI](https://github.com/fankes/YukiHookAPI)
|
||||
- The name is taken from ["ももくり" heroine Yuki Kurihara](https://www.bilibili.com/bangumi/play/ss5016)
|
||||
This is a concise and efficient Reflection API rebuilt based on Java's native Reflection API using Kotlin,
|
||||
and it is also the core function being used by [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI).
|
||||
|
||||
## What it can do
|
||||
|
||||
- Instead of Java's native Reflection API, use a more user-friendly language to implement a more complete set of reflection solutions
|
||||
- Use annotations to declare classes, methods, and fields that need reflection, construct a `stub`, and call directly to achieve the same
|
||||
function as the Reflection API, which is more elegant and efficient (under development, and it is expected to gradually implement this function
|
||||
later)
|
||||
The name is taken from ["ももくり" heroine Yuki Kurihara](https://www.bilibili.com/bangumi/play/ss5016).
|
||||
|
||||
## Get Started
|
||||
|
||||
- [Click here](https://fankes.github.io/YukiReflection/en/) go to the documentation page for more detailed tutorials and content.
|
||||
[Click here](https://highcapable.github.io/YukiReflection/en/) go to the documentation page for more detailed tutorials and content.
|
||||
|
||||
## Contacts
|
||||
## Promotion
|
||||
|
||||
- [Follow us on Telegram](https://t.me/YukiReflection)
|
||||
<!--suppress HtmlDeprecatedAttribute -->
|
||||
<div align="center">
|
||||
<h2>Hey, please stay! 👋</h2>
|
||||
<h3>Here are related projects such as Android development tools, UI design, Gradle plugins, Xposed Modules and practical software. </h3>
|
||||
<h3>If the project below can help you, please give me a star! </h3>
|
||||
<h3>All projects are free, open source, and follow the corresponding open source license agreement. </h3>
|
||||
<h1><a href="https://github.com/fankes/fankes/blob/main/project-promote/README.md">→ To see more about my projects, please click here ←</a></h1>
|
||||
</div>
|
||||
|
||||
## Features
|
||||
## Star History
|
||||
|
||||
If you like the `YukiReflection` project, we welcome you to make a **PR** in this project, any suggestions for improvement and new features.
|
||||
|
||||
## Cooperations
|
||||
|
||||
The following are projects that have collaborated and are using `YukiReflection`.
|
||||
|
||||
| Repository | Developer |
|
||||
|------------------------------------------------------|------------------------------------------|
|
||||
| [YukiHookAPI](https://github.com/fankes/YukiHookAPI) | [fankesyooni](https://github.com/fankes) |
|
||||
|
||||
Are you also using `YukiReflection`? Come and **PR** to add your repository to the list above (private repositories do not need to indicate web
|
||||
links).
|
||||

|
||||
|
||||
## License
|
||||
|
||||
- [MIT](https://choosealicense.com/licenses/mit)
|
||||
- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
|
||||
```
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
||||
Copyright © 2019-2023 HighCapable
|
||||
Copyright © 2019 HighCapable
|
45
build.gradle
45
build.gradle
@@ -1,45 +0,0 @@
|
||||
//file:noinspection unused
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.0' apply false
|
||||
id 'com.android.library' version '7.4.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.7.22' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.7.22' apply false
|
||||
}
|
||||
|
||||
ext {
|
||||
devId = "0"
|
||||
devUser = "fankesyooni"
|
||||
userEmail = "qzmmcn@163.com"
|
||||
groupId = "com.highcapable.yukireflection"
|
||||
apiVersion = "1.0.0"
|
||||
repoName = "YukiReflection"
|
||||
repoDescription = "An efficient Reflection API for the Android platform built in Kotlin."
|
||||
licenceName = "MIT License"
|
||||
licenceUrl = "https://github.com/fankes/YukiReflection/blob/master/LICENSE"
|
||||
website = "https://github.com/fankes/YukiReflection"
|
||||
githubConnection = "scm:git:git://github.com/path/to/repo.git"
|
||||
githubDeveloperConnection = "scm:git:ssh://github.com/path/to/repo.git"
|
||||
githubUrl = "https://github.com/path/to/repo"
|
||||
ossName = "OSSRH"
|
||||
ossUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取授权文件内容 - 用于 Maven 的提交
|
||||
*
|
||||
* 若编译失败请将路径替换为自己的或置空
|
||||
* @param name
|
||||
* @return [String]
|
||||
*/
|
||||
static String getFileContent(String name) {
|
||||
String result = ""
|
||||
try {
|
||||
FileReader reader = new FileReader("/Users/fankes/Project/Android/Library/YukiReflection/.gradle/" + name)
|
||||
BufferedReader buff = new BufferedReader(reader)
|
||||
result = buff.readLine()
|
||||
buff.close()
|
||||
reader.close()
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
return result
|
||||
}
|
7
build.gradle.kts
Normal file
7
build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
||||
plugins {
|
||||
autowire(libs.plugins.android.application) apply false
|
||||
autowire(libs.plugins.kotlin.jvm) apply false
|
||||
autowire(libs.plugins.kotlin.android) apply false
|
||||
autowire(libs.plugins.jetbrains.compose) apply false
|
||||
autowire(libs.plugins.compose.compiler) apply false
|
||||
}
|
1
demo-app/.gitignore
vendored
1
demo-app/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build
|
@@ -1,55 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.highcapable.yukireflection.demo_app'
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.highcapable.yukireflection.demo_app"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
freeCompilerArgs = [
|
||||
'-Xno-param-assertions',
|
||||
'-Xno-call-assertions',
|
||||
'-Xno-receiver-assertions'
|
||||
]
|
||||
}
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':yukireflection')
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||
implementation 'com.google.android.material:material:1.7.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package com.highcapable.yukireflection.demo_app.test;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
public class Main {
|
||||
|
||||
private static String staticContent = "I am static!";
|
||||
|
||||
private final String content;
|
||||
|
||||
public Main(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public static String getStaticContent() {
|
||||
return staticContent;
|
||||
}
|
||||
}
|
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* YukiReflection - An efficient Reflection API for the Android platform built in Kotlin.
|
||||
* Copyright (C) 2019-2023 HighCapable
|
||||
* https://github.com/fankes/YukiReflection
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This file is Created by fankes on 2023/1/21.
|
||||
*/
|
||||
@file:Suppress("SetTextI18n", "UsePropertyAccessSyntax")
|
||||
|
||||
package com.highcapable.yukireflection.demo_app.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.highcapable.yukireflection.demo_app.databinding.ActivityMainBinding
|
||||
import com.highcapable.yukireflection.demo_app.test.Main
|
||||
import com.highcapable.yukireflection.factory.*
|
||||
import com.highcapable.yukireflection.type.java.StringClass
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||
setContentView(root)
|
||||
testObjectDirectlyButton.setOnClickListener {
|
||||
tipText.text = Main("I am directly call of new object").getContent()
|
||||
}
|
||||
testObjectReflectionButton.setOnClickListener {
|
||||
tipText.text =
|
||||
classOf<Main>().buildOf("I am reflection call of new object") { param(StringClass) }
|
||||
?.current()
|
||||
?.method {
|
||||
name = "getContent"
|
||||
emptyParam()
|
||||
}?.string() ?: ""
|
||||
}
|
||||
testStaticDirectlyButton.setOnClickListener {
|
||||
tipText.text = Main.getStaticContent()
|
||||
}
|
||||
testStaticReflectionButton.setOnClickListener {
|
||||
tipText.text = classOf<Main>().method {
|
||||
name = "getStaticContent"
|
||||
modifiers { isStatic }
|
||||
}.get().string()
|
||||
}
|
||||
testModifyStaticReflectionButton.setOnClickListener {
|
||||
classOf<Main>().field {
|
||||
name = "staticContent"
|
||||
modifiers { isStatic }
|
||||
}.get().set("I am static! Modified by reflection")
|
||||
tipText.text = "Field is modified success"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.MainActivity"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Using functions below to test"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tip_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:text="Waiting for your operation"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_object_directly_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Create an Object and Call Directly" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_object_reflection_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Create an Object and Call Reflection" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_static_directly_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Get Static and Call Directly" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_static_reflection_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Get Static and Call Reflection" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_modify_static_reflection_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Modified Static Field Using Reflection" />
|
||||
</LinearLayout>
|
7
docs-source/.gitignore
vendored
7
docs-source/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
src/.vuepress/.cache
|
||||
src/.vuepress/.temp
|
||||
/node_modules
|
||||
/src/.vuepress/.cache
|
||||
/src/.vuepress/.temp
|
||||
/dist
|
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "yukireflection_docs",
|
||||
"license": "MIT",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@mr-hope/vuepress-plugin-copy-code": "^1.30.0",
|
||||
"@vuepress/plugin-prismjs": "^2.0.0-beta.51",
|
||||
"@vuepress/plugin-search": "^2.0.0-beta.51",
|
||||
"@vuepress/plugin-shiki": "^2.0.0-beta.51",
|
||||
"vuepress": "^2.0.0-beta.51"
|
||||
"@vuepress/plugin-prismjs": "2.0.0-rc.0",
|
||||
"@vuepress/plugin-search": "2.0.0-rc.0",
|
||||
"@vuepress/plugin-shiki": "2.0.0-rc.0",
|
||||
"vuepress": "2.0.0-rc.0"
|
||||
},
|
||||
"scripts": {
|
||||
"docs:dev": "vuepress dev src",
|
||||
"docs:build": "vuepress build src"
|
||||
"docs:build": "vuepress build src",
|
||||
"docs:build-gh-pages": "vuepress build src && touch dist/.nojekyll"
|
||||
}
|
||||
}
|
38
docs-source/src/.vuepress/client.ts
Normal file
38
docs-source/src/.vuepress/client.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { defineClientConfig } from '@vuepress/client'
|
||||
import { h, onMounted, watch } from 'vue'
|
||||
import DeprecatedBanner from './components/DeprecatedBanner.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
export default defineClientConfig({
|
||||
rootComponents: [
|
||||
() => h(DeprecatedBanner)
|
||||
],
|
||||
setup() {
|
||||
const route = useRoute()
|
||||
|
||||
const adjustLayout = () => {
|
||||
requestAnimationFrame(() => {
|
||||
const banner = document.querySelector('.deprecated-banner') as HTMLElement
|
||||
const height = banner?.clientHeight ?? 0
|
||||
|
||||
const themeContainer = document.querySelector('.theme-container') as HTMLElement
|
||||
const navbar = document.querySelector('.navbar') as HTMLElement
|
||||
const sidebar = document.querySelector('.sidebar') as HTMLElement
|
||||
|
||||
if (height > 0) {
|
||||
if (themeContainer) themeContainer.style.paddingTop = `${height}px`
|
||||
if (navbar) navbar.style.marginTop = `${height}px`
|
||||
if (sidebar) sidebar.style.marginTop = `${height}px`
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
adjustLayout()
|
||||
})
|
||||
|
||||
watch(() => route.path, () => {
|
||||
adjustLayout()
|
||||
})
|
||||
}
|
||||
})
|
35
docs-source/src/.vuepress/components/DeprecatedBanner.vue
Normal file
35
docs-source/src/.vuepress/components/DeprecatedBanner.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div class="deprecated-banner">
|
||||
YukiReflection is deprecated, Start trying <a href="https://github.com/HighCapable/KavaRef" target="_blank"
|
||||
rel="noopener">KavaRef</a> now! 
|
||||
YukiReflection 已被弃用,立即尝试 <a href="https://github.com/HighCapable/KavaRef/blob/main/README-zh-CN.md"
|
||||
target="_blank" rel="noopener">KavaRef</a> 吧!
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.deprecated-banner {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #ffdddd;
|
||||
color: #a00000;
|
||||
text-align: center;
|
||||
padding: 12px 24px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
z-index: 9999;
|
||||
|
||||
}
|
||||
|
||||
.deprecated-banner a {
|
||||
color: #a00000;
|
||||
text-decoration: underline;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.deprecated-banner a:hover {
|
||||
color: #600000;
|
||||
}
|
||||
</style>
|
@@ -25,7 +25,7 @@ export default {
|
||||
navbar: navBarItems['/en/'],
|
||||
selectLanguageText: 'English (US)',
|
||||
selectLanguageName: 'English',
|
||||
editLinkText: 'Edit this page on Github',
|
||||
editLinkText: 'Edit this page on GitHub',
|
||||
tip: 'Tips',
|
||||
warning: 'Notice',
|
||||
danger: 'Pay Attention',
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
navbar: navBarItems['/zh-cn/'],
|
||||
selectLanguageText: '简体中文 (CN)',
|
||||
selectLanguageName: '简体中文',
|
||||
editLinkText: '在 Github 上编辑此页',
|
||||
editLinkText: '在 GitHub 上编辑此页',
|
||||
notFound: ['这里什么都没有', '我们怎么到这来了?', '这是一个 404 页面', '看起来我们进入了错误的链接'],
|
||||
backToHome: '回到首页',
|
||||
contributorsText: '贡献者',
|
||||
|
@@ -23,6 +23,7 @@ const navigationLinks = {
|
||||
baseApiPath + 'type/android/ViewTypeFactory',
|
||||
baseApiPath + 'type/java/VariableTypeFactory',
|
||||
baseApiPath + 'type/defined/DefinedTypeFactory',
|
||||
baseApiPath + 'log/YLog',
|
||||
baseApiPath + 'factory/ReflectionFactory',
|
||||
baseApiPath + 'finder/members/MethodFinder',
|
||||
baseApiPath + 'finder/members/ConstructorFinder',
|
||||
@@ -52,7 +53,7 @@ const navigationLinks = {
|
||||
|
||||
export const configs = {
|
||||
dev: {
|
||||
dest: '../docs/',
|
||||
dest: 'dist',
|
||||
port: 9000
|
||||
},
|
||||
website: {
|
||||
@@ -63,16 +64,16 @@ export const configs = {
|
||||
locales: {
|
||||
'/en/': {
|
||||
lang: 'en-US',
|
||||
description: 'An efficient Reflection API for the Android platform built in Kotlin'
|
||||
description: 'An efficient Reflection API for Java and Android built in Kotlin'
|
||||
},
|
||||
'/zh-cn/': {
|
||||
lang: 'zh-CN',
|
||||
description: '一个使用 Kotlin 构建的 Android 平台高效反射 API'
|
||||
description: '一个使用 Kotlin 构建的用于 Java 和 Android 平台高效反射 API'
|
||||
}
|
||||
}
|
||||
},
|
||||
github: {
|
||||
repo: 'https://github.com/fankes/YukiReflection',
|
||||
repo: 'https://github.com/HighCapable/YukiReflection',
|
||||
branch: 'master',
|
||||
dir: 'docs-source/src'
|
||||
}
|
||||
|
@@ -1,33 +1,27 @@
|
||||
# About this Document
|
||||
# About This Document
|
||||
|
||||
> This document is powered by [VuePress](https://v2.vuepress.vuejs.org/en).
|
||||
|
||||
## License
|
||||
|
||||
[The MIT License (MIT)](https://github.com/fankes/YukiReflection/blob/master/LICENSE)
|
||||
[Apache-2.0](https://github.com/HighCapable/YukiReflection/blob/master/LICENSE)
|
||||
|
||||
```:no-line-numbers
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
||||
Copyright © 2019-2023 HighCapable
|
||||
Copyright © 2019 HighCapable
|
@@ -16,6 +16,32 @@ Time zone of version release date: **UTC+8**
|
||||
|
||||
:::
|
||||
|
||||
### 1.0.0 | 2023.01.26  <Badge type="tip" text="latest" vertical="middle" />
|
||||
### 1.0.3 | 2023.10.07  <Badge type="tip" text="latest" vertical="middle" />
|
||||
|
||||
- The license agreement has been changed from `MIT` to `Apache-2.0`, subsequent versions will be distributed under this license agreement, you should change the relevant license agreement after using this version
|
||||
- Change the type of dependency library from **Android Library** (aar) back to **Java Library** (jar)
|
||||
- Adapt and support the native Java platform (some functions are only available on the Android platform)
|
||||
- Fixed [fix get interfaces of class](https://github.com/HighCapable/YukiHookAPI/pull/38) issue and merged into `YukiReflection`
|
||||
- Deprecated ~~`isAllowPrintingLogs`~~, please start using the `debugLog` method
|
||||
- Added `YukiReflection.TAG`
|
||||
- Obsolete ~~`YukiReflection.API_VERSION_NAME`~~, ~~`YukiReflection.API_VERSION_CODE`~~, merged into `YukiReflection.VERSION`
|
||||
- Refactored `remendy` functionality in find methods, which now prints exceptions in steps
|
||||
- The multi-method find result type is changed from `HashSet` to `MutableList`
|
||||
- Added `method()`, `constructor()`, `field()` to directly obtain all object functions in the class
|
||||
- `constructor()` no longer behaves like `constructor { emptyParam() }`
|
||||
- Added `lazyClass` and `lazyClassOrNull` methods to lazily load `Class`
|
||||
|
||||
### 1.0.2 | 2023.04.25  <Badge type="warning" text="stale" vertical="middle" />
|
||||
|
||||
- Fixed a critical issue where the `Member` cache did not take effect and persistent storage eventually caused app out of memory (OOM), thanks to [Art-Chen](https://github.com/Art-Chen)
|
||||
- Remove the direct cache function of `Member` and deprecated ~~`YukiReflection.Configs.isEnableMemberCache`~~, keep the cache function of `Class`
|
||||
- Modified finder to `Sequence`, optimize the finding speed and performance of `Member`
|
||||
|
||||
### 1.0.1 | 2023.04.16  <Badge type="warning" text="stale" vertical="middle" />
|
||||
|
||||
- Change the type of dependency library from **Java Library** (jar) to **Android Library** (aar)
|
||||
- Removed wrong `Class` object declaration in Android `type`
|
||||
|
||||
### 1.0.0 | 2023.01.26  <Badge type="warning" text="stale" vertical="middle" />
|
||||
|
||||
- The first version is submitted to Maven
|
@@ -2,12 +2,15 @@
|
||||
|
||||
> If you have any questions in use, or have any constructive suggestions, you can contact us.
|
||||
|
||||
Join us [Click to join Telegram group](https://t.me/YukiReflection)
|
||||
Join our developers group.
|
||||
|
||||
Find me on **Twitter** [@fankesyooni](https://twitter.com/fankesyooni)
|
||||
- [Click to join Telegram group](https://t.me/YukiReflection)
|
||||
- [Click to join Telegram group (Developer)](https://t.me/HighCapable_Dev)
|
||||
|
||||
Find me on **Twitter** [@fankesyooni](https://twitter.com/fankesyooni).
|
||||
|
||||
## Help with Maintenance
|
||||
|
||||
Thank you for choosing and using `YukiReflection`.
|
||||
|
||||
If you have code-related suggestions and requests, you can submit a Pull Request on Github.
|
||||
If you have code-related suggestions and requests, you can submit a Pull Request on GitHub.
|
@@ -8,9 +8,9 @@
|
||||
|
||||
### Automatically Generate Reflection Code
|
||||
|
||||
Use `stub` to create a `Kotlin` class, and declare the parameters in it, as well as its different states in each version.
|
||||
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.
|
||||
For example, the Java class below is the target class we need to reflect.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -56,7 +56,7 @@ classOf<MyClass>().buildOf().current {
|
||||
}
|
||||
```
|
||||
|
||||
The function to be implemented at present can be directly defined as the following `Kotlin` class using the reflection function.
|
||||
The function to be implemented at present can be directly defined as the following Kotlin class using the reflection function.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -80,7 +80,7 @@ class MyClass {
|
||||
}
|
||||
```
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
@@ -101,4 +101,119 @@ MyClass().also {
|
||||
|
||||
The above functions may change after the actual release, and the functions of the actual version shall prevail.
|
||||
|
||||
:::
|
||||
|
||||
### Automatically Generate Directly Called Class Objects
|
||||
|
||||
In Kotlin, the way to represent Java class objects is `YourObject::class.java`.
|
||||
|
||||
This writing method is usually very long and will be very unsightly when used extensively during reflection.
|
||||
|
||||
In the existing version, we have built-in commonly used `Class` objects, but this will increase the size of dependencies, and these objects may not be used in most cases.
|
||||
|
||||
For example, `StringClass`, `IntType`, etc., these objects are built in `YukiReflection`.
|
||||
|
||||
So we plan to add a function in the future, which can use `properties` to create a list of `Class` objects that need to be generated,
|
||||
and generate these `Class` objects in sequence through the Gradle plugin.
|
||||
|
||||
`Class` objects of primitive types such as those mentioned above will still be built into `YukiReflection`,
|
||||
and the remaining `Class` objects need to be defined by yourself.
|
||||
|
||||
The generated name specification is **Class Name + Class**.
|
||||
|
||||
In order to prevent package name conflicts, you can control the sub-package name of the generated `Class` object.
|
||||
|
||||
In the configuration file, you don't need to add `Class` as a suffix.
|
||||
|
||||
You can define the generated root package name in the Gradle plugin, which defaults to `com.highcapable.yukireflection.generated.classes`.
|
||||
|
||||
> The following example
|
||||
|
||||
```properties
|
||||
# The most basic way to define is to write the name directly
|
||||
# Will be generated to com.highcapable.yukireflection.generated.classes.BundleClass
|
||||
android.os.Bundle=Bundle
|
||||
# You can use the "." form in front to define the prefixed subpackage name
|
||||
# For example, we want to define this class to the desired package name
|
||||
# Will be generated to com.highcapable.yukireflection.generated.classes.myandroid.myos.BundleClass
|
||||
android.os.Bundle=myandroid.myos.Bundle
|
||||
# You can also not fill in the key value content, which will use the key value name
|
||||
# as the defined package name and class name
|
||||
# Will be generated to com.highcapable.yukireflection.generated.classes.android.os.BundleClass
|
||||
android.os.Bundle
|
||||
```
|
||||
|
||||
The approximate code form of the `Class` object generated by the above method is as follows.
|
||||
|
||||
```kotlin
|
||||
package com.highcapable.yukireflection.generated.classes.android.os
|
||||
|
||||
// Used with default ClassLoader
|
||||
val BundleClass: Class<*> = "android.os.Bundle".toClass()
|
||||
|
||||
// Used when ClassLoader is specified
|
||||
fun BundleClass(loader: ClassLoader): Class<*> = "android.os.Bundle".toClass(loader)
|
||||
```
|
||||
|
||||
Maybe this `Class` may not be obtained in some cases.
|
||||
|
||||
In this case, you can refer to the following configuration method.
|
||||
|
||||
> The following example
|
||||
|
||||
```properties
|
||||
# Add "?" after the key value to define a nullable Class object
|
||||
android.os.Bundle?
|
||||
```
|
||||
|
||||
The approximate code form of the `Class` object generated by the above method is as follows.
|
||||
|
||||
```kotlin
|
||||
package com.highcapable.yukireflection.generated.classes.android.os
|
||||
|
||||
// Used with default ClassLoader
|
||||
val BundleClass: Class<*>? = "android.os.Bundle".toClassOrNull()
|
||||
|
||||
// Used when ClassLoader is specified
|
||||
fun BundleClass(loader: ClassLoader): Class<*>? = "android.os.Bundle".toClassOrNull(loader)
|
||||
```
|
||||
|
||||
If this `Class` object can be referenced by direct call, you can refer to the following configuration method at this time.
|
||||
|
||||
> The following example
|
||||
|
||||
```properties
|
||||
# Add "!!" after the key value to define a Class object that can be called directly
|
||||
android.os.Bundle!!
|
||||
```
|
||||
|
||||
The approximate code form of the `Class` object generated by the above method is as follows.
|
||||
|
||||
```kotlin
|
||||
package com.highcapable.yukireflection.generated.classes.android.os
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
// Used with default ClassLoader
|
||||
val BundleClass: Class<Bundle> = classOf<Bundle>()
|
||||
|
||||
// Used when ClassLoader is specified
|
||||
fun BundleClass(loader: ClassLoader): Class<Bundle> = classOf<Bundle>(loader)
|
||||
```
|
||||
|
||||
With the generated `Class` object, we can happily use `YukiReflection` for reflection.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
The above functions may change after the actual release, and the functions of the actual version shall prevail.
|
||||
|
||||
:::
|
@@ -70,6 +70,52 @@ For more functions, please refer to [classOf](../api/public/com/highcapable/yuki
|
||||
|
||||
:::
|
||||
|
||||
### Lazy Loading
|
||||
|
||||
Suppose we want to get a `Class` that cannot be called directly, but we do not need this `Class` immediately.
|
||||
|
||||
At this time, you can use `lazyClass` to complete this function.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Lazy loading of this Class
|
||||
val instance by lazyClass("com.demo.Test")
|
||||
// Customize the ClassLoader where the Class is located
|
||||
val customClassLoader: ClassLoader? = ... // Assume this is your ClassLoader
|
||||
val instance by lazyClass("com.demo.Test") { customClassLoader }
|
||||
// Call this Class at the appropriate time
|
||||
instance.method {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
If the current `Class` does not exist, using the above method will throw an exception.
|
||||
|
||||
If you are not sure whether `Class` exists, you can refer to the following solution.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Lazy loading of this Class
|
||||
// If not available, the result will be null but no exception will be thrown
|
||||
val instance by lazyClassOrNull("com.demo.Test")
|
||||
// Customize the ClassLoader where the 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
|
||||
val instance by lazyClassOrNull("com.demo.Test") { customClassLoader }
|
||||
// Call this Class at the appropriate time
|
||||
instance?.method {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
For more functions, please refer to [lazyClass](../public/com/highcapable/yukireflection/factory/ReflectionFactory#lazyclass-method), [lazyClassOrNull](../public/com/highcapable/yukireflection/factory/ReflectionFactory#lazyclassornull-method) methods.
|
||||
|
||||
:::
|
||||
|
||||
### Existential Judgment
|
||||
|
||||
Suppose we want to determine whether a `Class` exists.
|
||||
@@ -126,6 +172,8 @@ At this point, there is `DexClassFinder`, its role is to determine the instance
|
||||
|
||||
::: warning
|
||||
|
||||
**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**.
|
||||
@@ -142,6 +190,14 @@ Please note that the more the same type **Class** is matched, the slower the spe
|
||||
|
||||
:::
|
||||
|
||||
::: danger
|
||||
|
||||
After **YukiHookAPI** **2.0.0** released, this function will be deprecated and will be removed directly from **YukiReflection**.
|
||||
|
||||
We welcome all developers to start using [DexKit](https://github.com/LuckyPray/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.
|
||||
|
||||
:::
|
||||
|
||||
#### Get Started
|
||||
|
||||
Below is a simple usage example.
|
||||
@@ -1148,7 +1204,7 @@ instance.current {
|
||||
name = "stop"
|
||||
emptyParam()
|
||||
}.call()
|
||||
// ❗ Note that because current() returns the CurrentClass object itself
|
||||
// Note that because current() returns the CurrentClass object itself
|
||||
// It CANNOT BE CALLED like the following
|
||||
instance.current().current()
|
||||
```
|
||||
@@ -1527,11 +1583,7 @@ For more functions, please refer to [CurrentClass.generic](../api/public/com/hig
|
||||
|
||||
#### Restrictive Find Conditions
|
||||
|
||||
::: danger
|
||||
|
||||
In find conditions you can only use **index** function once except **order**.
|
||||
|
||||
:::
|
||||
In find conditions you can <u>**only**</u> use `index` function once except `order`.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -1539,7 +1591,7 @@ In find conditions you can only use **index** function once except **order**.
|
||||
method {
|
||||
name = "test"
|
||||
param(BooleanType).index(num = 2)
|
||||
// ❗ Wrong usage, please keep only one index method
|
||||
// Wrong usage, please keep only one index method
|
||||
returnType(StringClass).index(num = 1)
|
||||
}
|
||||
```
|
||||
@@ -1558,12 +1610,8 @@ method {
|
||||
|
||||
#### Necessary Find Conditions
|
||||
|
||||
::: danger
|
||||
|
||||
In common method find conditions, <u>**even methods without parameters need to set find conditions**</u>.
|
||||
|
||||
:::
|
||||
|
||||
Suppose we have the following `Class`.
|
||||
|
||||
> The following example
|
||||
@@ -1613,9 +1661,13 @@ TestFoo::class.java.method {
|
||||
|
||||
At this point, the above example will perfectly match the `public void foo()` method.
|
||||
|
||||
#### Abbreviated Find Conditions
|
||||
::: tip Compatibility Notes
|
||||
|
||||
> In the construction method find conditions, <u>**constructors without parameters do not need to fill in the find conditions**</u>.
|
||||
In the past historical versions of the API, it was allowed to match the method without writing the default matching no-parameter method, but the latest version has corrected this problem, please make sure that you are using the latest API version.
|
||||
|
||||
:::
|
||||
|
||||
In the find conditions for constructors, <u>**even constructors without parameters need to set find conditions**</u>.
|
||||
|
||||
Suppose we have the following `Class`.
|
||||
|
||||
@@ -1630,7 +1682,7 @@ public class TestFoo {
|
||||
}
|
||||
```
|
||||
|
||||
We want to get the `public TestFoo()` constructor, which can be written as follows.
|
||||
To get the `public TestFoo()` constructor, we must write it in the following form.
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -1638,23 +1690,57 @@ We want to get the `public TestFoo()` constructor, which can be written as follo
|
||||
TestFoo::class.java.constructor { emptyParam() }
|
||||
```
|
||||
|
||||
The above example can successfully obtain the `public TestFoo()` constructor, but it feels a bit cumbersome.
|
||||
The above example can successfully obtain the `public TestFoo()` constructor.
|
||||
|
||||
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.
|
||||
If you write `constructor()` and miss `emptyParam()`, the result found at this time will be the first one in bytecode order, <u>**may not be parameterless** </u>.
|
||||
|
||||
::: tip Compatibility Notes
|
||||
|
||||
In past historical versions of the API, if the constructor does not fill in any search parameters, the constructor will not be found directly.
|
||||
|
||||
<u>**This is a BUG and has been fixed in the latest version**</u>, please make sure you are using the latest API version.
|
||||
|
||||
:::
|
||||
|
||||
::: danger API Behavior Changes
|
||||
|
||||
In **1.2.0** and later versions, the behavior of **constructor()** is no longer **constructor { emptyParam() }** but **constructor {}**, please pay attention to the behavior change reasonably adjust the find parameters.
|
||||
|
||||
:::
|
||||
|
||||
#### No Find Conditions
|
||||
|
||||
Without setting find conditions, using `field()`, `constructor()`, `method()` will return all members under the current `Class`.
|
||||
|
||||
Using `get(...)` or `give()` will only get the first bit in bytecode order.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
TestFoo::class.java.constructor()
|
||||
Test::class.java.field().get(...)
|
||||
Test::class.java.method().give()
|
||||
```
|
||||
|
||||
If you want to get all members, you can use `all(...)` or `giveAll()`
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
Test::class.java.field().all(...)
|
||||
Test::class.java.method().giveAll()
|
||||
```
|
||||
|
||||
::: tip Compatibility Notes
|
||||
|
||||
In past historical versions of the API, failure to set find conditions will throw an exception.
|
||||
|
||||
This feature was added in **1.2.0** and later versions.
|
||||
|
||||
:::
|
||||
|
||||
#### Bytecode Type
|
||||
|
||||
::: danger
|
||||
|
||||
In the bytecode call result, the **cast** method can only specify the type corresponding to the bytecode.
|
||||
|
||||
:::
|
||||
In the bytecode call result, the **cast** method can <u>**only**</u> specify the type corresponding to the bytecode.
|
||||
|
||||
For example we want to get a field of type `Boolean` and cast it to `String`.
|
||||
|
||||
@@ -1666,7 +1752,7 @@ The following is the wrong way to use it.
|
||||
field {
|
||||
name = "test"
|
||||
type = BooleanType
|
||||
}.get().string() // ❗ Wrong usage, must be cast to the bytecode target type
|
||||
}.get().string() // Wrong usage, must be cast to the bytecode target type
|
||||
```
|
||||
|
||||
The following is the correct way to use it.
|
||||
@@ -1693,7 +1779,7 @@ field {
|
||||
}
|
||||
```
|
||||
|
||||
Expressing the type of `Boolean::class.javaPrimitiveType` in `Kotlin` is very long and inconvenient.
|
||||
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**.
|
||||
|
||||
@@ -1744,7 +1830,7 @@ At the same time, they all have their own corresponding package types in Java, s
|
||||
|
||||
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 <u>**unequal**</u>.
|
||||
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 <u>**unequal**</u>.
|
||||
|
||||
:::
|
||||
|
||||
|
@@ -18,39 +18,59 @@ object YukiReflection
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是 `YukiReflection` 的装载调用类。
|
||||
|
||||
## API_VERSION_NAME <span class="symbol">- field</span>
|
||||
## TAG <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val API_VERSION_NAME: String
|
||||
const val TAG: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 `YukiReflection` 的名称 (标签)。
|
||||
|
||||
## VERSION <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val VERSION: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获取当前 `YukiReflection` 的版本。
|
||||
|
||||
## API_VERSION_CODE <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val API_VERSION_CODE: Int
|
||||
```
|
||||
<h2 class="deprecated">API_VERSION_NAME - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.0.3` `deprecated`
|
||||
|
||||
> 获取当前 `YukiReflection` 的版本号。
|
||||
不再区分版本名称和版本号,请迁移到 `VERSION`
|
||||
|
||||
<h2 class="deprecated">API_VERSION_CODE - field</h2>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `deprecated`
|
||||
|
||||
不再区分版本名称和版本号,请迁移到 `VERSION`
|
||||
|
||||
## Configs <span class="symbol">- object</span>
|
||||
|
||||
@@ -60,29 +80,35 @@ object Configs
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 对 API 相关功能的配置类。
|
||||
|
||||
### debugTag <span class="symbol">- field</span>
|
||||
### debugLog <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var debugTag: String
|
||||
inline fun debugLog(initiate: YLog.Configs.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个调试日志的全局标识。
|
||||
> 配置 `YLog.Configs` 相关参数。
|
||||
|
||||
默认文案为 `YukiReflection`。
|
||||
<h3 class="deprecated">debugTag - field</h3>
|
||||
|
||||
你可以修改为你自己的文案。
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `deprecated`
|
||||
|
||||
请迁移到 `debugLog`
|
||||
|
||||
### isDebug <span class="symbol">- field</span>
|
||||
|
||||
@@ -92,7 +118,7 @@ var isDebug: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -100,51 +126,25 @@ var isDebug: Boolean
|
||||
|
||||
默认不启用,启用后将交由日志输出管理器打印详细日志 (例如反射查找功能的耗时) 到控制台。
|
||||
|
||||
请过滤 `debugTag` 即可找到每条日志。
|
||||
|
||||
### isAllowPrintingLogs <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isAllowPrintingLogs: Boolean
|
||||
```
|
||||
<h3 class="deprecated">isAllowPrintingLogs - field</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.0.3` `deprecated`
|
||||
|
||||
> 是否启用调试日志的输出功能。
|
||||
请迁移到 `debugLog`
|
||||
|
||||
::: warning
|
||||
|
||||
关闭后将会停用 **YukiReflection** 对全部日志的输出。
|
||||
|
||||
:::
|
||||
|
||||
### isEnableMemberCache <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnableMemberCache: Boolean
|
||||
```
|
||||
<h3 class="deprecated">isEnableMemberCache - field</h3>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
`v1.0.2` `deprecated`
|
||||
|
||||
> 是否启用 `Member` 缓存功能。
|
||||
|
||||
为防止 `Member` 复用过高造成的系统 GC 问题,此功能默认启用。
|
||||
|
||||
启用后会缓存已经找到的 `Method`、`Constructor`、`Field`。
|
||||
|
||||
缓存的 `Member` 都将处于 `ReflectsCacheStore` 的全局静态实例中。
|
||||
|
||||
推荐使用 `MethodFinder`、`ConstructorFinder`、`FieldFinder` 来获取 `Member`。
|
||||
|
||||
除非缓存的 `Member` 发生了混淆的问题,例如使用 R8 混淆后的 APP 的目标 `Member`,否则建议启用。
|
||||
`Member` 的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
|
||||
|
||||
## configs <span class="symbol">- method</span>
|
||||
|
||||
@@ -154,10 +154,10 @@ inline fun configs(initiate: Configs.() -> Unit)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 对 `Configs` 类实现了一个 `lambda` 方法体。
|
||||
> 对 `Configs` 类实现了一个 **lambda** 方法体。
|
||||
|
||||
你可以轻松地调用它进行配置。
|
@@ -13,12 +13,12 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# CurrentClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
|
||||
class CurrentClass internal constructor(private val classSet: Class<*>, internal val instance: Any)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ val name: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -46,7 +46,7 @@ val simpleName: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -60,7 +60,7 @@ fun generic(): GenericClass?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -76,7 +76,7 @@ inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -92,7 +92,7 @@ fun superClass(): SuperClass
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -106,7 +106,7 @@ inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -120,7 +120,7 @@ inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -129,12 +129,12 @@ inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
|
||||
## SuperClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
|
||||
inner class SuperClass internal constructor(private val superClassSet: Class<*>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -148,7 +148,7 @@ val name: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -162,7 +162,7 @@ val simpleName: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -176,7 +176,7 @@ fun generic(): GenericClass?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -192,7 +192,7 @@ inline fun generic(initiate: GenericClass.() -> Unit): GenericClass?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -208,7 +208,7 @@ inline fun field(initiate: FieldConditions): FieldFinder.Result.Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -222,7 +222,7 @@ inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class GenericClass internal constructor(private val type: ParameterizedType)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -27,17 +27,27 @@ class GenericClass internal constructor(private val type: ParameterizedType)
|
||||
## argument <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun argument(index: Int): Class<*>
|
||||
fun argument(index: Int): Class<*>?
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> argument(index: Int): Class<T>
|
||||
inline fun <reified T> argument(index: Int): Class<T>?
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
方法的返回值可为 `null`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 获得泛型参数数组下标的 `Class` 实例。
|
||||
> 获得泛型参数数组下标的 `Class` 实例。
|
||||
|
||||
::: warning
|
||||
|
||||
在运行时局部变量的泛型会被擦除,获取不到时将会返回 **null**。
|
||||
|
||||
:::
|
@@ -18,7 +18,7 @@ class VariousClass(private vararg val name: String)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ fun get(loader: ClassLoader? = null, initialize: Boolean): Class<*>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -48,7 +48,7 @@ fun getOrNull(loader: ClassLoader? = null, initialize: Boolean): Class<*>?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -14,12 +14,30 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是自定义 `Member` 和 `Class` 相关功能的查找匹配以及 `invoke` 的封装类。
|
||||
|
||||
## LazyClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
open class LazyClass<T> internal constructor(
|
||||
private val instance: Any,
|
||||
private val initialize: Boolean,
|
||||
private val loader: ClassLoaderInitializer?
|
||||
)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.2.0` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class` 实例。
|
||||
|
||||
## ClassLoader.listOfClasses <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -28,7 +46,7 @@ fun ClassLoader.listOfClasses(): List<String>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -50,7 +68,7 @@ inline fun ClassLoader.searchClass(context: Context?, name: String, async: Boole
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -76,7 +94,7 @@ val Class<*>.hasExtends: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -90,7 +108,7 @@ infix fun Class<*>?.extends(other: Class<*>?): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -124,7 +142,7 @@ infix fun Class<*>?.notExtends(other: Class<*>?): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -156,7 +174,7 @@ infix fun Class<*>?.implements(other: Class<*>?): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -188,7 +206,7 @@ infix fun Class<*>?.notImplements(other: Class<*>?): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -220,7 +238,7 @@ fun Class<*>.toJavaPrimitiveType(): Class<*>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -253,7 +271,7 @@ inline fun <reified T> String.toClass(loader: ClassLoader?, initialize: Boolean)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -325,7 +343,7 @@ inline fun <reified T> String.toClassOrNull(loader: ClassLoader?, initialize: Bo
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -345,7 +363,7 @@ inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -353,7 +371,7 @@ inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
**Function Example**
|
||||
|
||||
我们要获取一个 `Class` 在 `Kotlin` 下不通过反射时应该这样做。
|
||||
我们要获取一个 `Class` 在 Kotlin 下不通过反射时应该这样做。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -378,6 +396,50 @@ val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoade
|
||||
classOf<DemoClass>(customClassLoader)
|
||||
```
|
||||
|
||||
## lazyClass <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## lazyClassOrNull <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## String.hasClass <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -386,7 +448,7 @@ fun String.hasClass(loader: ClassLoader?): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -423,7 +485,7 @@ inline fun Class<*>.hasField(initiate: FieldConditions): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -437,7 +499,7 @@ inline fun Class<*>.hasMethod(initiate: MethodConditions): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -451,7 +513,7 @@ inline fun Class<*>.hasConstructor(initiate: ConstructorConditions): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -465,7 +527,7 @@ inline fun Member.hasModifiers(conditions: ModifierConditions): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -479,7 +541,7 @@ inline fun Class<*>.hasModifiers(conditions: ModifierConditions): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -493,7 +555,7 @@ inline fun Class<*>.field(initiate: FieldConditions): FieldFinder.Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -507,7 +569,7 @@ inline fun Class<*>.method(initiate: MethodConditions): MethodFinder.Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -521,7 +583,7 @@ inline fun Class<*>.constructor(initiate: ConstructorConditions): ConstructorFin
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -535,7 +597,7 @@ fun Class<*>.generic(): GenericClass?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -551,7 +613,7 @@ inline fun Class<*>.generic(initiate: GenericClass.() -> Unit): GenericClass?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -571,7 +633,7 @@ inline fun <reified T : Any> T.current(ignored: Boolean, initiate: CurrentClass.
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -589,7 +651,7 @@ inline fun <T> Class<*>.buildOf(vararg args: Any?, initiate: ConstructorConditio
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -603,7 +665,7 @@ inline fun Class<*>.allMethods(isAccessible: Boolean, result: (index: Int, metho
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -617,7 +679,7 @@ inline fun Class<*>.allConstructors(isAccessible: Boolean, result: (index: Int,
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -631,7 +693,7 @@ inline fun Class<*>.allFields(isAccessible: Boolean, result: (index: Int, field:
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ abstract class BaseFinder
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ inner class IndexTypeCondition internal constructor(private val type: IndexConfi
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -46,7 +46,7 @@ fun index(num: Int)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -64,7 +64,7 @@ fun index(): IndexTypeConditionSort
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -78,7 +78,7 @@ inner class IndexTypeConditionSort internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -92,7 +92,7 @@ fun first()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -106,7 +106,7 @@ fun last()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -120,7 +120,7 @@ fun reverse(num: Int)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class CountRules private constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -34,7 +34,7 @@ fun Int.isZero(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -48,7 +48,7 @@ fun Int.moreThan(count: Int): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -62,7 +62,7 @@ fun Int.lessThan(count: Int): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -76,7 +76,7 @@ fun Int.inInterval(countRange: IntRange): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class ModifierRules private constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -34,7 +34,7 @@ val isPublic: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -48,7 +48,7 @@ val isPrivate: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -62,7 +62,7 @@ val isProtected: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -76,7 +76,7 @@ val isStatic: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -98,7 +98,7 @@ val isFinal: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -118,7 +118,7 @@ val isSynchronized: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -132,7 +132,7 @@ val isVolatile: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -146,7 +146,7 @@ val isTransient: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -160,7 +160,7 @@ val isNative: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -176,7 +176,7 @@ val isInterface: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -190,7 +190,7 @@ val isAbstract: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -206,7 +206,7 @@ val isStrict: Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class NameRules private constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -34,7 +34,7 @@ fun String.isSynthetic(index: Int): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -48,7 +48,7 @@ fun String.isOnlySymbols(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -62,7 +62,7 @@ fun String.isOnlyLetters(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -76,7 +76,7 @@ fun String.isOnlyNumbers(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -90,7 +90,7 @@ fun String.isOnlyLettersNumbers(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -104,7 +104,7 @@ fun String.isOnlyLowercase(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -120,7 +120,7 @@ fun String.isOnlyUppercase(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class ObjectRules private constructor(private val instance: Any)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -23,7 +23,7 @@ class DexClassFinder internal constructor(
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -41,7 +41,7 @@ class DexClassFinder internal constructor(
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
### clearCache <span class="symbol">- method</span>
|
||||
|
||||
@@ -51,7 +51,7 @@ fun clearCache(context: Context, versionName: String?, versionCode: Long?)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -67,7 +67,7 @@ var fullName: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -85,7 +85,7 @@ var simpleName: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -105,7 +105,7 @@ var singleName: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -125,7 +125,7 @@ fun from(vararg name: String): FromPackageRules
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -153,7 +153,7 @@ fun modifiers(conditions: ModifierConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -169,7 +169,7 @@ fun fullName(value: String): ClassNameRules
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -187,7 +187,7 @@ fun simpleName(value: String): ClassNameRules
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -207,7 +207,7 @@ fun singleName(value: String): ClassNameRules
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -227,7 +227,7 @@ fun fullName(conditions: NameConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -243,7 +243,7 @@ fun simpleName(conditions: NameConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -259,7 +259,7 @@ fun singleName(conditions: NameConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -275,7 +275,7 @@ inline fun <reified T> extends()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -289,7 +289,7 @@ fun extends(vararg name: String)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -305,7 +305,7 @@ inline fun <reified T> implements()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -319,7 +319,7 @@ fun implements(vararg name: String)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -335,7 +335,7 @@ fun anonymous()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -353,7 +353,7 @@ fun noExtends()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -375,7 +375,7 @@ fun noImplements()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -395,7 +395,7 @@ fun noSuper()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -417,7 +417,7 @@ inline fun <reified T> enclosing()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -431,7 +431,7 @@ fun enclosing(vararg name: String)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -442,12 +442,12 @@ fun enclosing(vararg name: String)
|
||||
## FromPackageRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
|
||||
inner class FromPackageRules internal constructor(private val packages: MutableList<ClassRulesData.PackageRulesData>)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -461,7 +461,7 @@ fun absolute()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -487,7 +487,7 @@ inner class ClassNameRules internal constructor(private val name: ClassRulesData
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -501,7 +501,7 @@ fun optional()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -527,7 +527,7 @@ inline fun member(initiate: MemberRules.() -> Unit): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -541,7 +541,7 @@ inline fun field(initiate: FieldRules.() -> Unit): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -555,7 +555,7 @@ inline fun method(initiate: MethodRules.() -> Unit): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -569,7 +569,7 @@ inline fun constructor(initiate: ConstructorRules.() -> Unit): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -583,7 +583,7 @@ inner class Result internal constructor(internal var isNotFound: Boolean, intern
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -597,7 +597,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -611,7 +611,7 @@ fun get(): Class<*>?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -626,12 +626,16 @@ fun get(): Class<*>?
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): HashSet<Class<*>>
|
||||
fun all(): MutableList<Class<*>>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -639,7 +643,7 @@ fun all(): HashSet<Class<*>>
|
||||
|
||||
返回全部查找条件匹配的多个 `Class` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
若你设置了 `async` 请使用 [waitAll](#waitall-method) 方法。
|
||||
|
||||
@@ -651,7 +655,7 @@ fun all(result: (Class<*>) -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -671,7 +675,7 @@ fun wait(result: (Class<*>?) -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -686,12 +690,16 @@ fun wait(result: (Class<*>?) -> Unit): Result
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
|
||||
fun waitAll(result: (MutableList<Class<*>>) -> Unit): Result
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
`result` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -699,7 +707,7 @@ fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
|
||||
|
||||
回调全部查找条件匹配的多个 `Class` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将回调空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将回调空的 `MutableList`。
|
||||
|
||||
你需要设置 `async` 后此方法才会被回调,否则请使用 [all](#all-method) 方法。
|
||||
|
||||
@@ -711,7 +719,7 @@ fun onNoClassDefFoundError(result: (Throwable) -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -725,7 +733,7 @@ fun ignored(): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -13,12 +13,12 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# ConstructorRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
|
||||
class ConstructorRules internal constructor(private val rulesData: ConstructorRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ var paramCount: Int
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -50,7 +50,7 @@ fun modifiers(conditions: ModifierConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -66,7 +66,7 @@ fun emptyParam()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -80,7 +80,7 @@ fun param(vararg paramType: Any)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -106,7 +106,7 @@ fun param(conditions: ObjectsConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -128,7 +128,7 @@ fun paramCount(numRange: IntRange)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -144,7 +144,7 @@ fun paramCount(conditions: CountConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -13,12 +13,12 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# FieldRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
|
||||
class FieldRules internal constructor(private val rulesData: FieldRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ var name: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -46,7 +46,7 @@ var type: Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -62,7 +62,7 @@ fun modifiers(conditions: ModifierConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -78,7 +78,7 @@ fun name(conditions: NameConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -92,7 +92,7 @@ fun type(conditions: ObjectConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -13,12 +13,12 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# MemberRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
|
||||
class MemberRules internal constructor(private val rulesData: MemberRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ fun modifiers(conditions: ModifierConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -13,12 +13,12 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
# MethodRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
|
||||
class MethodRules internal constructor(private val rulesData: MethodRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ var name: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -46,7 +46,7 @@ var paramCount: Int
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -64,7 +64,7 @@ var returnType: Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -80,7 +80,7 @@ fun modifiers(conditions: ModifierConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -96,7 +96,7 @@ fun emptyParam()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -110,7 +110,7 @@ fun param(vararg paramType: Any)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -136,7 +136,7 @@ fun param(conditions: ObjectsConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -158,7 +158,7 @@ fun name(conditions: NameConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -172,7 +172,7 @@ fun paramCount(numRange: IntRange)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -188,7 +188,7 @@ fun paramCount(conditions: CountConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -204,7 +204,7 @@ fun returnType(conditions: ObjectConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class MemberRulesResult internal constructor(private val rulesData: MemberRulesD
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -32,7 +32,7 @@ fun none(): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -46,7 +46,7 @@ fun count(num: Int): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -60,7 +60,7 @@ fun count(numRange: IntRange): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -74,7 +74,7 @@ fun count(conditions: CountConditions): MemberRulesResult
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class ConstructorFinder internal constructor(override val classSet: Class<*>) :
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -34,7 +34,7 @@ var paramCount: Int
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -52,7 +52,7 @@ fun modifiers(conditions: ModifierConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -74,7 +74,7 @@ fun emptyParam(): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -88,7 +88,7 @@ fun param(vararg paramType: Any): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -116,7 +116,7 @@ fun param(conditions: ObjectsConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -140,7 +140,7 @@ fun paramCount(num: Int): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -164,7 +164,7 @@ fun paramCount(numRange: IntRange): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -186,7 +186,7 @@ fun paramCount(conditions: CountConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -208,7 +208,7 @@ fun superClass(isOnlySuperClass: Boolean)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -228,7 +228,7 @@ inner class RemedyPlan internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -242,7 +242,7 @@ inline fun constructor(initiate: ConstructorConditions)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -258,7 +258,7 @@ inner class Result internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -267,12 +267,16 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Constructor<*>>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -300,7 +304,7 @@ inner class Result internal constructor(internal val isNoSuch: Boolean, internal
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -314,7 +318,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -322,7 +326,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -345,7 +349,7 @@ fun get(): Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -398,12 +402,16 @@ constructor {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): ArrayList<Instance>
|
||||
fun all(): MutableList<Instance>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -433,7 +441,7 @@ fun give(): Constructor<*>?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -446,12 +454,16 @@ fun give(): Constructor<*>?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Constructor<*>>
|
||||
fun giveAll(): MutableList<Constructor<*>>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -459,7 +471,7 @@ fun giveAll(): HashSet<Constructor<*>>
|
||||
|
||||
返回全部查找条件匹配的多个 `Constructor` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -469,7 +481,7 @@ fun wait(initiate: Instance.() -> Unit)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -488,12 +500,16 @@ fun wait(initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -517,7 +533,7 @@ inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -552,7 +568,7 @@ inline fun onNoSuchConstructor(result: (Throwable) -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -568,7 +584,7 @@ fun ignored(): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -588,7 +604,7 @@ inner class Instance internal constructor(private val constructor: Constructor<*
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -602,7 +618,7 @@ fun call(vararg args: Any?): Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -616,7 +632,7 @@ fun <T> newInstance(vararg args: Any?): T?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class FieldFinder internal constructor(override val classSet: Class<*>?) : Membe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -34,7 +34,7 @@ var name: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -54,7 +54,7 @@ var type: Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -70,7 +70,7 @@ fun modifiers(conditions: ModifierConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -92,7 +92,7 @@ fun order(): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -106,7 +106,7 @@ fun name(value: String): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -128,7 +128,7 @@ fun name(conditions: NameConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -150,7 +150,7 @@ fun type(value: Any): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -172,7 +172,7 @@ fun type(conditions: ObjectConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -194,7 +194,7 @@ fun superClass(isOnlySuperClass: Boolean)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -214,7 +214,7 @@ inner class RemedyPlan internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -228,7 +228,7 @@ inline fun field(initiate: FieldConditions): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -244,7 +244,7 @@ inner class Result internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -253,12 +253,16 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Field>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Field>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -281,12 +285,12 @@ field {
|
||||
## Result <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -300,7 +304,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -308,7 +312,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -335,7 +339,7 @@ fun get(instance: Any?): Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -368,12 +372,16 @@ field {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(instance: Any?): ArrayList<Instance>
|
||||
fun all(instance: Any?): MutableList<Instance>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -403,7 +411,7 @@ fun give(): Field?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -416,12 +424,16 @@ fun give(): Field?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Field>
|
||||
fun giveAll(): MutableList<Field>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -429,7 +441,7 @@ fun giveAll(): HashSet<Field>
|
||||
|
||||
返回全部查找条件匹配的多个 `Field` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -439,7 +451,7 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -458,12 +470,16 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(instance: Any?, initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `modified`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -487,7 +503,7 @@ inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -522,7 +538,7 @@ fun onNoSuchField(result: (Throwable) -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -536,7 +552,7 @@ fun ignored(): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -556,7 +572,7 @@ inner class Instance internal constructor(private val instance: Any?, private va
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -574,7 +590,7 @@ inline fun current(ignored: Boolean, initiate: CurrentClass.() -> Unit): Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -588,7 +604,7 @@ fun <T> cast(): T?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -602,7 +618,7 @@ fun byte(): Byte?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -616,7 +632,7 @@ fun int(): Int
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -630,7 +646,7 @@ fun long(): Long
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -643,7 +659,7 @@ fun short(): Short
|
||||
```
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -657,7 +673,7 @@ fun double(): Double
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -670,7 +686,7 @@ fun float(): Float
|
||||
```
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -684,7 +700,7 @@ fun string(): String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -698,7 +714,7 @@ fun char(): Char
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -712,7 +728,7 @@ fun boolean(): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -725,7 +741,7 @@ fun any(): Any?
|
||||
```
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -739,7 +755,7 @@ inline fun <reified T> array(): Array<T>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -753,7 +769,7 @@ inline fun <reified T> list(): List<T>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -767,7 +783,7 @@ fun set(any: Any?)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -780,7 +796,7 @@ fun setTrue()
|
||||
```
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -800,7 +816,7 @@ fun setFalse()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -820,7 +836,7 @@ fun setNull()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class MethodFinder internal constructor(override val classSet: Class<*>) : Membe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -34,7 +34,7 @@ var name: String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -54,7 +54,7 @@ var paramCount: Int
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -72,7 +72,7 @@ var returnType: Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -86,7 +86,7 @@ fun modifiers(conditions: ModifierConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -108,7 +108,7 @@ fun emptyParam(): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -122,7 +122,7 @@ fun param(vararg paramType: Any): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -150,7 +150,7 @@ fun param(conditions: ObjectsConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -174,7 +174,7 @@ fun order(): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -188,7 +188,7 @@ fun name(value: String): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -210,7 +210,7 @@ fun name(conditions: NameConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -232,7 +232,7 @@ fun paramCount(num: Int): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -256,7 +256,7 @@ fun paramCount(numRange: IntRange): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -278,7 +278,7 @@ fun paramCount(conditions: CountConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -300,7 +300,7 @@ fun returnType(value: Any): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -322,7 +322,7 @@ fun returnType(conditions: ObjectConditions): IndexTypeCondition
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -344,7 +344,7 @@ fun superClass(isOnlySuperClass: Boolean)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -364,7 +364,7 @@ inner class RemedyPlan internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -378,7 +378,7 @@ inline fun method(initiate: MethodConditions): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -394,7 +394,7 @@ inner class Result internal constructor()
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -403,12 +403,16 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Method>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Method>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -431,12 +435,12 @@ method {
|
||||
## Result <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -450,7 +454,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -458,7 +462,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**Function Example**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> The following example
|
||||
|
||||
@@ -481,7 +485,7 @@ fun get(instance: Any?): Instance
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -520,12 +524,16 @@ method {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(instance: Any?): ArrayList<Instance>
|
||||
fun all(instance: Any?): MutableList<Instance>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -555,7 +563,7 @@ fun give(): Method?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -568,12 +576,16 @@ fun give(): Method?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Method>
|
||||
fun giveAll(): MutableList<Method>
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -581,7 +593,7 @@ fun giveAll(): HashSet<Method>
|
||||
|
||||
返回全部查找条件匹配的多个 `Method` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -591,7 +603,7 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -610,12 +622,16 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(instance: Any?, initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -639,7 +655,7 @@ inline fun remedys(initiate: RemedyPlan.() -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -674,7 +690,7 @@ inline fun onNoSuchMethod(result: (Throwable) -> Unit): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -690,7 +706,7 @@ fun ignored(): Result
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -710,7 +726,7 @@ inner class Instance internal constructor(private val instance: Any?, private va
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -724,7 +740,7 @@ fun call(vararg args: Any?): Any?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -738,7 +754,7 @@ fun <T> invoke(vararg args: Any?): T?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -752,7 +768,7 @@ fun byte(vararg args: Any?): Byte?
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -766,7 +782,7 @@ fun int(vararg args: Any?): Int
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -780,7 +796,7 @@ fun long(vararg args: Any?): Long
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -794,7 +810,7 @@ fun short(vararg args: Any?): Short
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -808,7 +824,7 @@ fun double(vararg args: Any?): Double
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -822,7 +838,7 @@ fun float(vararg args: Any?): Float
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -836,7 +852,7 @@ fun string(vararg args: Any?): String
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -850,7 +866,7 @@ fun char(vararg args: Any?): Char
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -864,7 +880,7 @@ fun boolean(vararg args: Any?): Boolean
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -878,7 +894,7 @@ inline fun <reified T> array(vararg args: Any?): Array<T>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -892,7 +908,7 @@ inline fun <reified T> list(vararg args: Any?): List<T>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -0,0 +1,75 @@
|
||||
---
|
||||
pageClass: code-page
|
||||
---
|
||||
|
||||
::: warning
|
||||
|
||||
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.
|
||||
|
||||
:::
|
||||
|
||||
# YLog <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object YLog
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 全局 Log 管理类。
|
||||
|
||||
## Configs <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object Configs
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 配置 `YLog`。
|
||||
|
||||
### tag <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var tag: String
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个调试日志的全局标识。
|
||||
|
||||
默认文案为 `YukiReflection`。
|
||||
|
||||
你可以修改为你自己的文案。
|
||||
|
||||
### isEnable <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnable: Boolean
|
||||
```
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.3` `added`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 是否启用调试日志的输出功能。
|
||||
|
||||
关闭后将会停用 `YukiReflection` 对全部日志的输出。
|
||||
|
||||
当 `isEnable` 关闭后 `YukiReflection.Configs.isDebug` 也将同时关闭。
|
@@ -14,10 +14,10 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关组件的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/android/ComponentTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ComponentTypeFactory.kt) 进行查看。
|
@@ -14,10 +14,10 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关 `Graphics` 的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.kt) 进行查看。
|
@@ -14,10 +14,10 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关 `Widget` 的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/android/ViewTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ViewTypeFactory.kt) 进行查看。
|
@@ -14,7 +14,7 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
@@ -28,7 +28,7 @@ val VagueType: Class<*>
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
|
@@ -14,10 +14,10 @@ You can use the **Chrome Translation Plugin** to translate entire pages for refe
|
||||
|
||||
**Change Records**
|
||||
|
||||
`v1.0.0` `added`
|
||||
`v1.0.0` `first`
|
||||
|
||||
**Function Illustrate**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Java` 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
> 这是一个预置反射类型的常量类,主要为 Java 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/java/VariableTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/java/VariableTypeFactory.kt) 进行查看。
|
@@ -2,21 +2,21 @@
|
||||
|
||||
> 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.
|
||||
`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.
|
||||
|
||||
## Get the API Version
|
||||
## Get the API Tag & Version
|
||||
|
||||
You can get the current API version of `YukiReflection` as follows.
|
||||
You can get the current tag and version of `YukiReflection` as follows.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Get the version name
|
||||
val versionName = YukiReflection. API_VERSION_NAME
|
||||
// Get the version code
|
||||
val versionCode = YukiReflection. API_VERSION_CODE
|
||||
// Get the tag
|
||||
val tag = YukiReflection.TAG
|
||||
// Get the version
|
||||
val version = YukiReflection.VERSION
|
||||
```
|
||||
|
||||
You can judge the difference between different versions or display it in the about information by obtaining the version.
|
||||
@@ -42,10 +42,12 @@ Logs inside the API will be printed using this tag.
|
||||
```kotlin
|
||||
// Via the configs method
|
||||
YukiReflection.configs {
|
||||
debugTag = "YourCustomTag"
|
||||
debugLog {
|
||||
tag = "YourCustomTag"
|
||||
}
|
||||
}
|
||||
// Set directly
|
||||
YukiReflection.Configs.debugTag = "YourCustomTag"
|
||||
YLog.Configs.tag = "YourCustomTag"
|
||||
```
|
||||
|
||||
### Enable or Disable Debug Mode
|
||||
@@ -76,27 +78,12 @@ This function is enabled by default, and disable will stop `YukiReflection` outp
|
||||
```kotlin
|
||||
// Via the configs method
|
||||
YukiReflection.configs {
|
||||
isAllowPrintingLogs = true
|
||||
debugLog {
|
||||
isEnable = true
|
||||
}
|
||||
}
|
||||
// Set directly
|
||||
YukiReflection.Configs.isAllowPrintingLogs = true
|
||||
```
|
||||
|
||||
### Enable or Disable Member Cache
|
||||
|
||||
You can enable or disable `Member` caching as follows.
|
||||
|
||||
To prevent system GC problems caused by excessive `Member` reuse, this feature is enabled by default.
|
||||
|
||||
> The following example
|
||||
|
||||
```kotlin
|
||||
// Via the configs method
|
||||
YukiReflection.configs {
|
||||
isEnableMemberCache = true
|
||||
}
|
||||
// Set directly
|
||||
YukiReflection.Configs.isEnableMemberCache = true
|
||||
YLog.Configs.isEnable = true
|
||||
```
|
||||
|
||||
### Use the configs Method to Configure
|
||||
@@ -107,10 +94,11 @@ In order to configure multiple features at once, you can directly use the `YukiR
|
||||
|
||||
```kotlin
|
||||
YukiReflection.configs {
|
||||
debugTag = "YourCustomTag"
|
||||
debugLog {
|
||||
tag = "YourCustomTag"
|
||||
isEnable = true
|
||||
}
|
||||
isDebug = true
|
||||
isAllowPrintingLogs = true
|
||||
isEnableMemberCache = true
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -29,15 +29,15 @@ A disallowed parameter type was set when looking up methods, constructors, and v
|
||||
```kotlin
|
||||
// Find a method
|
||||
method {
|
||||
// ❗ Invalid type example is set
|
||||
// Invalid type example is set
|
||||
param(false, 1, 0)
|
||||
// ❗ Invalid type example is set
|
||||
// Invalid type example is set
|
||||
returnType = false
|
||||
}
|
||||
|
||||
// Find a variable
|
||||
field {
|
||||
// ❗ Invalid type example is set
|
||||
// Invalid type example is set
|
||||
type = false
|
||||
}
|
||||
```
|
||||
@@ -102,30 +102,6 @@ Please confirm the `RemedyPlan` parameter you set and the `Class` that exists in
|
||||
|
||||
::: danger 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
|
||||
|
||||
```kotlin
|
||||
method {
|
||||
// No conditions are set here
|
||||
}
|
||||
```
|
||||
|
||||
**Solution**
|
||||
|
||||
Please complete your search criteria and try again.
|
||||
|
||||
###### exception
|
||||
|
||||
::: danger loggerE
|
||||
|
||||
Can't find this Class in \[**CLASSLOADER**\]: **CONTENT** Generated by YukiReflection#ReflectionTool
|
||||
|
||||
:::
|
||||
|
@@ -1,34 +1,34 @@
|
||||
# Introduce
|
||||
|
||||
> `YukiReflection` is a Reflection API based on the Android platform.
|
||||
> `YukiReflection` is a Reflection API based on the Java and Android platform.
|
||||
|
||||
## Background
|
||||
|
||||
This is a set of simple and efficient Reflection API rebuilt based on `Java` native Reflection API using `Kotlin`.
|
||||
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](https://github.com/fankes/YukiHookAPI) is using.
|
||||
`YukiReflection` is also the core functionality that [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI) is using.
|
||||
|
||||
The name is taken from ["ももくり" heroine Yuki Kurihara](https://www.bilibili.com/bangumi/play/ss5016).
|
||||
|
||||
## Usage
|
||||
|
||||
`YukiReflection` is fully built with `Kotlin` `lambda` syntax.
|
||||
`YukiReflection` is fully built with Kotlin **lambda** syntax.
|
||||
|
||||
It can replace [Java's native Reflection API](https://www.oracle.com/technical-resources/articles/java/javareflection.html) and implement a more complete reflection solution in a more human-friendly language.
|
||||
|
||||
## Language Requirement
|
||||
|
||||
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**.
|
||||
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`.
|
||||
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`.
|
||||
|
||||
## Source of Inspiration
|
||||
|
||||
`YukiReflection` was originally the core function integrated in the [YukiHookAPI](https://github.com/fankes/YukiHookAPI) project, and now it is decoupled so that this Reflection API can be used in any Android platform project.
|
||||
`YukiReflection` was originally the core function integrated in the [YukiHookAPI](https://github.com/HighCapable/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.
|
||||
With Kotlin elegant **lambda** and `YukiReflection`, you can make your reflection logic more beautiful and clear.
|
||||
|
||||
> The following example
|
||||
|
||||
|
@@ -16,60 +16,144 @@
|
||||
|
||||
- Gradle 7.0 and above
|
||||
|
||||
- JVM 11 and above
|
||||
- Java 11 and above
|
||||
|
||||
- Java 17 and above (Since API `1.0.3`)
|
||||
|
||||
## Project Requirements
|
||||
|
||||
The project needs to be created using `Android Studio` or `IntelliJ IDEA` and the type is an Android project and the `Kotlin` environment dependency has been integrated.
|
||||
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.
|
||||
|
||||
## Integration Dependencies
|
||||
|
||||
**(Optional)** Add dependencies to your project `build.gradle`.
|
||||
We recommend using Kotlin DSL as the Gradle build script language and [SweetDependency](https://github.com/HighCapable/SweetDependency) to manage dependencies.
|
||||
|
||||
#### SweetDependency (Recommended)
|
||||
|
||||
Add the repositories and dependencies in your project's `SweetDependency` configuration file.
|
||||
|
||||
> The following example
|
||||
|
||||
```yaml
|
||||
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
|
||||
|
||||
```kotlin
|
||||
dependencies {
|
||||
implementation(com.highcapable.yukireflection.api)
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
#### Traditional Method
|
||||
|
||||
Add repositories in your project `build.gradle.kts` or `build.gradle`.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
```kotlin
|
||||
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
|
||||
|
||||
```groovy
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// MavenCentral has a 2-hour cache, if you cannot integrate the latest version, please add this address
|
||||
maven { url "https://s01.oss.sonatype.org/content/repositories/releases" }
|
||||
// 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 to your app `build.gradle`.
|
||||
Add dependencies in your project `build.gradle.kts` or `build.gradle`.
|
||||
|
||||
> The following example
|
||||
> Kotlin DSL
|
||||
|
||||
```kotlin
|
||||
dependencies {
|
||||
implementation("com.highcapable.yukireflection:api:<yuki-version>")
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
> Groovy DSL
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
// Base dependencies
|
||||
implementation 'com.highcapable.yukireflection:api:<yuki-version>'
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Please change **<yuki-version>** to the latest version from [here](../about/changelog).
|
||||
Please change **<yuki-version>** to the latest version [here](../about/changelog).
|
||||
|
||||
::: danger
|
||||
|
||||
If your project is currently using [YukiHookAPI](https://github.com/fankes/YukiHookAPI), please do not repeatedly integrate **YukiReflection**, because **YukiHookAPI** already contains the functions and exists for related functional changes and repeated integration will cause functional conflicts and cause exceptions.
|
||||
If your project is currently using the 1.x.x version of [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI), please do not integrate **YukiReflection** repeatedly, because **YukiHookAPI** already includes it functions and there are changes to related functions.
|
||||
|
||||
At this time, you should go to the [documentation](https://fankes.github.io/YukiHookAPI/en/) of **YukiHookAPI** to view the corresponding tutorial.
|
||||
Repeated integration will cause functional conflicts and cause exceptions.
|
||||
|
||||
In this case, you should go to the [Documentation](https://highcapable.github.io/YukiHookAPI/zh-cn/) of **YukiHookAPI** view the corresponding usage tutorial.
|
||||
|
||||
**YukiHookAPI** will be completely separated from **YukiReflection** in version **2.0.0**, by which time you can use it with **YukiHookAPI** at the same time.
|
||||
|
||||
:::
|
||||
|
||||
Modify the `Kotlin` Jvm version to 11 and above in your app `build.gradle`.
|
||||
#### Configure Java Version
|
||||
|
||||
> The following example
|
||||
Modify the Java version of Kotlin in your project `build.gradle.kts` or `build.gradle` to 17 or above.
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
```kt
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> Groovy DSL
|
||||
|
||||
```groovy
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
jvmTarget = '17'
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
::: warning
|
||||
|
||||
Since API **1.0.3**, the Java version used by Kotlin defaults to 17, and versions 11 and below are no longer supported.
|
||||
|
||||
:::
|
@@ -9,5 +9,32 @@ actions:
|
||||
- text: Changelog
|
||||
link: /en/about/changelog
|
||||
type: secondary
|
||||
footer: MIT License | Copyright (C) 2019-2023 HighCapable
|
||||
---
|
||||
features:
|
||||
- title: Light and Elegant
|
||||
details: A powerful, elegant, beautiful API built with Kotlin lambda can help you quickly implement bytecode finding and reflection functions.
|
||||
- title: Cross-Platform Available
|
||||
details: Not only the Android platform, it is highly compatible with the Java API and can be used on any Kotlin on JVM project, wherever Java is available.
|
||||
- title: Quickly Started
|
||||
details: Simple and easy to use it now! Do not need complex configuration and full development experience, Integrate dependencies and enjoy yourself.
|
||||
footer: Apache-2.0 License | Copyright (C) 2019 HighCapable
|
||||
---
|
||||
|
||||
### Bring it on! Let reflection become poetic and picturesque
|
||||
|
||||
```java
|
||||
public class World {
|
||||
|
||||
private void sayHello(String content) {
|
||||
System.out.println("Hello " + content + "!");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```kotlin
|
||||
val newWorld = World()
|
||||
classOf<World>().method {
|
||||
name = "sayHello"
|
||||
param(StringClass)
|
||||
type = UnitType
|
||||
}.get(newWorld).call("YukiReflection")
|
||||
```
|
@@ -13,5 +13,5 @@ actions:
|
||||
- text: 简体中文
|
||||
link: /zh-cn/
|
||||
type: secondary
|
||||
footer: MIT License | Copyright (C) 2019-2023 HighCapable
|
||||
footer: Apache-2.0 License | Copyright (C) 2019 HighCapable
|
||||
---
|
@@ -2,32 +2,26 @@
|
||||
|
||||
> 此文档由 [VuePress](https://v2.vuepress.vuejs.org/zh) 强力驱动。
|
||||
|
||||
## License
|
||||
## 许可证
|
||||
|
||||
[The MIT License (MIT)](https://github.com/fankes/YukiReflection/blob/master/LICENSE)
|
||||
[Apache-2.0](https://github.com/HighCapable/YukiReflection/blob/master/LICENSE)
|
||||
|
||||
```:no-line-numbers
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (C) 2019-2023 HighCapable
|
||||
Copyright (C) 2019 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:
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
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.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
||||
版权所有 © 2019-2023 HighCapable
|
||||
版权所有 © 2019 HighCapable
|
@@ -8,6 +8,32 @@
|
||||
|
||||
:::
|
||||
|
||||
### 1.0.0 | 2023.01.26  <Badge type="tip" text="最新" vertical="middle" />
|
||||
### 1.0.3 | 2023.10.07  <Badge type="tip" text="最新" vertical="middle" />
|
||||
|
||||
- 许可协议由 `MIT` 变更为 `Apache-2.0`,在此之后的版本将由此许可协议进行分发,您在使用此版本后应变更相关许可协议
|
||||
- 将依赖库的类型由 **Android Library** (aar) 修改回 **Java Library** (jar)
|
||||
- 适配并支持原生 Java 平台 (部分功能仅限 Android 平台)
|
||||
- 修复 [fix get interfaces of class](https://github.com/HighCapable/YukiHookAPI/pull/38) 问题并合并到 `YukiReflection`
|
||||
- 作废了 ~~`isAllowPrintingLogs`~~,请开始使用 `debugLog` 方法
|
||||
- 新增 `YukiReflection.TAG`
|
||||
- 作废了 ~~`YukiReflection.API_VERSION_NAME`~~、~~`YukiReflection.API_VERSION_CODE`~~,统一合并到 `YukiReflection.VERSION`
|
||||
- 重构方法查找中的 `remendy` 功能,现在可以对其进行分步打印异常
|
||||
- 多重方法查找结果类型由 `HashSet` 改为 `MutableList`
|
||||
- 新增使用 `method()`、`constructor()`、`field()` 可直接获取到类中的所有对象功能
|
||||
- `constructor()` 的行为不再是 `constructor { emptyParam() }`
|
||||
- 新增 `lazyClass`、`lazyClassOrNull` 方法,可延迟装载 `Class`
|
||||
|
||||
### 1.0.2 | 2023.04.25  <Badge type="warning" text="过旧" vertical="middle" />
|
||||
|
||||
- 修复一个严重问题,`Member` 缓存未生效且持续存储最终引发 APP 内存溢出 (OOM),感谢 [Art-Chen](https://github.com/Art-Chen)
|
||||
- 移除 `Member` 的直接缓存功能并作废 ~~`YukiReflection.Configs.isEnableMemberCache`~~,保留 `Class` 的缓存功能
|
||||
- 对接查找功能到 `Sequence`,优化 `Member` 的查找速度与性能
|
||||
|
||||
### 1.0.1 | 2023.04.16  <Badge type="warning" text="过旧" vertical="middle" />
|
||||
|
||||
- 将依赖库的类型由 **Java Library** (jar) 修改为 **Android Library** (aar)
|
||||
- 移除了 Android `type` 中的错误 `Class` 对象声明
|
||||
|
||||
### 1.0.0 | 2023.01.26  <Badge type="warning" text="过旧" vertical="middle" />
|
||||
|
||||
- 首个版本提交至 Maven
|
@@ -2,10 +2,14 @@
|
||||
|
||||
> 如在使用中有任何问题,或有任何建设性的建议,都可以联系我们。
|
||||
|
||||
加入我们 [点击加入 Telegram 群组](https://t.me/YukiReflection)
|
||||
加入我们的开发者群组。
|
||||
|
||||
在 **酷安** 找到我 [@星夜不荟](http://www.coolapk.com/u/876977)
|
||||
- [点击加入 Telegram 群组](https://t.me/YukiReflection)
|
||||
- [点击加入 Telegram 群组 (开发者)](https://t.me/HighCapable_Dev)
|
||||
- [点击加入 QQ 群 (开发者)](https://qm.qq.com/cgi-bin/qm/qr?k=Pnsc5RY6N2mBKFjOLPiYldbAbprAU3V7&jump_from=webapi&authKey=X5EsOVzLXt1dRunge8ryTxDRrh9/IiW1Pua75eDLh9RE3KXE+bwXIYF5cWri/9lf)
|
||||
|
||||
在 **酷安** 找到我 [@星夜不荟](http://www.coolapk.com/u/876977)。
|
||||
|
||||
## 助力维护
|
||||
|
||||
感谢您选择并使用 `YukiReflection`,如有代码相关的建议和请求,可在 Github 提交 Pull Request。
|
||||
感谢您选择并使用 `YukiReflection`,如有代码相关的建议和请求,可在 GitHub 提交 Pull Request。
|
@@ -8,9 +8,9 @@
|
||||
|
||||
### 自动生成反射代码
|
||||
|
||||
使用 `stub` 的方式创建一个 `Kotlin` 类,并声明其中的参数,以及其在各个版本中的不同状态。
|
||||
使用 `stub` 的方式创建一个 Kotlin 类,并声明其中的参数,以及其在各个版本中的不同状态。
|
||||
|
||||
比如下面的这个 `Java` 类就是我们需要反射的目标类。
|
||||
比如下面的这个 Java 类就是我们需要反射的目标类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -56,7 +56,7 @@ classOf<MyClass>().buildOf().current {
|
||||
}
|
||||
```
|
||||
|
||||
目前要实现的功能是可以使用反射功能直接定义为如下 `Kotlin` 类。
|
||||
目前要实现的功能是可以使用反射功能直接定义为如下 Kotlin 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -80,7 +80,7 @@ class MyClass {
|
||||
}
|
||||
```
|
||||
|
||||
然后我们就可以直接调用这个定义好的 `Kotlin` 类来实现反射功能,API 会根据注解自动生成反射代码。
|
||||
然后我们就可以直接调用这个定义好的 Kotlin 类来实现反射功能,API 会根据注解自动生成反射代码。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -101,4 +101,110 @@ MyClass().also {
|
||||
|
||||
以上功能可能会在实际推出后有所变化,最终以实际版本的功能为准。
|
||||
|
||||
:::
|
||||
|
||||
### 自动生成可直接调用的 Class 对象
|
||||
|
||||
在 Kotlin 中,表示 Java 的类对象的方式是 `YourObject::class.java`,这个写法通常会很长,在反射过程中大量使用会很不美观。
|
||||
|
||||
在现有版本中,我们内置了常用的 `Class` 对象,但是这会增大依赖的体积,而且大多数情况下可能都用不到这些对象。
|
||||
|
||||
例如 `StringClass`、`IntType` 等等,这些对象都是在 `YukiReflection` 中内置的。
|
||||
|
||||
所以我们计划在后期添加一个功能,可以使用 `properties` 的方式创建一个需要生成的 `Class` 对象列表,通过 Gradle 插件依次生成这些 `Class` 对象。
|
||||
|
||||
诸如上面提到的这些原始类型的 `Class` 对象依然会内置在 `YukiReflection` 中,其余的 `Class` 对象需要自行定义。
|
||||
|
||||
生成的名称规范为 **类名 + Class**,为了防止包名冲突,你可以控制生成的 `Class` 对象的子包名。
|
||||
|
||||
在配置文件中,你无需添加 `Class` 作为后缀。
|
||||
|
||||
你可以在 Gradle 插件中定义生成的根包名,默认为 `com.highcapable.yukireflection.generated.classes`。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```properties
|
||||
# 最基本的定义方式就是直接写名称
|
||||
# 将会生成到 com.highcapable.yukireflection.generated.classes.BundleClass
|
||||
android.os.Bundle=Bundle
|
||||
# 你可以在前方使用 "." 的形式来定义前置子包名
|
||||
# 例如我们想把这个类定义到想要的包名
|
||||
# 将会生成到 com.highcapable.yukireflection.generated.classes.myandroid.myos.BundleClass
|
||||
android.os.Bundle=myandroid.myos.Bundle
|
||||
# 你也可以不填写键值内容,这将使用键值名称作为定义的包名和类名
|
||||
# 将会生成到 com.highcapable.yukireflection.generated.classes.android.os.BundleClass
|
||||
android.os.Bundle
|
||||
```
|
||||
|
||||
上述方式生成的 `Class` 对象的大概代码形式如下。
|
||||
|
||||
```kotlin
|
||||
package com.highcapable.yukireflection.generated.classes.android.os
|
||||
|
||||
// 在默认 ClassLoader 的情况下使用
|
||||
val BundleClass: Class<*> = "android.os.Bundle".toClass()
|
||||
|
||||
// 在指定 ClassLoader 的情况下使用
|
||||
fun BundleClass(loader: ClassLoader): Class<*> = "android.os.Bundle".toClass(loader)
|
||||
```
|
||||
|
||||
也许这个 `Class` 可能在一些情况下无法被得到,这个时候你可以参考以下配置方式。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```properties
|
||||
# 在键值后添加 "?" 的形式来定义可空的 Class 对象
|
||||
android.os.Bundle?
|
||||
```
|
||||
|
||||
上述方式生成的 `Class` 对象的大概代码形式如下。
|
||||
|
||||
```kotlin
|
||||
package com.highcapable.yukireflection.generated.classes.android.os
|
||||
|
||||
// 在默认 ClassLoader 的情况下使用
|
||||
val BundleClass: Class<*>? = "android.os.Bundle".toClassOrNull()
|
||||
|
||||
// 在指定 ClassLoader 的情况下使用
|
||||
fun BundleClass(loader: ClassLoader): Class<*>? = "android.os.Bundle".toClassOrNull(loader)
|
||||
```
|
||||
|
||||
如果这个 `Class` 对象能使用直接调用的方式进行引用,这个时候你可以参考以下配置方式。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```properties
|
||||
# 在键值后添加 "!!" 的形式来定义可直接调用的 Class 对象
|
||||
android.os.Bundle!!
|
||||
```
|
||||
|
||||
上述方式生成的 `Class` 对象的大概代码形式如下。
|
||||
|
||||
```kotlin
|
||||
package com.highcapable.yukireflection.generated.classes.android.os
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
// 在默认 ClassLoader 的情况下使用
|
||||
val BundleClass: Class<Bundle> = classOf<Bundle>()
|
||||
|
||||
// 在指定 ClassLoader 的情况下使用
|
||||
fun BundleClass(loader: ClassLoader): Class<Bundle> = classOf<Bundle>(loader)
|
||||
```
|
||||
|
||||
有了生成的 `Class` 对象,我们就可以愉快地使用 `YukiReflection` 进行反射了。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
method {
|
||||
name = "onCreate"
|
||||
param(BundleClass)
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
以上功能可能会在实际推出后有所变化,最终以实际版本的功能为准。
|
||||
|
||||
:::
|
@@ -66,6 +66,50 @@ var instance = classOf<Test>(customClassLoader)
|
||||
|
||||
:::
|
||||
|
||||
### 延迟装载
|
||||
|
||||
假设我们要得到一个不能直接调用的 `Class`,但是我们也不是立刻就需要这个 `Class`。
|
||||
|
||||
这个时候,你可以使用 `lazyClass` 来完成这个功能。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
// 延迟装载这个 Class
|
||||
val instance by lazyClass("com.demo.Test")
|
||||
// 自定义 Class 所在的 ClassLoader
|
||||
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
|
||||
val instance by lazyClass("com.demo.Test") { customClassLoader }
|
||||
// 在适当的时候调用这个 Class
|
||||
instance.method {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
如果当前 `Class` 并不存在,使用上述方法会抛出异常,如果你不确定 `Class` 是否存在,可以参考下面的解决方案。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
// 延迟装载这个 Class
|
||||
// 得不到时结果会为 null 但不会抛出异常
|
||||
val instance by lazyClassOrNull("com.demo.Test")
|
||||
// 自定义 Class 所在的 ClassLoader
|
||||
val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoader
|
||||
// 得不到时结果会为 null 但不会抛出异常
|
||||
val instance by lazyClassOrNull("com.demo.Test") { customClassLoader }
|
||||
// 在适当的时候调用这个 Class
|
||||
instance?.method {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
|
||||
更多功能请参考 [lazyClass](../public/com/highcapable/yukireflection/factory/ReflectionFactory#lazyclass-method)、[lazyClassOrNull](../public/com/highcapable/yukireflection/factory/ReflectionFactory#lazyclassornull-method) 方法。
|
||||
|
||||
:::
|
||||
|
||||
### 存在判断
|
||||
|
||||
假设我们要判断一个 `Class` 是否存在,通常情况下,我们可以使用标准的反射 API 去查找这个 `Class` 通过异常来判断是否存在。
|
||||
@@ -118,6 +162,8 @@ var isExist = "com.demo.Test".hasClass(customClassLoader)
|
||||
|
||||
::: warning
|
||||
|
||||
**此功能仅适用于 Android 平台。**
|
||||
|
||||
目前 **DexClassFinder** 的功能尚在试验阶段,由于仅通过 Java 层实现查找功能,在当前 APP **Class** 过多时性能可能不能达到最佳水平,如果发生查找不到、定位有误的问题欢迎向我们反馈。
|
||||
|
||||
由于是反射层面的 API,目前它只能通过**类与成员**的特征来定位指定的 **Class**,不能通过指定字节码中的字符串和方法内容特征来进行定位。
|
||||
@@ -126,6 +172,14 @@ var isExist = "com.demo.Test".hasClass(customClassLoader)
|
||||
|
||||
:::
|
||||
|
||||
::: danger
|
||||
|
||||
在 **YukiHookAPI** 发布 **2.0.0** 版本后,此功能将被标记为作废,且将会直接从 **YukiReflection** 中移除。
|
||||
|
||||
我们欢迎各位开发者开始使用 [DexKit](https://github.com/LuckyPray/DexKit),它是一个使用 C++ 实现的 **Dex** 高性能运行时解析库,在性能方面比 Java 层更加高效与优秀,目前尚在开发阶段,欢迎提出宝贵建议。
|
||||
|
||||
:::
|
||||
|
||||
#### 开始使用
|
||||
|
||||
下面是一个简单的用法示例。
|
||||
@@ -1100,7 +1154,7 @@ instance.current {
|
||||
name = "stop"
|
||||
emptyParam()
|
||||
}.call()
|
||||
// ❗注意,因为 current() 返回的是 CurrentClass 自身对象,所以不能像下面这样调用
|
||||
// 注意,因为 current() 返回的是 CurrentClass 自身对象,所以不能像下面这样调用
|
||||
instance.current().current()
|
||||
```
|
||||
|
||||
@@ -1470,11 +1524,7 @@ TestGeneric::class.java.generic()?.argument()?.method {
|
||||
|
||||
#### 限制性查找条件
|
||||
|
||||
::: danger
|
||||
|
||||
在查找条件中,除了 **order** 你只能使用一次 **index** 功能。
|
||||
|
||||
:::
|
||||
在查找条件中,除了 `order` 你<u>**只能**</u>使用一次 `index` 功能。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -1482,7 +1532,7 @@ TestGeneric::class.java.generic()?.argument()?.method {
|
||||
method {
|
||||
name = "test"
|
||||
param(BooleanType).index(num = 2)
|
||||
// ❗错误的使用方法,请仅保留一个 index 方法
|
||||
// 错误的使用方法,请仅保留一个 index 方法
|
||||
returnType(StringClass).index(num = 1)
|
||||
}
|
||||
```
|
||||
@@ -1501,12 +1551,8 @@ method {
|
||||
|
||||
#### 必要的查找条件
|
||||
|
||||
::: danger
|
||||
|
||||
在普通方法查找条件中,<u>**即使是无参的方法也需要设置查找条件**</u>。
|
||||
|
||||
:::
|
||||
|
||||
假设我们有如下的 `Class`。
|
||||
|
||||
> 示例如下
|
||||
@@ -1556,9 +1602,13 @@ TestFoo::class.java.method {
|
||||
|
||||
至此,上述的示例将可以完美地匹配到 `public void foo()` 方法。
|
||||
|
||||
#### 可简写查找条件
|
||||
::: tip 兼容性说明
|
||||
|
||||
> 在构造方法查找条件中,<u>**无参的构造方法可以不需要填写查找条件**</u>。
|
||||
在过往历史版本的 API 中是允许匹配不写默认匹配无参方法的做法的,但是最新版本更正了这一问题,请确保你使用的是最新的 API 版本。
|
||||
|
||||
:::
|
||||
|
||||
在构造方法查找条件中,<u>**即使是无参的构造方法也需要设置查找条件**</u>。
|
||||
|
||||
假设我们有如下的 `Class`。
|
||||
|
||||
@@ -1573,7 +1623,7 @@ public class TestFoo {
|
||||
}
|
||||
```
|
||||
|
||||
我们要得到其中的 `public TestFoo()` 构造方法,可以写作如下形式。
|
||||
我们要得到其中的 `public TestFoo()` 构造方法,必须写作如下形式。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -1581,23 +1631,53 @@ public class TestFoo {
|
||||
TestFoo::class.java.constructor { emptyParam() }
|
||||
```
|
||||
|
||||
上面的例子可以成功获取到 `public TestFoo()` 构造方法,但是感觉有一些繁琐。
|
||||
上面的例子可以成功获取到 `public TestFoo()` 构造方法。
|
||||
|
||||
与普通方法不同,由于构造方法不需要考虑 `name` 名称,当构造方法没有参数的时候,我们可以省略 `emptyParam` 参数。
|
||||
如果你写作 `constructor()` 而丢失了 `emptyParam()`,此时查找到的结果会是按照字节码顺序排列的的第一位,<u>**可能并不是无参的**</u>。
|
||||
|
||||
::: tip 兼容性说明
|
||||
|
||||
在过往历史版本的 API 中构造方法不填写任何查找参数会直接找不到构造方法,<u>**这是一个 BUG,最新版本已经进行修复**</u>,请确保你使用的是最新的 API 版本。
|
||||
|
||||
:::
|
||||
|
||||
::: danger API 行为变更
|
||||
|
||||
在 **1.2.0** 及之后的版本中,**constructor()** 的行为不再是 **constructor { emptyParam() }** 而是 **constructor {}**,请注意行为变更合理调整查找参数。
|
||||
|
||||
:::
|
||||
|
||||
#### 不设置查找条件
|
||||
|
||||
在不设置查找条件的情况下,使用 `field()`、`constructor()`、`method()` 将返回当前 `Class` 下的所有成员对象。
|
||||
|
||||
使用 `get(...)` 或 `give()` 的方式获取将只能得到按照字节码顺序排列的的第一位。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
TestFoo::class.java.constructor()
|
||||
Test::class.java.field().get(...)
|
||||
Test::class.java.method().give()
|
||||
```
|
||||
|
||||
如果你想得到全部成员对象,你可以使用 `all(...)` 或 `giveAll()`
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
Test::class.java.field().all(...)
|
||||
Test::class.java.method().giveAll()
|
||||
```
|
||||
|
||||
::: tip 兼容性说明
|
||||
|
||||
在过往历史版本的 API 中,不设置查找条件将抛出异常,此特性在 **1.2.0** 及之后的版本中加入。
|
||||
|
||||
:::
|
||||
|
||||
#### 字节码类型
|
||||
|
||||
::: danger
|
||||
|
||||
在字节码调用结果中,**cast** 方法只能指定字节码对应的类型。
|
||||
|
||||
:::
|
||||
在字节码调用结果中,**cast** 方法<u>**只能**</u>指定字节码对应的类型。
|
||||
|
||||
例如我们想得到一个 `Boolean` 类型的变量,把他转换为 `String`。
|
||||
|
||||
@@ -1609,7 +1689,7 @@ TestFoo::class.java.constructor()
|
||||
field {
|
||||
name = "test"
|
||||
type = BooleanType
|
||||
}.get().string() // ❗错误的使用方法,必须 cast 为字节码目标类型
|
||||
}.get().string() // 错误的使用方法,必须 cast 为字节码目标类型
|
||||
```
|
||||
|
||||
以下是正确的使用方法。
|
||||
@@ -1636,7 +1716,7 @@ field {
|
||||
}
|
||||
```
|
||||
|
||||
在 `Kotlin` 中表达出 `Boolean::class.javaPrimitiveType` 这个类型的写法很长,感觉并不方便。
|
||||
在 Kotlin 中表达出 `Boolean::class.javaPrimitiveType` 这个类型的写法很长,感觉并不方便。
|
||||
|
||||
因此,`YukiReflection` 为开发者封装了常见的类型调用,其中包含了 Android 的相关类型和 Java 的常见类型与**原始类型关键字**。
|
||||
|
||||
|
@@ -16,33 +16,53 @@ object YukiReflection
|
||||
|
||||
> 这是 `YukiReflection` 的装载调用类。
|
||||
|
||||
## API_VERSION_NAME <span class="symbol">- field</span>
|
||||
## TAG <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val API_VERSION_NAME: String
|
||||
const val TAG: String
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获取当前 `YukiReflection` 的名称 (标签)。
|
||||
|
||||
## VERSION <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val VERSION: String
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获取当前 `YukiReflection` 的版本。
|
||||
|
||||
## API_VERSION_CODE <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
const val API_VERSION_CODE: Int
|
||||
```
|
||||
<h2 class="deprecated">API_VERSION_NAME - field</h2>
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
**功能描述**
|
||||
`v1.0.3` `作废`
|
||||
|
||||
> 获取当前 `YukiReflection` 的版本号。
|
||||
不再区分版本名称和版本号,请迁移到 `VERSION`
|
||||
|
||||
<h2 class="deprecated">API_VERSION_CODE - field</h2>
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `作废`
|
||||
|
||||
不再区分版本名称和版本号,请迁移到 `VERSION`
|
||||
|
||||
## Configs <span class="symbol">- object</span>
|
||||
|
||||
@@ -58,23 +78,29 @@ object Configs
|
||||
|
||||
> 对 API 相关功能的配置类。
|
||||
|
||||
### debugTag <span class="symbol">- field</span>
|
||||
### debugLog <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var debugTag: String
|
||||
inline fun debugLog(initiate: YLog.Configs.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 配置 `YLog.Configs` 相关参数。
|
||||
|
||||
<h3 class="deprecated">debugTag - field</h3>
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
**功能描述**
|
||||
`v1.0.3` `作废`
|
||||
|
||||
> 这是一个调试日志的全局标识。
|
||||
|
||||
默认文案为 `YukiReflection`。
|
||||
|
||||
你可以修改为你自己的文案。
|
||||
请迁移到 `debugLog`
|
||||
|
||||
### isDebug <span class="symbol">- field</span>
|
||||
|
||||
@@ -92,51 +118,25 @@ var isDebug: Boolean
|
||||
|
||||
默认不启用,启用后将交由日志输出管理器打印详细日志 (例如反射查找功能的耗时) 到控制台。
|
||||
|
||||
请过滤 `debugTag` 即可找到每条日志。
|
||||
|
||||
### isAllowPrintingLogs <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isAllowPrintingLogs: Boolean
|
||||
```
|
||||
<h3 class="deprecated">isAllowPrintingLogs - field</h3>
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
**功能描述**
|
||||
`v1.0.3` `作废`
|
||||
|
||||
> 是否启用调试日志的输出功能。
|
||||
请迁移到 `debugLog`
|
||||
|
||||
::: warning
|
||||
|
||||
关闭后将会停用 **YukiReflection** 对全部日志的输出。
|
||||
|
||||
:::
|
||||
|
||||
### isEnableMemberCache <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnableMemberCache: Boolean
|
||||
```
|
||||
<h3 class="deprecated">isEnableMemberCache - field</h3>
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
**功能描述**
|
||||
`v1.0.2` `作废`
|
||||
|
||||
> 是否启用 `Member` 缓存功能。
|
||||
|
||||
为防止 `Member` 复用过高造成的系统 GC 问题,此功能默认启用。
|
||||
|
||||
启用后会缓存已经找到的 `Method`、`Constructor`、`Field`。
|
||||
|
||||
缓存的 `Member` 都将处于 `ReflectsCacheStore` 的全局静态实例中。
|
||||
|
||||
推荐使用 `MethodFinder`、`ConstructorFinder`、`FieldFinder` 来获取 `Member`。
|
||||
|
||||
除非缓存的 `Member` 发生了混淆的问题,例如使用 R8 混淆后的 APP 的目标 `Member`,否则建议启用。
|
||||
`Member` 的直接缓存功能已被移除,因为其存在内存溢出 (OOM) 问题
|
||||
|
||||
## configs <span class="symbol">- method</span>
|
||||
|
||||
@@ -150,6 +150,6 @@ inline fun configs(initiate: Configs.() -> Unit)
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 对 `Configs` 类实现了一个 `lambda` 方法体。
|
||||
> 对 `Configs` 类实现了一个 **lambda** 方法体。
|
||||
|
||||
你可以轻松地调用它进行配置。
|
@@ -5,7 +5,7 @@ pageClass: code-page
|
||||
# CurrentClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class CurrentClass internal constructor(internal val classSet: Class<*>, internal val instance: Any)
|
||||
class CurrentClass internal constructor(private val classSet: Class<*>, internal val instance: Any)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
@@ -121,7 +121,7 @@ inline fun method(initiate: MethodConditions): MethodFinder.Result.Instance
|
||||
## SuperClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class SuperClass internal constructor(internal val superClassSet: Class<*>)
|
||||
inner class SuperClass internal constructor(private val superClassSet: Class<*>)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
@@ -19,17 +19,27 @@ class GenericClass internal constructor(private val type: ParameterizedType)
|
||||
## argument <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun argument(index: Int): Class<*>
|
||||
fun argument(index: Int): Class<*>?
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> argument(index: Int): Class<T>
|
||||
inline fun <reified T> argument(index: Int): Class<T>?
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
方法的返回值可为 `null`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得泛型参数数组下标的 `Class` 实例。
|
||||
> 获得泛型参数数组下标的 `Class` 实例。
|
||||
|
||||
::: warning
|
||||
|
||||
在运行时局部变量的泛型会被擦除,获取不到时将会返回 **null**。
|
||||
|
||||
:::
|
@@ -12,6 +12,24 @@ pageClass: code-page
|
||||
|
||||
> 这是自定义 `Member` 和 `Class` 相关功能的查找匹配以及 `invoke` 的封装类。
|
||||
|
||||
## LazyClass <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
open class LazyClass<T> internal constructor(
|
||||
private val instance: Any,
|
||||
private val initialize: Boolean,
|
||||
private val loader: ClassLoaderInitializer?
|
||||
)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 懒装载 `Class` 实例。
|
||||
|
||||
## ClassLoader.listOfClasses <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
@@ -345,7 +363,7 @@ inline fun <reified T> classOf(loader: ClassLoader?, initialize: Boolean): Class
|
||||
|
||||
**功能示例**
|
||||
|
||||
我们要获取一个 `Class` 在 `Kotlin` 下不通过反射时应该这样做。
|
||||
我们要获取一个 `Class` 在 Kotlin 下不通过反射时应该这样做。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -370,6 +388,50 @@ val customClassLoader: ClassLoader? = ... // 假设这个就是你的 ClassLoade
|
||||
classOf<DemoClass>(customClassLoader)
|
||||
```
|
||||
|
||||
## lazyClass <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClass(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClass(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.NonNull<Any>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## lazyClassOrNull <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inline fun <reified T> lazyClassOrNull(name: String, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<T>
|
||||
```
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun lazyClassOrNull(variousClass: VariousClass, initialize: Boolean, loader: ClassLoaderInitializer?): LazyClass.Nullable<Any>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 懒装载 `Class`。
|
||||
|
||||
## String.hasClass <span class="symbol">- ext-method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
|
@@ -434,7 +434,7 @@ fun enclosing(vararg name: String)
|
||||
## FromPackageRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class FromPackageRules internal constructor(private val packages: ArrayList<ClassRulesData.PackageRulesData>)
|
||||
inner class FromPackageRules internal constructor(private val packages: MutableList<ClassRulesData.PackageRulesData>)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
@@ -618,20 +618,24 @@ fun get(): Class<*>?
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): HashSet<Class<*>>
|
||||
fun all(): MutableList<Class<*>>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 得到 `Class` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Class` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
若你设置了 `async` 请使用 [waitAll](#waitall-method) 方法。
|
||||
|
||||
@@ -678,20 +682,24 @@ fun wait(result: (Class<*>?) -> Unit): Result
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(result: (HashSet<Class<*>>) -> Unit): Result
|
||||
fun waitAll(result: (MutableList<Class<*>>) -> Unit): Result
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`result` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 得到 `Class` 本身数组 (异步)。
|
||||
|
||||
回调全部查找条件匹配的多个 `Class` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将回调空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将回调空的 `MutableList`。
|
||||
|
||||
你需要设置 `async` 后此方法才会被回调,否则请使用 [all](#all-method) 方法。
|
||||
|
||||
|
@@ -5,7 +5,7 @@ pageClass: code-page
|
||||
# ConstructorRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class ConstructorRules internal constructor(internal val rulesData: ConstructorRulesData) : BaseRules
|
||||
class ConstructorRules internal constructor(private val rulesData: ConstructorRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
@@ -5,7 +5,7 @@ pageClass: code-page
|
||||
# FieldRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class FieldRules internal constructor(internal val rulesData: FieldRulesData) : BaseRules
|
||||
class FieldRules internal constructor(private val rulesData: FieldRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
@@ -5,7 +5,7 @@ pageClass: code-page
|
||||
# MemberRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class MemberRules internal constructor(internal val rulesData: MemberRulesData) : BaseRules
|
||||
class MemberRules internal constructor(private val rulesData: MemberRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
@@ -5,7 +5,7 @@ pageClass: code-page
|
||||
# MethodRules <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
class MethodRules internal constructor(internal val rulesData: MethodRulesData) : BaseRules
|
||||
class MethodRules internal constructor(private val rulesData: MethodRulesData) : BaseRules
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
@@ -259,13 +259,17 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Constructor<*>>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Constructor<*>>.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 当在 `RemedyPlan` 中找到结果时。
|
||||
@@ -314,7 +318,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -390,13 +394,17 @@ constructor {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(): ArrayList<Instance>
|
||||
fun all(): MutableList<Instance>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得 `Constructor` 实例处理类数组。
|
||||
@@ -438,20 +446,24 @@ fun give(): Constructor<*>?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Constructor<*>>
|
||||
fun giveAll(): MutableList<Constructor<*>>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 得到 `Constructor` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Constructor` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -480,13 +492,17 @@ fun wait(initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得 `Constructor` 实例处理类数组,配合 `RemedyPlan` 使用。
|
||||
|
@@ -245,13 +245,17 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Field>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Field>.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 当在 `RemedyPlan` 中找到结果时。
|
||||
@@ -273,7 +277,7 @@ field {
|
||||
## Result <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
@@ -300,7 +304,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -360,13 +364,17 @@ field {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(instance: Any?): ArrayList<Instance>
|
||||
fun all(instance: Any?): MutableList<Instance>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得 `Field` 实例处理类数组。
|
||||
@@ -408,20 +416,24 @@ fun give(): Field?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Field>
|
||||
fun giveAll(): MutableList<Field>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 得到 `Field` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Field` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -450,13 +462,17 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(instance: Any?, initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得 `Field` 实例处理类数组,配合 `RemedyPlan` 使用。
|
||||
|
@@ -395,13 +395,17 @@ inner class Result internal constructor()
|
||||
#### onFind <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun onFind(initiate: HashSet<Method>.() -> Unit)
|
||||
fun onFind(initiate: MutableList<Method>.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 当在 `RemedyPlan` 中找到结果时。
|
||||
@@ -423,7 +427,7 @@ method {
|
||||
## Result <span class="symbol">- class</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, private val throwable: Throwable?) : BaseResult
|
||||
inner class Result internal constructor(internal val isNoSuch: Boolean, internal val throwable: Throwable?) : BaseResult
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
@@ -450,7 +454,7 @@ inline fun result(initiate: Result.() -> Unit): Result
|
||||
|
||||
**功能示例**
|
||||
|
||||
你可以使用 `lambda` 形式创建 `Result` 类。
|
||||
你可以使用 **lambda** 形式创建 `Result` 类。
|
||||
|
||||
> 示例如下
|
||||
|
||||
@@ -512,13 +516,17 @@ method {
|
||||
### all <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun all(instance: Any?): ArrayList<Instance>
|
||||
fun all(instance: Any?): MutableList<Instance>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得 `Method` 实例处理类数组。
|
||||
@@ -560,20 +568,24 @@ fun give(): Method?
|
||||
### giveAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun giveAll(): HashSet<Method>
|
||||
fun giveAll(): MutableList<Method>
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
返回值类型由 `HashSet` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 得到 `Method` 本身数组。
|
||||
|
||||
返回全部查找条件匹配的多个 `Method` 实例。
|
||||
|
||||
在查找条件找不到任何结果的时候将返回空的 `HashSet`。
|
||||
在查找条件找不到任何结果的时候将返回空的 `MutableList`。
|
||||
|
||||
### wait <span class="symbol">- method</span>
|
||||
|
||||
@@ -602,13 +614,17 @@ fun wait(instance: Any?, initiate: Instance.() -> Unit)
|
||||
### waitAll <span class="symbol">- method</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
fun waitAll(instance: Any?, initiate: ArrayList<Instance>.() -> Unit)
|
||||
fun waitAll(instance: Any?, initiate: MutableList<Instance>.() -> Unit)
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.0` `添加`
|
||||
|
||||
`v1.0.3` `修改`
|
||||
|
||||
`initiate` 类型由 `ArrayList` 修改为 `MutableList`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 获得 `Method` 实例处理类数组,配合 `RemedyPlan` 使用。
|
||||
|
@@ -0,0 +1,67 @@
|
||||
---
|
||||
pageClass: code-page
|
||||
---
|
||||
|
||||
# YLog <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object YLog
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 全局 Log 管理类。
|
||||
|
||||
## Configs <span class="symbol">- object</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
object Configs
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 配置 `YLog`。
|
||||
|
||||
### tag <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var tag: String
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 这是一个调试日志的全局标识。
|
||||
|
||||
默认文案为 `YukiReflection`。
|
||||
|
||||
你可以修改为你自己的文案。
|
||||
|
||||
### isEnable <span class="symbol">- field</span>
|
||||
|
||||
```kotlin:no-line-numbers
|
||||
var isEnable: Boolean
|
||||
```
|
||||
|
||||
**变更记录**
|
||||
|
||||
`v1.0.3` `新增`
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 是否启用调试日志的输出功能。
|
||||
|
||||
关闭后将会停用 `YukiReflection` 对全部日志的输出。
|
||||
|
||||
当 `isEnable` 关闭后 `YukiReflection.Configs.isDebug` 也将同时关闭。
|
@@ -12,4 +12,4 @@ pageClass: code-page
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关组件的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/android/ComponentTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ComponentTypeFactory.kt) 进行查看。
|
@@ -12,4 +12,4 @@ pageClass: code-page
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关 `Graphics` 的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/GraphicsTypeFactory.kt) 进行查看。
|
@@ -12,4 +12,4 @@ pageClass: code-page
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Android` 相关 `Widget` 的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/android/ViewTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/android/ViewTypeFactory.kt) 进行查看。
|
@@ -10,6 +10,6 @@ pageClass: code-page
|
||||
|
||||
**功能描述**
|
||||
|
||||
> 这是一个预置反射类型的常量类,主要为 `Java` 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
> 这是一个预置反射类型的常量类,主要为 Java 相关基本变量类型的 `Class` 内容,跟随版本更新会逐一进行增加。
|
||||
|
||||
详情可 [点击这里](https://github.com/fankes/YukiReflection/blob/master/yukireflection/src/api/kotlin/com/highcapable/yukireflection/type/java/VariableTypeFactory.kt) 进行查看。
|
||||
详情可 [点击这里](https://github.com/HighCapable/YukiReflection/blob/master/yukireflection/src/main/java/com/highcapable/yukireflection/type/java/VariableTypeFactory.kt) 进行查看。
|
@@ -2,21 +2,21 @@
|
||||
|
||||
> 这里介绍了 `YukiReflection` 的基本配置方法。
|
||||
|
||||
`YukiReflection` 无需一些复杂的配置即可直接开始使用,且不会与 `Java` 原生的反射 API 冲突。
|
||||
`YukiReflection` 无需一些复杂的配置即可直接开始使用,且不会与 Java 原生的反射 API 冲突。
|
||||
|
||||
你可以在使用之前对 `YukiReflection` 进行一些功能配置。
|
||||
|
||||
## 获取 API 版本
|
||||
## 获取 API 标签 & 版本
|
||||
|
||||
你可以通过如下方式获取当前 `YukiReflection` 的 API 版本。
|
||||
你可以通过如下方式获取当前 `YukiReflection` 的标签和版本。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
// 获取版本名称
|
||||
val versionName = YukiReflection.API_VERSION_NAME
|
||||
// 获取版本号
|
||||
val versionCode = YukiReflection.API_VERSION_CODE
|
||||
// 获取标签
|
||||
val tag = YukiReflection.TAG
|
||||
// 获取版本
|
||||
val version = YukiReflection.VERSION
|
||||
```
|
||||
|
||||
你可以通过获取版本进行一些不同版本差异的判断或用于显示在关于信息中。
|
||||
@@ -42,10 +42,12 @@ API 内部的日志将会使用此标签进行打印。
|
||||
```kotlin
|
||||
// 通过 configs 方法
|
||||
YukiReflection.configs {
|
||||
debugTag = "YourCustomTag"
|
||||
debugLog {
|
||||
tag = "YourCustomTag"
|
||||
}
|
||||
}
|
||||
// 直接设置
|
||||
YukiReflection.Configs.debugTag = "YourCustomTag"
|
||||
YLog.Configs.tag = "YourCustomTag"
|
||||
```
|
||||
|
||||
### 启用或禁用 Debug 模式
|
||||
@@ -76,27 +78,12 @@ YukiReflection.Configs.isDebug = true
|
||||
```kotlin
|
||||
// 通过 configs 方法
|
||||
YukiReflection.configs {
|
||||
isAllowPrintingLogs = true
|
||||
debugLog {
|
||||
isEnable = true
|
||||
}
|
||||
}
|
||||
// 直接设置
|
||||
YukiReflection.Configs.isAllowPrintingLogs = true
|
||||
```
|
||||
|
||||
### 启用或禁用 Member 缓存
|
||||
|
||||
你可以使用如下方式来启用或禁用 `Member` 缓存。
|
||||
|
||||
为防止 `Member` 复用过高造成的系统 GC 问题,此功能默认启用。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
// 通过 configs 方法
|
||||
YukiReflection.configs {
|
||||
isEnableMemberCache = true
|
||||
}
|
||||
// 直接设置
|
||||
YukiReflection.Configs.isEnableMemberCache = true
|
||||
YLog.Configs.isEnable = true
|
||||
```
|
||||
|
||||
### 使用 configs 方法配置
|
||||
@@ -107,10 +94,11 @@ YukiReflection.Configs.isEnableMemberCache = true
|
||||
|
||||
```kotlin
|
||||
YukiReflection.configs {
|
||||
debugTag = "YourCustomTag"
|
||||
debugLog {
|
||||
tag = "YourCustomTag"
|
||||
isEnable = true
|
||||
}
|
||||
isDebug = true
|
||||
isAllowPrintingLogs = true
|
||||
isEnableMemberCache = true
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -29,15 +29,15 @@ Method/Constructor/Field match type "**TYPE**" not allowed
|
||||
```kotlin
|
||||
// 查找一个方法
|
||||
method {
|
||||
// ❗设置了无效的类型举例
|
||||
// 设置了无效的类型举例
|
||||
param(false, 1, 0)
|
||||
// ❗设置了无效的类型举例
|
||||
// 设置了无效的类型举例
|
||||
returnType = false
|
||||
}
|
||||
|
||||
// 查找一个变量
|
||||
field {
|
||||
// ❗设置了无效的类型举例
|
||||
// 设置了无效的类型举例
|
||||
type = false
|
||||
}
|
||||
```
|
||||
@@ -102,30 +102,6 @@ Trying **COUNT** times and all failure by RemedyPlan
|
||||
|
||||
::: danger loggerE
|
||||
|
||||
You must set a condition when finding a Method/Constructor/Field
|
||||
|
||||
:::
|
||||
|
||||
**异常原因**
|
||||
|
||||
在查找方法、构造方法以及变量时并未设置任何条件。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
method {
|
||||
// 这里没有设置任何条件
|
||||
}
|
||||
```
|
||||
|
||||
**解决方案**
|
||||
|
||||
请将查找条件补充完整并再试一次。
|
||||
|
||||
###### exception
|
||||
|
||||
::: danger loggerE
|
||||
|
||||
Can't find this Class in \[**CLASSLOADER**\]: **CONTENT** Generated by YukiReflection#ReflectionTool
|
||||
|
||||
:::
|
||||
|
@@ -1,34 +1,34 @@
|
||||
# 介绍
|
||||
|
||||
> `YukiReflection` 是一个基于 Android 平台的反射 API。
|
||||
> `YukiReflection` 是一个基于 Java 和 Android 平台的反射 API。
|
||||
|
||||
## 背景
|
||||
|
||||
这是一个使用 `Kotlin` 基于 `Java` 原生反射 API 重新打造的一套简洁、高效的反射 API。
|
||||
这是一个使用 Kotlin 基于 Java 原生反射 API 重新打造的一套简洁、高效的反射 API。
|
||||
|
||||
`YukiReflection` 同时也是 [YukiHookAPI](https://github.com/fankes/YukiHookAPI) 正在使用的核心功能。
|
||||
`YukiReflection` 同时也是 [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI) 正在使用的核心功能。
|
||||
|
||||
名称取自 [《ももくり》女主 栗原 雪(Yuki)](https://www.bilibili.com/bangumi/play/ss5016)。
|
||||
|
||||
## 用途
|
||||
|
||||
`YukiReflection` 完全采用 `Kotlin` `lambda` 语法构建。
|
||||
`YukiReflection` 完全采用 Kotlin **lambda** 语法构建。
|
||||
|
||||
它能取代 [Java 原生的反射 API](https://pdai.tech/md/java/basic/java-basic-x-reflection.html),使用更加人性化的语言实现一套更加完善的反射方案。
|
||||
|
||||
## 语言要求
|
||||
|
||||
请使用 `Kotlin`,API 部分代码构成同样兼容 `Java` 但基础反射场景的实现**可能完全无法使用**。
|
||||
请使用 Kotlin,API 部分代码构成同样兼容 Java 但基础反射场景的实现**可能完全无法使用**。
|
||||
|
||||
文档全部的 Demo 示例代码都将使用 `Kotlin` 进行描述,如果你完全不会使用 `Kotlin` 那你将有可能无法使用 `YukiReflection`。
|
||||
文档全部的 Demo 示例代码都将使用 Kotlin 进行描述,如果你完全不会使用 Kotlin 那你将有可能无法使用 `YukiReflection`。
|
||||
|
||||
## 灵感来源
|
||||
|
||||
`YukiReflection` 最初是集成在 [YukiHookAPI](https://github.com/fankes/YukiHookAPI) 项目中的核心功能,现在进行了解耦合,使得这套反射 API 可以在任何 Android 平台的项目中使用。
|
||||
`YukiReflection` 最初是集成在 [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI) 项目中的核心功能,现在进行了解耦合,使得这套反射 API 可以在任何 Java 和 Android 平台的项目中使用。
|
||||
|
||||
现在,我们只需要编写少量的代码,就能实现一个简单的反射调用。
|
||||
|
||||
借助 `Kotlin` 优雅的 `lambda` 写法以及 `YukiReflection`,可以让你的反射逻辑更加美观清晰。
|
||||
借助 Kotlin 优雅的 **lambda** 写法以及 `YukiReflection`,可以让你的反射逻辑更加美观清晰。
|
||||
|
||||
> 示例如下
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
## 环境要求
|
||||
|
||||
- Windows 7 及以上/macOS 10.14 及以上/Linux 发行版(Arch/Debian)
|
||||
- Windows 7 及以上/macOS 10.14 及以上/Linux 发行版 (Arch/Debian)
|
||||
|
||||
- Android Studio 2021.1 及以上
|
||||
|
||||
@@ -16,35 +16,92 @@
|
||||
|
||||
- Gradle 7.0 及以上
|
||||
|
||||
- Jvm 11 及以上
|
||||
- Java 11 及以上
|
||||
|
||||
- Java 17 及以上 (Since API `1.0.3`)
|
||||
|
||||
## 项目要求
|
||||
|
||||
项目需要使用 `Android Studio` 或 `IntelliJ IDEA` 创建且类型为 Android 项目并已集成 `Kotlin` 环境依赖。
|
||||
项目需要使用 `Android Studio` 或 `IntelliJ IDEA` 创建且类型为 Java 或 Android 项目并已集成 Kotlin 环境依赖。
|
||||
|
||||
## 集成依赖
|
||||
### 集成依赖
|
||||
|
||||
**(可选)** 在你的项目 `build.gradle` 中添加依赖。
|
||||
我们推荐使用 Kotlin DSL 作为 Gradle 构建脚本语言并推荐使用 [SweetDependency](https://github.com/HighCapable/SweetDependency) 来管理依赖。
|
||||
|
||||
#### SweetDependency (推荐)
|
||||
|
||||
在你的项目 `SweetDependency` 配置文件中添加存储库和依赖。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```yaml
|
||||
repositories:
|
||||
# MavenCentral 有 2 小时缓存,若无法集成最新版本请添加
|
||||
sonatype-oss-releases:
|
||||
|
||||
libraries:
|
||||
com.highcapable.yukireflection:
|
||||
api:
|
||||
version: +
|
||||
...
|
||||
```
|
||||
|
||||
添加完成后运行一次 Gradle Sync,所有依赖版本将自动装配。
|
||||
|
||||
接下来,在你的项目 `build.gradle.kts` 中部署依赖。
|
||||
|
||||
> 示例如下
|
||||
|
||||
```kotlin
|
||||
dependencies {
|
||||
implementation(com.highcapable.yukireflection.api)
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
#### 传统方式
|
||||
|
||||
在你的项目 `build.gradle.kts` 或 `build.gradle` 中添加存储库。
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
```kotlin
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址
|
||||
maven { url("https://s01.oss.sonatype.org/content/repositories/releases/") }
|
||||
}
|
||||
```
|
||||
|
||||
> Groovy DSL
|
||||
|
||||
```groovy
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// MavenCentral 有 2 小时缓存,若无法集成最新版本请添加此地址
|
||||
maven { url "https://s01.oss.sonatype.org/content/repositories/releases" }
|
||||
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases/' }
|
||||
}
|
||||
```
|
||||
|
||||
在你的 app `build.gradle` 中添加依赖。
|
||||
在你的项目 `build.gradle.kts` 或 `build.gradle` 中添加依赖。
|
||||
|
||||
> 示例如下
|
||||
> Kotlin DSL
|
||||
|
||||
```kotlin
|
||||
dependencies {
|
||||
implementation("com.highcapable.yukireflection:api:<yuki-version>")
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
> Groovy DSL
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
// 基础依赖
|
||||
implementation 'com.highcapable.yukireflection:api:<yuki-version>'
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -52,22 +109,46 @@ dependencies {
|
||||
|
||||
::: danger
|
||||
|
||||
如果你的项目目前正在使用 [YukiHookAPI](https://github.com/fankes/YukiHookAPI),请不要重复集成 **YukiReflection**,因为 **YukiHookAPI** 已经包含了其中的功能且存在针对相关功能的改动,重复集成会造成功能性冲突引发异常,此时你应该前往 **YukiHookAPI** 的 [文档](https://fankes.github.io/YukiHookAPI/zh-cn/) 查看对应使用教程。
|
||||
如果你的项目目前正在使用 [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI) 的 1.x.x 版本,请不要重复集成 **YukiReflection**,因为 **YukiHookAPI** 已经包含了其中的功能且存在针对相关功能的改动,重复集成会造成功能性冲突引发异常,此时你应该前往 **YukiHookAPI** 的 [文档](https://highcapable.github.io/YukiHookAPI/zh-cn/) 查看对应的使用教程。
|
||||
|
||||
**YukiHookAPI** 将在 **2.0.0** 版本完全分离 **YukiReflection**,届时你可以同时与 **YukiHookAPI** 使用。
|
||||
|
||||
:::
|
||||
|
||||
在你的 app `build.gradle` 中修改 `Kotlin` 的 Jvm 版本为 11 及以上。
|
||||
#### 配置 Java 版本
|
||||
|
||||
> 示例如下
|
||||
在你的项目 `build.gradle.kts` 或 `build.gradle` 中修改 Kotlin 的 Java 版本为 17 及以上。
|
||||
|
||||
> Kotlin DSL
|
||||
|
||||
```kt
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> Groovy DSL
|
||||
|
||||
```groovy
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
jvmTarget = '17'
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
::: warning
|
||||
|
||||
自 API **1.0.3** 版本后 Kotlin 使用的 Java 版本默认为 17,不再支持 11 及以下版本。
|
||||
|
||||
:::
|
@@ -9,5 +9,32 @@ actions:
|
||||
- text: 更新日志
|
||||
link: /zh-cn/about/changelog
|
||||
type: secondary
|
||||
footer: MIT License | Copyright (C) 2019-2023 HighCapable
|
||||
---
|
||||
features:
|
||||
- title: 轻量优雅
|
||||
details: 拥有一套强大、优雅、人性化、完全使用 Kotlin lambda 打造的 API,可以帮你快速实现字节码的查找以及反射功能。
|
||||
- title: 可跨平台
|
||||
details: 不仅仅是 Android 平台,它与 Java API 高度兼容,可使用在任何 Kotlin on JVM 的项目上,有 Java 的地方就可以使用。
|
||||
- title: 快速上手
|
||||
details: 简单易用,不需要繁琐的配置,不需要十足的开发经验,搭建环境集成依赖即可立即开始使用。
|
||||
footer: Apache-2.0 License | Copyright (C) 2019 HighCapable
|
||||
---
|
||||
|
||||
### 来吧!让反射也变得诗情画意
|
||||
|
||||
```java
|
||||
public class World {
|
||||
|
||||
private void sayHello(String content) {
|
||||
System.out.println("Hello " + content + "!");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```kotlin
|
||||
val newWorld = World()
|
||||
classOf<World>().method {
|
||||
name = "sayHello"
|
||||
param(StringClass)
|
||||
type = UnitType
|
||||
}.get(newWorld).call("YukiReflection")
|
||||
```
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
const t=JSON.parse('{"key":"v-3706649a","path":"/404.html","title":"","lang":"en-US","frontmatter":{"layout":"NotFound"},"excerpt":"","headers":[],"git":{},"filePathRelative":null}');export{t as data};
|
@@ -1 +0,0 @@
|
||||
import{_ as e,o as c,c as t}from"./app.454a660d.js";const _={};function o(r,n){return c(),t("div")}const a=e(_,[["render",o],["__file","404.html.vue"]]);export{a as default};
|
@@ -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":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"en/api/public/com/highcapable/yukireflection/finder/base/BaseFinder.md"}');export{e as data};
|
@@ -1 +0,0 @@
|
||||
const e=JSON.parse('{"key":"v-c945cb6e","path":"/zh-cn/api/public/com/highcapable/yukireflection/finder/base/BaseFinder.html","title":"BaseFinder - class","lang":"zh-CN","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":1674666410000,"contributors":[{"name":"fankesyooni","email":"qzmmcn@163.com","commits":1}]},"filePathRelative":"zh-cn/api/public/com/highcapable/yukireflection/finder/base/BaseFinder.md"}');export{e as data};
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user