static void genclass(DelegatorGenerator dg, Class intfcl, String fqcn, File srcroot) throws IOException { File genDir = new File(srcroot, dirForFqcn(fqcn)); if (!genDir.exists()) { System.err.println( JdbcProxyGenerator.class.getName() + " -- creating directory: " + genDir.getAbsolutePath()); genDir.mkdirs(); } String fileName = CodegenUtils.fqcnLastElement(fqcn) + ".java"; Writer w = null; try { w = new BufferedWriter(new FileWriter(new File(genDir, fileName))); dg.writeDelegator(intfcl, fqcn, w); w.flush(); System.err.println("Generated " + fileName); } finally { try { if (w != null) w.close(); } catch (Exception e) { e.printStackTrace(); } } }
// totally superfluous, but included to be "regular" and very specific, and as a hook for // "general" overrides in future protected void generateDelegateCode( Class intfcl, String genclass, Method method, IndentedWriter iw) throws IOException { super.generateDelegateCode(intfcl, genclass, method, iw); }