Package org.jboss.as.ejb3
Class PrimitiveClassLoaderUtil
java.lang.Object
org.jboss.as.ejb3.PrimitiveClassLoaderUtil
PrimitiveClassLoaderUtil
Util for centralizing the logic for handling primitive types
during classloading. Use the
loadClass(String, ClassLoader)
to centralize the logic of checking for primitive types to ensure that
the ClassLoader.loadClass(String) method is not invoked for primitives.- Version:
- $Revision: $
- Author:
- Jaikiran Pai
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>loadClass(String name, ClassLoader cl) First checks ifnameis a primitive type.
-
Constructor Details
-
PrimitiveClassLoaderUtil
public PrimitiveClassLoaderUtil()
-
-
Method Details
-
loadClass
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:
-