org.elasticsearch.common
Class Classes

java.lang.Object
  extended by org.elasticsearch.common.Classes

public class Classes
extends Object


Method Summary
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.
static String getPackageName(Class clazz)
          Determine the name of the package of the given class: e.g.
static String getPackageNameNoDomain(Class clazz)
           
static boolean isConcrete(Class<?> clazz)
           
static boolean isInnerClass(Class<?> clazz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultClassLoader

public 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.

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 String getPackageName(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 String getPackageNameNoDomain(Class clazz)

isInnerClass

public static boolean isInnerClass(Class<?> clazz)

isConcrete

public static boolean isConcrete(Class<?> clazz)


Copyright © 2009-2012. All Rights Reserved.