1 7 8 package org.gjt.jclasslib.structures; 9 10 import java.io.*; 11 12 18 public class FieldInfo extends ClassMember { 19 20 29 public static FieldInfo create(DataInput in, ClassFile classFile) 30 throws InvalidByteCodeException, IOException { 31 32 FieldInfo fieldInfo = new FieldInfo(); 33 fieldInfo.setClassFile(classFile); 34 fieldInfo.read(in); 35 36 return fieldInfo; 37 } 38 39 public void read(DataInput in) 40 throws InvalidByteCodeException, IOException { 41 42 super.read(in); 43 44 if (debug) debug("read "); 45 } 46 47 public void write(DataOutput out) 48 throws InvalidByteCodeException, IOException { 49 50 super.write(out); 51 if (debug) debug("wrote "); 52 } 53 54 protected void debug(String message) { 55 super.debug(message + "field with access flags " + printAccessFlags(accessFlags) + 56 ", name_index " + nameIndex + ", descriptor_index " + descriptorIndex + 57 ", " + getLength(attributes) + " attributes"); 58 } 59 60 protected String printAccessFlagsVerbose(int accessFlags) { 61 return printAccessFlagsVerbose(AccessFlags.FIELD_ACCESS_FLAGS, AccessFlags.FIELD_ACCESS_FLAGS_VERBOSE, accessFlags); 62 } 63 64 } 65 | Popular Tags |