1 7 package org.gjt.jclasslib.structures.elementvalues; 8 9 import org.gjt.jclasslib.structures.InvalidByteCodeException; 10 11 import java.io.*; 12 13 19 public class ClassElementValue extends ElementValue { 20 21 public final static String ENTRY_NAME = "ClassElement"; 22 23 private static final int LENGTH = 2; 24 private int classInfoIndex; 25 26 protected ClassElementValue() { 27 super(CLASS_TAG); 28 } 29 30 35 public int getClassInfoIndex() { 36 return this.classInfoIndex; 37 } 38 39 44 public void setClassInfoIndex(int classInfoIndex) { 45 this.classInfoIndex = classInfoIndex; 46 } 47 48 protected int getSpecificLength() { 49 return LENGTH; 50 } 51 52 public void read(DataInput in) throws InvalidByteCodeException, IOException { 53 super.read(in); 54 55 classInfoIndex = in.readUnsignedShort(); 56 57 if (debug) debug("read "); 58 } 59 60 public void write(DataOutput out) throws InvalidByteCodeException, IOException { 61 super.write(out); 62 63 out.writeShort(classInfoIndex); 64 65 if (debug) debug("wrote "); 66 } 67 68 protected void debug(String message) { 69 super.debug(message + 70 "ClassElementValue with class_info_index " + 71 classInfoIndex); 72 } 73 74 public String getEntryName() { 75 return ENTRY_NAME; 76 } 77 78 } 79 | Popular Tags |