1package asm.com.sleepycat.persist.test; 2import java.util.*; 3import org.objectweb.asm.*; 4import org.objectweb.asm.attrs.*; 5public class Enhanced0Dump implements Opcodes { 6 7public static byte[] dump () throws Exception { 8 9ClassWriter cw = new ClassWriter(false); 10FieldVisitor fv; 11MethodVisitor mv; 12AnnotationVisitor av0; 13 14cw.visit(V1_5, ACC_SUPER, "com/sleepycat/persist/test/Enhanced0", null, "java/lang/Object", null); 15 16cw.visitSource("Enhanced0.java", null); 17 18{ 19av0 = cw.visitAnnotation("Lcom/sleepycat/persist/model/Entity;", true); 20av0.visitEnd(); 21} 22{ 23fv = cw.visitField(ACC_PRIVATE, "f1", "Ljava/lang/String;", null, null); 24{ 25av0 = fv.visitAnnotation("Lcom/sleepycat/persist/model/PrimaryKey;", true); 26av0.visitEnd(); 27} 28fv.visitEnd(); 29} 30{ 31fv = cw.visitField(ACC_PRIVATE, "f2", "I", null, null); 32{ 33av0 = fv.visitAnnotation("Lcom/sleepycat/persist/model/SecondaryKey;", true); 34av0.visitEnum("relate", "Lcom/sleepycat/persist/model/Relationship;", "MANY_TO_ONE"); 35av0.visitEnd(); 36} 37fv.visitEnd(); 38} 39{ 40fv = cw.visitField(ACC_PRIVATE, "f3", "Ljava/lang/String;", null, null); 41{ 42av0 = fv.visitAnnotation("Lcom/sleepycat/persist/model/SecondaryKey;", true); 43av0.visitEnum("relate", "Lcom/sleepycat/persist/model/Relationship;", "MANY_TO_ONE"); 44av0.visitEnd(); 45} 46fv.visitEnd(); 47} 48{ 49fv = cw.visitField(ACC_PRIVATE, "f4", "Ljava/lang/String;", null, null); 50{ 51av0 = fv.visitAnnotation("Lcom/sleepycat/persist/model/SecondaryKey;", true); 52av0.visitEnum("relate", "Lcom/sleepycat/persist/model/Relationship;", "MANY_TO_ONE"); 53av0.visitEnd(); 54} 55fv.visitEnd(); 56} 57{ 58fv = cw.visitField(ACC_PRIVATE, "f5", "I", null, null); 59fv.visitEnd(); 60} 61{ 62fv = cw.visitField(ACC_PRIVATE, "f6", "Ljava/lang/String;", null, null); 63fv.visitEnd(); 64} 65{ 66fv = cw.visitField(ACC_PRIVATE, "f7", "Ljava/lang/String;", null, null); 67fv.visitEnd(); 68} 69{ 70mv = cw.visitMethod(0, "<init>", "()V", null, null); 71mv.visitCode(); 72mv.visitVarInsn(ALOAD, 0); 73mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V"); 74mv.visitInsn(RETURN); 75mv.visitMaxs(1, 1); 76mv.visitEnd(); 77} 78cw.visitEnd(); 79 80return cw.toByteArray(); 81} 82} 83