1 30 package org.objectweb.asm.test.cases; 31 32 import java.io.File ; 33 import java.io.FileOutputStream ; 34 import java.io.IOException ; 35 36 import org.objectweb.asm.Opcodes; 37 38 44 public class Generator implements Opcodes { 45 46 public static void main(final String [] args) throws IOException { 47 Generator generators[] = { 48 new Annotation(), 49 new Attribute(), 50 new Debug(), 51 new Enum (), 52 new Frames(), 53 new Insns(), 54 new Interface(), 55 new JSR(), 56 new Outer(), 57 new Wide() }; 58 for (int i = 0; i < generators.length; ++i) { 59 generators[i].generate(args[0]); 60 } 61 } 62 63 protected void generate(final String dir) throws IOException { 64 } 65 66 protected void generate( 67 final String dir, 68 final String path, 69 final byte[] clazz) throws IOException 70 { 71 File f = new File (new File (dir), path); 72 f.getParentFile().mkdirs(); 73 FileOutputStream o = new FileOutputStream (f); 74 o.write(clazz); 75 o.close(); 76 } 77 } 78 | Popular Tags |