org.springframework.util
Class ClassUtils

java.lang.Object
  extended by org.springframework.util.ClassUtils

public class ClassUtils
extends java.lang.Object

Miscellaneous class utility methods. Mainly for internal use within the spring framework; consider Jakarta's Commons Lang for a more comprehensive suite of class utilities.

This was extracted from Spring in order to remove the dependency on apache commons-io. issue 2 (remove unneccessary dependencies)/p>

Author:
Keith Donald, Rob Harrop, Juergen Hoeller

Constructor Summary
ClassUtils()
           
 
Method Summary
static java.lang.ClassLoader getDefaultClassLoader()
          Return a default ClassLoader to use (never null).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

getDefaultClassLoader

public static java.lang.ClassLoader getDefaultClassLoader()

Return a default ClassLoader to use (never null). Returns 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:
ClassLoader
See Also:
Thread.getContextClassLoader()


Copyright © 2007. All Rights Reserved.