private static ICodeGenerator getCodeGenerator ( Class cls ) { // check if has default constructor if ( ! cls . isMemberClass ( ) ) { try { cls . getConstructor ( new Class < ? > [ 0 ] ) ; } catch ( NoSuchMethodException e2 ) { throw new IllegalArgumentException ( "Class '" + cls . getName ( ) + "' must has default constructor method with no parameters." , e2 ) ; } catch ( SecurityException e2 ) { throw new IllegalArgumentException ( e2 . getMessage ( ) , e2 ) ; } } ICodeGenerator cg = new TemplateCodeGenerator ( cls ) ; return cg ; }
Gets the code generator .