Here you can find the source of loadClassOrNull(String className)
public static Class<?> loadClassOrNull(String className)
//package com.java2s; //License from project: Apache License public class Main { private static ClassLoader classLoader; public static Class<?> loadClassOrNull(String className) { ClassLoader loader = getClassLoaderForResolving(); try {// ww w .j a v a 2s.c o m return loader.loadClass(className); } catch (ClassNotFoundException e) { return null; } } public static ClassLoader getClassLoaderForResolving() { ClassLoader cl = classLoader; if (cl == null) { // TODO:possibly want one which doesn't cache the classes? cl = Thread.currentThread().getContextClassLoader(); } return cl; } }