1 7 package org.gjt.jclasslib.structures.attributes; 8 9 import org.gjt.jclasslib.structures.AttributeInfo; 10 import org.gjt.jclasslib.structures.InvalidByteCodeException; 11 import org.gjt.jclasslib.structures.elementvalues.ElementValue; 12 13 import java.io.*; 14 15 21 public class AnnotationDefaultAttribute extends AttributeInfo { 22 25 public static final String ATTRIBUTE_NAME = "AnnotationDefault"; 26 27 private ElementValue defaultValue; 28 29 34 public ElementValue getDefaultValue() { 35 return this.defaultValue; 36 } 37 38 43 public void setDefaultValue(ElementValue defaultValue) { 44 this.defaultValue = defaultValue; 45 } 46 47 public void read(DataInput in) 48 throws InvalidByteCodeException, IOException { 49 super.read(in); 50 51 defaultValue = ElementValue.create(in, classFile); 52 53 if (debug) debug("read "); 54 } 55 56 public void write(DataOutput out) 57 throws InvalidByteCodeException, IOException { 58 super.write(out); 59 60 defaultValue.write(out); 61 62 if (debug) debug("wrote "); 63 } 64 65 public int getAttributeLength() { 66 return defaultValue.getLength(); 67 } 68 69 protected void debug(String message) { 70 super.debug(message + "AnnotationDefaultAttribute"); 71 } 72 } 73 | Popular Tags |