private static Constructor < ? > findConstructorForStaticClass ( final Class < ? > klazz ) { final Constructor < ? > [ ] constructors = klazz . getDeclaredConstructors ( ) ; if ( constructors . length == 1 ) { return constructors [ 0 ] ; } for ( final Constructor < ? > c : constructors ) { final Class < ? > [ ] params = c . getParameterTypes ( ) ; if ( params . length == 0 ) { return c ; } } return constructors [ 0 ] ; }
Find a constructor for a static class .