private Printer newJavaPrinter(String n, List<String> imports, String sup, String type, List<String> impl, String jdoc) throws FileNotFoundException {
        String name = properties.getProperty(n);
        if ( name == null ) throw Util.failure("unknown class template: "+n);
        File f = new File(name + ".java");
        Printer printer = new Printer(new PrintStream(f));
        String pname = this.DEST_PACKAGE.get();
        if ( !"".equals(pname) ) {
            printer.println("package "+pname+ ';');
            printer.nextln();
        }
        String pabs = ABSTRACT.get();
        if ( !"".equals(pabs))
            printer.println("import "+pabs+".*;");
        if ( imports != null ) for ( String s : imports ) {
            printer.println("import "+s+ ';');
        }
        if ( jdoc != null )
            generateJavaDoc(printer, jdoc);
        String ec = sup == null ? "" : " extends "+sup;
        printer.print("public "+type+ ' ' +name+ec+' ');
        if ( impl != null ) {
            printer.beginList("implements ");
            for ( String str : impl ) printer.print(str);
            printer.endList(" ");
        }
        printer.startblock();
        return printer;
    }