Here you can find the source of toClass(String primitiveName)
public static Class toClass(String primitiveName)
//package com.java2s; /*//from ww w .j a v a 2s . co m * Copyright (c) 1998 - 2005 Versant Corporation * 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: * Versant Corporation - initial API and implementation */ import java.util.*; public class Main { private static final HashMap PRIMITIVE_NAME_MAP = new HashMap(17); /** * Convert a primitive name (int, byte etc.) to a class or null if the * name is not a primitive. */ public static Class toClass(String primitiveName) { return (Class) PRIMITIVE_NAME_MAP.get(primitiveName); } }