1 30 31 package oracle.toplink.libraries.asm.attrs; 32 33 import oracle.toplink.libraries.asm.Attribute; 34 import oracle.toplink.libraries.asm.ByteVector; 35 import oracle.toplink.libraries.asm.ClassReader; 36 import oracle.toplink.libraries.asm.ClassWriter; 37 import oracle.toplink.libraries.asm.Label; 38 39 77 78 public class AnnotationDefaultAttribute extends Attribute { 79 87 public Object defaultValue; 88 89 public AnnotationDefaultAttribute () { 90 super("AnnotationDefault"); 91 } 92 93 public AnnotationDefaultAttribute ( Object defaultValue) { 94 this(); 95 this.defaultValue = defaultValue; 96 } 97 98 protected Attribute read (ClassReader cr, int off, 99 int len, char[] buf, int codeOff, Label[] labels) { 100 return new AnnotationDefaultAttribute( Annotation.readValue(cr, new int[] {off}, buf)); 101 } 102 103 protected ByteVector write (ClassWriter cw, byte[] code, 104 int len, int maxStack, int maxLocals) { 105 return Annotation.writeValue( new ByteVector(), defaultValue, cw); 106 } 107 108 113 114 public String toString () { 115 return "default " + defaultValue; 116 } 117 } 118 | Popular Tags |