Here you can find the source of getConstructor(String typeString)
private static <C> Constructor<C> getConstructor(String typeString) throws IllegalArgumentException
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Constructor; public class Main { private static <C> Constructor<C> getConstructor(String typeString) throws IllegalArgumentException { Class<Object> clazz; try {//from w w w. j a v a2 s . c om @SuppressWarnings("unchecked") Class<Object> clazzCast = (Class<Object>) Class.forName(typeString); clazz = clazzCast; } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Unknown class for type " + typeString); } try { @SuppressWarnings("unchecked") Constructor<C> constructor = (Constructor<C>) clazz.getConstructor(new Class[] { String.class }); return constructor; } catch (Exception e) { throw new IllegalArgumentException( "Could not find constructor with single String argument for " + clazz); } } }