import{_ as s,o as e,c as n,e as a}from"./app.87c2e303.js";const l={},o=a(`<h1 id="api-basic-configs" tabindex="-1"><a class="header-anchor" href="#api-basic-configs" aria-hidden="true">#</a> API Basic Configs</h1><blockquote><p>The basic configuration method of <code>YukiReflection</code> is introduced here.</p></blockquote><p><code>YukiReflection</code> can be used directly without some complex configuration, and does not conflict with <code>Java</code>&#39;s native Reflection API.</p><p>You can configure some functions of <code>YukiReflection</code> before using it.</p><h2 id="get-the-api-version" tabindex="-1"><a class="header-anchor" href="#get-the-api-version" aria-hidden="true">#</a> Get the API Version</h2><p>You can get the current API version of <code>YukiReflection</code> as follows.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// Get the version name</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> versionName </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">. </span><span style="color:#F69D50;">API_VERSION_NAME</span></span>
<span class="line"><span style="color:#768390;">// Get the version code</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> versionCode </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">. </span><span style="color:#F69D50;">API_VERSION_CODE</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>You can judge the difference between different versions or display it in the about information by obtaining the version.</p><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>For more functions, please refer to <a href="../api/public/com/highcapable/yukireflection/YukiReflection">YukiReflection</a>.</p></div><h2 id="configure-api-related-functions" tabindex="-1"><a class="header-anchor" href="#configure-api-related-functions" aria-hidden="true">#</a> Configure API Related Functions</h2><p>You can configure related functions through <code>YukiReflection.configs { ... }</code> method or <code>YukiReflection.Configs</code>.</p><h3 id="custom-debug-log-tag" tabindex="-1"><a class="header-anchor" href="#custom-debug-log-tag" aria-hidden="true">#</a> Custom Debug Log Tag</h3><p>You can use the following methods to customize the tag of the debug log.</p><p>Logs inside the API will be printed using this tag.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// Via the configs method</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.configs {</span></span>
<span class="line"><span style="color:#ADBAC7;">    debugTag </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;YourCustomTag&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// Set directly</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Configs</span><span style="color:#ADBAC7;">.debugTag </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;YourCustomTag&quot;</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="enable-or-disable-debug-mode" tabindex="-1"><a class="header-anchor" href="#enable-or-disable-debug-mode" aria-hidden="true">#</a> Enable or Disable Debug Mode</h3><p>You can use the following methods to enable or disable Debug mode.</p><p>The Debug mode is disabled by default, and when enabled, detailed logs (such as the time spent on the reflective search function) will be printed to the console.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// Via the configs method</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.configs {</span></span>
<span class="line"><span style="color:#ADBAC7;">    isDebug </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// Set directly</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Configs</span><span style="color:#ADBAC7;">.isDebug </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="enable-or-disable-debug-logs" tabindex="-1"><a class="header-anchor" href="#enable-or-disable-debug-logs" aria-hidden="true">#</a> Enable or Disable Debug Logs</h3><p>You can use the following methods to enable or disable debug logs.</p><p>This function is enabled by default, and disable will stop <code>YukiReflection</code> output all logs.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// Via the configs method</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.configs {</span></span>
<span class="line"><span style="color:#ADBAC7;">    isAllowPrintingLogs </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// Set directly</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Configs</span><span style="color:#ADBAC7;">.isAllowPrintingLogs </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="enable-or-disable-member-cache" tabindex="-1"><a class="header-anchor" href="#enable-or-disable-member-cache" aria-hidden="true">#</a> Enable or Disable Member Cache</h3><p>You can enable or disable <code>Member</code> caching as follows.</p><p>To prevent system GC problems caused by excessive <code>Member</code> reuse, this feature is enabled by default.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// Via the configs method</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.configs {</span></span>
<span class="line"><span style="color:#ADBAC7;">    isEnableMemberCache </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"><span style="color:#768390;">// Set directly</span></span>
<span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">Configs</span><span style="color:#ADBAC7;">.isEnableMemberCache </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="use-the-configs-method-to-configure" tabindex="-1"><a class="header-anchor" href="#use-the-configs-method-to-configure" aria-hidden="true">#</a> Use the configs Method to Configure</h3><p>In order to configure multiple features at once, you can directly use the <code>YukiReflection.configs { ... }</code> method to configure.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">YukiReflection</span><span style="color:#ADBAC7;">.configs {</span></span>
<span class="line"><span style="color:#ADBAC7;">    debugTag </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;YourCustomTag&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    isDebug </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"><span style="color:#ADBAC7;">    isAllowPrintingLogs </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"><span style="color:#ADBAC7;">    isEnableMemberCache </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">true</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>For more functions, please refer to <a href="../api/public/com/highcapable/yukireflection/YukiReflection#configs-method">YukiReflection.configs</a> method, <a href="../api/public/com/highcapable/yukireflection/YukiReflection#configs-object">YukiReflection.Configs</a>.</p></div>`,37),i=[o];function c(p,t){return e(),n("div",null,i)}const d=s(l,[["render",c],["__file","api-example.html.vue"]]);export{d as default};
