Here you can find the source of loadClassSafe(final String klassName)
public static Class<?> loadClassSafe(final String klassName)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Bruno Medeiros and other Contributors. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from ww w . j av a 2s . c o m * Bruno Medeiros - initial API and implementation *******************************************************************************/ public class Main { /** Loads a class with given klassName. * Returns null if the class could not be loaded. */ public static Class<?> loadClassSafe(final String klassName) { try { return Class.forName(klassName); } catch (ClassNotFoundException e) { return null; } } }