Package org.apache.commons.jxpath.util
Class ClassLoaderUtil
java.lang.Object
org.apache.commons.jxpath.util.ClassLoaderUtil
Port of class loading methods from
org.apache.commons.lang3.ClassUtils
from the Apache Commons Lang Component. Some adjustments made to remove
dependency on org.apache.commons.lang3.StringUtils
. Also modified to fall back on the current class loader when an attempt to load a class with the
context class loader results in a java.lang.ClassNotFoundException
.
See org.apache.commons.lang3.ClassUtils- Since:
- 1.4.0
-
Method Summary
-
Method Details
-
getClass
public static <T> Class<T> getClass(String className, boolean initialize) throws ClassNotFoundException Gets the class represented byclassName
using the current thread's context class loader. This implementation supports names like "java.lang.String[]
" as well as "[Ljava.lang.String;
".- Type Parameters:
T
- The expected class type.- Parameters:
className
- the class nameinitialize
- whether the class must be initialized- Returns:
- the class represented by
className
using the current thread's context class loader - Throws:
ClassNotFoundException
- if the class is not found
-