public final class ClassUtils extends Object
org.springframework.util.ClassUtils in version 5.1.3:
| Modifier and Type | Method and Description |
|---|---|
static ClassLoader |
getDefaultClassLoader()
Return the default ClassLoader to use: typically the thread context
ClassLoader, if available; the ClassLoader that loaded the ClassUtils
class will be used as fallback.
|
public static ClassLoader getDefaultClassLoader()
Call this method if you intend to use the thread context ClassLoader
in a scenario where you clearly prefer a non-null ClassLoader reference:
for example, for class path resource loading (but not necessarily for
Class.forName, which accepts a null ClassLoader
reference as well).
null if even the system
ClassLoader isn't accessible)Thread.getContextClassLoader(),
ClassLoader.getSystemClassLoader()Copyright © 2015–2019 Neo Technology, Inc.. All rights reserved.