Java Utililty Methods Class Load

List of utility methods to do Class Load

Description

The list of methods to do Class Load are organized into topic(s).

Method

ClassclassForName(String name)
class For Name
Class<?> clazz = null;
try {
    clazz = Class.forName(name);
} catch (ClassNotFoundException e) {
return clazz;
ClassclassForName(String name)
Get a class for its name.
if (name.equals("boolean"))
    return boolean.class;
else if (name.equals("byte"))
    return byte.class;
else if (name.equals("short"))
    return short.class;
else if (name.equals("char"))
    return char.class;
...
ClassclassForName(String name)
Loads class for name.
Class c = (Class) primitiveTypes.get(name);
if (c == null)
    c = Class.forName(name);
return c;
ClassclassForName(String name)
Load the class with the specified name.
try {
    return Thread.currentThread().getContextClassLoader().loadClass(name);
} catch (Exception e) {
    return Class.forName(name);
ClassclassForName(String name)
class For Name
try {
    ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
    if (contextClassLoader != null) {
        return contextClassLoader.loadClass(name);
} catch (Throwable ignore) {
return Class.forName(name);
...
ClassclassForName(String name)
copied here from ObjectUtil to make the package org.jacorb.test.common independent from the orb core
if (name == null) {
    throw new IllegalArgumentException("Class name must not be null!");
try {
    return Thread.currentThread().getContextClassLoader().loadClass(name);
} catch (Exception e) {
    return Class.forName(name);
ClassclassForName(String name)

Perform resolution of a class name.

try {
    ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
    if (contextClassLoader != null) {
        return contextClassLoader.loadClass(name);
} catch (Throwable ignore) {
return Class.forName(name);
...
ClassclassForName(String name)
Gets the class for the given name
Class rs = Class.forName(name);
return rs;
ClassclassForName(String name, ClassLoader classLoader)
class For Name
Class<?> c = primitiveClassMap.get(name);
if (c == null) {
    c = Class.forName(name, false, classLoader);
return c;
ClassclassForName(String str)
Gets the Class instance from str .
if (str.equals("byte"))
    return Byte.TYPE;
if (str.equals("short"))
    return Short.TYPE;
if (str.equals("char"))
    return Character.TYPE;
if (str.equals("int"))
    return Integer.TYPE;
...