Here you can find the source of getConstructor(Class cls, Class[] args)
public static Constructor getConstructor(Class cls, Class[] args)
//package com.java2s; /*/*from www. j av a 2s .co m*/ * Scriptographer * * This file is part of Scriptographer, a Scripting Plugin for Adobe Illustrator * http://scriptographer.org/ * * Copyright (c) 2002-2010, Juerg Lehni * http://scratchdisk.com/ * * All rights reserved. See LICENSE file for details. * * File created on Aug 26, 2007. */ import java.lang.reflect.Constructor; import java.util.IdentityHashMap; public class Main { public static Constructor getConstructor(Class<?> cls, Class[] args, IdentityHashMap<Class, Constructor> cache) { Constructor ctor = cache != null ? (Constructor) cache.get(cls) : null; if (ctor == null) { try { ctor = cls.getConstructor(args); if (cache != null) cache.put(cls, ctor); } catch (Exception e) { } } return ctor; } public static Constructor getConstructor(Class cls, Class[] args) { return getConstructor(cls, args, null); } }