1 30 package org.objectweb.asm.test.cases; 31 32 import java.io.IOException ; 33 34 import org.objectweb.asm.ClassWriter; 35 import org.objectweb.asm.MethodVisitor; 36 37 43 public class Interface extends Generator { 44 45 public void generate(final String dir) throws IOException { 46 generate(dir, "Interface.class", dump()); 47 } 48 49 public byte[] dump() { 50 ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); 51 52 cw.visit(1 << 16 | V1_5, 53 ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, 54 "Interface", 55 "<E:Ljava/lang/Object;>Ljava/lang/Object;", 56 "java/lang/Object", 57 null); 58 59 MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, 60 "m", 61 "(ZBCSIFJDLjava/lang/Object;)Ljava/lang/Object;", 62 "(ZBCSIFJDTE;)TE;", 63 null); 64 mv.visitEnd(); 65 66 cw.visitEnd(); 67 68 return cw.toByteArray(); 69 } 70 } 71 | Popular Tags |