| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (17) --> |
| <title>LoaderUtil (Apache Log4j API 2.23.1 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.logging.log4j.util, class: LoaderUtil"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/LoaderUtil.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search-input">SEARCH:</label> |
| <input type="text" id="search-input" value="search" disabled="disabled"> |
| <input type="reset" id="reset-button" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.logging.log4j.util</a></div> |
| <h1 title="Class LoaderUtil" class="title">Class LoaderUtil</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> |
| <div class="inheritance">org.apache.logging.log4j.util.LoaderUtil</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <hr> |
| <div class="type-signature"><span class="annotations"><a href="InternalApi.html" title="annotation in org.apache.logging.log4j.util">@InternalApi</a> |
| </span><span class="modifiers">public final class </span><span class="element-name type-name-label">LoaderUtil</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div> |
| <div class="block"><em>Consider this class private.</em> Utility class for ClassLoaders.</div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link"><code>ClassLoader</code></a></li> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimePermission.html" title="class or interface in java.lang" class="external-link"><code>RuntimePermission</code></a></li> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getContextClassLoader--" title="class or interface in java.lang" class="external-link"><code>Thread.getContextClassLoader()</code></a></li> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#getSystemClassLoader--" title="class or interface in java.lang" class="external-link"><code>ClassLoader.getSystemClassLoader()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static final <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color"><code><a href="#IGNORE_TCCL_PROPERTY" class="member-name-link">IGNORE_TCCL_PROPERTY</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">System property to set to ignore the thread context ClassLoader.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html" title="class or interface in java.net" class="external-link">URL</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#findResources(java.lang.String)" class="member-name-link">findResources</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> resource)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Finds classpath <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html" title="class or interface in java.net" class="external-link">resources</a>.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link">ClassLoader</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getClassLoader()" class="member-name-link">getClassLoader</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Returns the ClassLoader to use.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link">ClassLoader</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getClassLoader(java.lang.Class,java.lang.Class)" class="member-name-link">getClassLoader</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?> class1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?> class2)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link">ClassLoader</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getThreadContextClassLoader()" class="member-name-link">getThreadContextClassLoader</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Looks up the ClassLoader for this current thread.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isClassAvailable(java.lang.String)" class="member-name-link">isClassAvailable</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Determines if a named Class can be loaded or not.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#loadClass(java.lang.String)" class="member-name-link">loadClass</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads a class by name.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#loadClassUnchecked(java.lang.String)" class="member-name-link">loadClassUnchecked</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and initializes a class given its fully qualified class name.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newCheckedInstanceOf(java.lang.String,java.lang.Class)" class="member-name-link">newCheckedInstanceOf</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and instantiates a derived class using its default constructor.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newCheckedInstanceOfProperty(java.lang.String,java.lang.Class)" class="member-name-link">newCheckedInstanceOfProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> propertyName, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and instantiates a class given by a property name.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newCheckedInstanceOfProperty(java.lang.String,java.lang.Class,java.util.function.Supplier)" class="member-name-link">newCheckedInstanceOfProperty</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> propertyName, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html" title="class or interface in java.util.function" class="external-link">Supplier</a><T> defaultSupplier)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and instantiates a class given by a property name.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newInstanceOf(java.lang.Class)" class="member-name-link">newInstanceOf</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and instantiates a Class using the default constructor.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newInstanceOf(java.lang.String)" class="member-name-link">newInstanceOf</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and instantiates a Class using the default constructor.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newInstanceOfUnchecked(java.lang.Class)" class="member-name-link">newInstanceOfUnchecked</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Creates an instance of the provided class using the default constructor.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newInstanceOfUnchecked(java.lang.String)" class="member-name-link">newInstanceOfUnchecked</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads and instantiates a class by name using its default constructor.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <T> T</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#newInstanceOfUnchecked(java.lang.String,java.lang.Class)" class="member-name-link">newInstanceOfUnchecked</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> supertype)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Loads the provided class by name as a checked subtype of the given class.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="IGNORE_TCCL_PROPERTY"> |
| <h3>IGNORE_TCCL_PROPERTY</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">IGNORE_TCCL_PROPERTY</span></div> |
| <div class="block">System property to set to ignore the thread context ClassLoader.</div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>2.1</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../../../../../constant-values.html#org.apache.logging.log4j.util.LoaderUtil.IGNORE_TCCL_PROPERTY">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getClassLoader()"> |
| <h3>getClassLoader</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link">ClassLoader</a></span> <span class="element-name">getClassLoader</span>()</div> |
| <div class="block">Returns the ClassLoader to use.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the ClassLoader.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getClassLoader(java.lang.Class,java.lang.Class)"> |
| <h3>getClassLoader</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link">ClassLoader</a></span> <span class="element-name">getClassLoader</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?> class1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?> class2)</span></div> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getThreadContextClassLoader()"> |
| <h3>getThreadContextClassLoader</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link">ClassLoader</a></span> <span class="element-name">getThreadContextClassLoader</span>()</div> |
| <div class="block">Looks up the ClassLoader for this current thread. If this class does not have the runtime permission |
| <code>getClassLoader</code>, then the only ClassLoader this attempts to look up is the loader behind this |
| class. When a SecurityManager is installed, this attempts to make a privileged call to get the current |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getContextClassLoader--" title="class or interface in java.lang" class="external-link">thread context ClassLoader</a>, falling back to either the |
| ClassLoader of this class or the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#getSystemClassLoader--" title="class or interface in java.lang" class="external-link">system ClassLoader</a>. |
| When no SecurityManager is present, the same lookups are performed without use of <a href="https://docs.oracle.com/javase/8/docs/api/java/security/AccessController.html" title="class or interface in java.security" class="external-link"><code>AccessController</code></a>. |
| If none of these strategies can obtain a ClassLoader, then this returns <code>null</code>.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the current thread's ClassLoader, a fallback loader, or null if no fallback can be determined</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isClassAvailable(java.lang.String)"> |
| <h3>isClassAvailable</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type">boolean</span> <span class="element-name">isClassAvailable</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</span></div> |
| <div class="block">Determines if a named Class can be loaded or not.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - The class name.</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the class could be found or <code>false</code> otherwise.</dd> |
| <dt>Since:</dt> |
| <dd>2.7</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="loadClass(java.lang.String)"> |
| <h3>loadClass</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?></span> <span class="element-name">loadClass</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a></span></div> |
| <div class="block">Loads a class by name. This method respects the <a href="#IGNORE_TCCL_PROPERTY"><code>IGNORE_TCCL_PROPERTY</code></a> Log4j property. If this property is |
| specified and set to anything besides <code>false</code>, then the default ClassLoader will be used.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - fully qualified class name to load</dd> |
| <dt>Returns:</dt> |
| <dd>the loaded class</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a></code> - if the specified class name could not be found</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception is thrown during class initialization</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dt>Since:</dt> |
| <dd>2.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="loadClassUnchecked(java.lang.String)"> |
| <h3>loadClassUnchecked</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><?></span> <span class="element-name">loadClassUnchecked</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</span></div> |
| <div class="block">Loads and initializes a class given its fully qualified class name. All checked reflective operation |
| exceptions are translated into equivalent <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link"><code>LinkageError</code></a> classes.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - fully qualified class name to load</dd> |
| <dt>Returns:</dt> |
| <dd>the loaded class</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoClassDefFoundError.html" title="class or interface in java.lang" class="external-link">NoClassDefFoundError</a></code> - if the specified class name could not be found</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception is thrown during class initialization</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dt>Since:</dt> |
| <dd>2.22.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#loadClass(java.lang.String)"><code>loadClass(String)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newInstanceOf(java.lang.Class)"> |
| <h3>newInstanceOf</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newInstanceOf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></span></div> |
| <div class="block">Loads and instantiates a Class using the default constructor.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - the type of the class modeled by the <code>Class</code> object.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>clazz</code> - The class.</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the class.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a></code> - if the class can't be instantiated through a public constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a></code> - if an exception is thrown by the constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception was thrown while initializing the class</dd> |
| <dt>Since:</dt> |
| <dd>2.7</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newInstanceOfUnchecked(java.lang.Class)"> |
| <h3>newInstanceOfUnchecked</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newInstanceOfUnchecked</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</span></div> |
| <div class="block">Creates an instance of the provided class using the default constructor. All checked reflective operation |
| exceptions are translated into <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link"><code>LinkageError</code></a> or <a href="InternalException.html" title="class in org.apache.logging.log4j.util"><code>InternalException</code></a>.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - the type of the object being instantiated</dd> |
| <dt>Parameters:</dt> |
| <dd><code>clazz</code> - class to instantiate</dd> |
| <dt>Returns:</dt> |
| <dd>instance of the class</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodError.html" title="class or interface in java.lang" class="external-link">NoSuchMethodError</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="InternalException.html" title="class in org.apache.logging.log4j.util">InternalException</a></code> - if an exception is thrown by the constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationError.html" title="class or interface in java.lang" class="external-link">InstantiationError</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessError.html" title="class or interface in java.lang" class="external-link">IllegalAccessError</a></code> - if the class cannot be accessed</dd> |
| <dt>Since:</dt> |
| <dd>2.22.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newInstanceOf(java.lang.String)"> |
| <h3>newInstanceOf</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newInstanceOf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></span></div> |
| <div class="block">Loads and instantiates a Class using the default constructor.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - type the class must be compatible with</dd> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - fully qualified class name to load, initialize, and construct</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the class</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a></code> - if the class isn't available to the usual ClassLoaders</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception was thrown while initializing the class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang" class="external-link">ClassCastException</a></code> - if the class is not compatible with the generic type parameter provided</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a></code> - if the class can't be instantiated through a public constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a></code> - if an exception is thrown by the constructor</dd> |
| <dt>Since:</dt> |
| <dd>2.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newCheckedInstanceOfProperty(java.lang.String,java.lang.Class)"> |
| <h3>newCheckedInstanceOfProperty</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newCheckedInstanceOfProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> propertyName, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></span></div> |
| <div class="block">Loads and instantiates a class given by a property name.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The type to cast it to.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>propertyName</code> - The property name to look up a class name for.</dd> |
| <dd><code>clazz</code> - The class to cast it to.</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the class given in the property or <code>null</code> if the property was unset.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a></code> - if the class isn't available to the usual ClassLoaders</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception was thrown while initializing the class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang" class="external-link">ClassCastException</a></code> - if the class is not compatible with the generic type parameter provided</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a></code> - if the class can't be instantiated through a public constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a></code> - if an exception is thrown by the constructor</dd> |
| <dt>Since:</dt> |
| <dd>2.5</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newCheckedInstanceOfProperty(java.lang.String,java.lang.Class,java.util.function.Supplier)"> |
| <h3>newCheckedInstanceOfProperty</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newCheckedInstanceOfProperty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> propertyName, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html" title="class or interface in java.util.function" class="external-link">Supplier</a><T> defaultSupplier)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></span></div> |
| <div class="block">Loads and instantiates a class given by a property name.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The type to cast it to.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>propertyName</code> - The property name to look up a class name for.</dd> |
| <dd><code>clazz</code> - The class to cast it to.</dd> |
| <dd><code>defaultSupplier</code> - Supplier of a default value if the property is not present.</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the class given in the property or <code>null</code> if the property was unset.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a></code> - if the class isn't available to the usual ClassLoaders</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception was thrown while initializing the class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang" class="external-link">ClassCastException</a></code> - if the class is not compatible with the generic type parameter provided</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a></code> - if the class can't be instantiated through a public constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a></code> - if an exception is thrown by the constructor</dd> |
| <dt>Since:</dt> |
| <dd>2.22</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newInstanceOfUnchecked(java.lang.String)"> |
| <h3>newInstanceOfUnchecked</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newInstanceOfUnchecked</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className)</span></div> |
| <div class="block">Loads and instantiates a class by name using its default constructor. All checked reflective operation |
| exceptions are translated into corresponding <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link"><code>LinkageError</code></a> classes.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - type the class must be compatible with</dd> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - fully qualified class name to load, initialize, and construct</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the class</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoClassDefFoundError.html" title="class or interface in java.lang" class="external-link">NoClassDefFoundError</a></code> - if the specified class name could not be found</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception is thrown during class initialization</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang" class="external-link">ClassCastException</a></code> - if the class is not compatible with the generic type parameter provided</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodError.html" title="class or interface in java.lang" class="external-link">NoSuchMethodError</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="InternalException.html" title="class in org.apache.logging.log4j.util">InternalException</a></code> - if an exception is thrown by the constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationError.html" title="class or interface in java.lang" class="external-link">InstantiationError</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessError.html" title="class or interface in java.lang" class="external-link">IllegalAccessError</a></code> - if the class cannot be accessed</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dt>Since:</dt> |
| <dd>2.22.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newCheckedInstanceOf(java.lang.String,java.lang.Class)"> |
| <h3>newCheckedInstanceOf</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newCheckedInstanceOf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> clazz)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a>, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></span></div> |
| <div class="block">Loads and instantiates a derived class using its default constructor.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - The type of the class to check.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - The class name.</dd> |
| <dd><code>clazz</code> - The class to cast it to.</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the class cast to <code>T</code></dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassNotFoundException.html" title="class or interface in java.lang" class="external-link">ClassNotFoundException</a></code> - if the class isn't available to the usual ClassLoaders</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception is thrown during class initialization</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang" class="external-link">ClassCastException</a></code> - if the constructed object isn't type compatible with <code>T</code></dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodException.html" title="class or interface in java.lang" class="external-link">NoSuchMethodException</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessException.html" title="class or interface in java.lang" class="external-link">IllegalAccessException</a></code> - if the class can't be instantiated through a public constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationException.html" title="class or interface in java.lang" class="external-link">InstantiationException</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html" title="class or interface in java.lang.reflect" class="external-link">InvocationTargetException</a></code> - if there was an exception whilst constructing the class</dd> |
| <dt>Since:</dt> |
| <dd>2.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="newInstanceOfUnchecked(java.lang.String,java.lang.Class)"> |
| <h3>newInstanceOfUnchecked</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="type-parameters"><T></span> <span class="return-type">T</span> <span class="element-name">newInstanceOfUnchecked</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> className, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><T> supertype)</span></div> |
| <div class="block">Loads the provided class by name as a checked subtype of the given class. All checked reflective operation |
| exceptions are translated into corresponding <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link"><code>LinkageError</code></a> classes.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - type of instance to return</dd> |
| <dt>Parameters:</dt> |
| <dd><code>className</code> - fully qualified class name to load</dd> |
| <dd><code>supertype</code> - supertype of the class being loaded</dd> |
| <dt>Returns:</dt> |
| <dd>new instance of the requested class</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoClassDefFoundError.html" title="class or interface in java.lang" class="external-link">NoClassDefFoundError</a></code> - if the provided class name could not be found</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ExceptionInInitializerError.html" title="class or interface in java.lang" class="external-link">ExceptionInInitializerError</a></code> - if an exception is thrown during class initialization</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang" class="external-link">ClassCastException</a></code> - if the loaded class is not a subtype of the provided class</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodError.html" title="class or interface in java.lang" class="external-link">NoSuchMethodError</a></code> - if no zero-arg constructor exists</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SecurityException.html" title="class or interface in java.lang" class="external-link">SecurityException</a></code> - if this class is not allowed to access declared members of the provided class</dd> |
| <dd><code><a href="InternalException.html" title="class in org.apache.logging.log4j.util">InternalException</a></code> - if an exception is thrown by the constructor</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InstantiationError.html" title="class or interface in java.lang" class="external-link">InstantiationError</a></code> - if the provided class is abstract or an interface</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalAccessError.html" title="class or interface in java.lang" class="external-link">IllegalAccessError</a></code> - if the class cannot be accessed</dd> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/LinkageError.html" title="class or interface in java.lang" class="external-link">LinkageError</a></code> - if the linkage of the class fails for any other reason</dd> |
| <dt>Since:</dt> |
| <dd>2.22.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="findResources(java.lang.String)"> |
| <h3>findResources</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html" title="class or interface in java.net" class="external-link">URL</a>></span> <span class="element-name">findResources</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> resource)</span></div> |
| <div class="block">Finds classpath <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URL.html" title="class or interface in java.net" class="external-link">resources</a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>resource</code> - the name of the resource to find.</dd> |
| <dt>Returns:</dt> |
| <dd>a Collection of URLs matching the resource name. If no resources could be found, then this will be empty.</dd> |
| <dt>Since:</dt> |
| <dd>2.1</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small><p align="center"> Copyright © 1999-2024 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.<br/> Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation. </p></small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |