Here you can find the source of getClass(String fullClassName)
fullClassName
.
public static Class<?> getClass(String fullClassName)
//package com.java2s; /**//from w w w.j a v a 2 s . c om * <p> * This product is licensed under the Apache License, Version 2.0, * available at http://www.apache.org/licenses/LICENSE-2.0. * * This product contains portions derived from Apache hadoop which is * licensed under the Apache License, Version 2.0, available at * http://hadoop.apache.org. * * ? 2007 ? 2012 eBay Inc., Evan Chiu, Woody Zhou, Jack Shen, Gyanit Singh, Neel Sundaresan * */ import java.util.HashMap; import java.util.Map; public class Main { private static final Map<String, Class<?>> _CLASS_MAPPING = new HashMap<String, Class<?>>(); /** * Get the {@link Class} reference by the given * <code>fullClassName</code>. */ public static Class<?> getClass(String fullClassName) { Class<?> clazz = null; synchronized (_CLASS_MAPPING) { if ((clazz = _CLASS_MAPPING.get(fullClassName)) == null) { try { clazz = Class.forName(fullClassName); _CLASS_MAPPING.put(fullClassName, clazz); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } } return clazz; } }