org.elasticsearch.common
Class Classes
java.lang.Object
org.elasticsearch.common.Classes
public class Classes
- extends java.lang.Object
Method Summary |
static java.lang.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. |
static java.lang.String |
getPackageName(java.lang.Class clazz)
Determine the name of the package of the given class:
e.g. |
static java.lang.String |
getPackageNameNoDomain(java.lang.Class clazz)
|
static boolean |
isConcrete(java.lang.Class<?> clazz)
|
static boolean |
isInnerClass(java.lang.Class<?> clazz)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getDefaultClassLoader
public static java.lang.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.
Call this method if you intend to use the thread context ClassLoader
in a scenario where you absolutely need 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).
- Returns:
- the default ClassLoader (never
null
) - See Also:
Thread.getContextClassLoader()
getPackageName
public static java.lang.String getPackageName(java.lang.Class clazz)
- Determine the name of the package of the given class:
e.g. "java.lang" for the
java.lang.String
class.
- Parameters:
clazz
- the class
- Returns:
- the package name, or the empty String if the class
is defined in the default package
getPackageNameNoDomain
public static java.lang.String getPackageNameNoDomain(java.lang.Class clazz)
isInnerClass
public static boolean isInnerClass(java.lang.Class<?> clazz)
isConcrete
public static boolean isConcrete(java.lang.Class<?> clazz)