Java Class Load getClass(String className)

Here you can find the source of getClass(String className)

Description

get Class

License

Apache License

Declaration

public static Class<?> getClass(String className) throws ClassNotFoundException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;
import java.util.Map;

public class Main {
    private static Map<String, Class<?>> builtinDataTypeMap = new HashMap<String, Class<?>>();

    public static Class<?> getClass(String className) throws ClassNotFoundException {
        if (builtinDataTypeMap.containsKey(className)) {
            return builtinDataTypeMap.get(className);
        } else {//from  ww  w.j a  v  a 2 s.c  o m
            return Class.forName(className);
        }
    }
}

Related

  1. fromString(final Class clazz, final String value)
  2. fromString(String string, Class arrayClass)
  3. getClass(Class clazz)
  4. getClass(String className)
  5. getClass(String className)
  6. getClass(String fullClassName)
  7. getClass(String name)
  8. getClass(String name)
  9. getClass(String upnpDataType)