protected Constructor < ? > getConstructor ( Class < ? > clazz , Class < ? > paramClass ) { for ( Constructor < ? > c : clazz . getConstructors ( ) ) { Class < ? > [ ] paramTypes = c . getParameterTypes ( ) ; if ( paramTypes . length != 1 ) { continue ; } if ( paramTypes [ 0 ] . equals ( paramClass ) ) { return c ; } } return null ; }
Returns the first constructor that has exactly one parameter of the provided paramClass type .