Package org.jboss.as.ejb3
Class PrimitiveClassLoaderUtil
- java.lang.Object
-
- org.jboss.as.ejb3.PrimitiveClassLoaderUtil
-
public class PrimitiveClassLoaderUtil extends Object
PrimitiveClassLoaderUtil Util for centralizing the logic for handling primitive types during classloading. Use theloadClass(String, ClassLoader)to centralize the logic of checking for primitive types to ensure that theClassLoader.loadClass(String)method is not invoked for primitives.- Version:
- $Revision: $
- Author:
- Jaikiran Pai
-
-
Constructor Summary
Constructors Constructor Description PrimitiveClassLoaderUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>loadClass(String name, ClassLoader cl)First checks ifnameis a primitive type.
-
-
-
Method Detail
-
loadClass
public static Class<?> loadClass(String name, ClassLoader cl) throws ClassNotFoundException
First checks ifnameis a primitive type. If yes, then returns the correspondingClassfor that primitive. If it's not a primitive then theClass.forName(String, boolean, ClassLoader)method is invoked, passing it thename, false and theclclassloader- Parameters:
name- The class that has to be loadedcl- TheClassLoaderto use, ifnameis *not* a primitive- Returns:
- Returns the
Classcorresponding toname - Throws:
ClassNotFoundException- If the class fornamecould not be found- See Also:
ClassLoader.loadClass(String)
-
-