public class PrimitiveClassLoaderUtil extends Object
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.| Constructor and Description |
|---|
PrimitiveClassLoaderUtil() |
public static Class<?> loadClass(String name, ClassLoader cl) throws ClassNotFoundException
name is a primitive type. If yes, then returns
the corresponding Class for that primitive. If it's not a primitive
then the Class.forName(String, boolean, ClassLoader) method is invoked, passing
it the name, false and the cl classloadername - The class that has to be loadedcl - The ClassLoader to use, if name is *not* a primitiveClass corresponding to nameClassNotFoundException - If the class for name could not be foundClassLoader.loadClass(String)Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.