1 32 33 package com.jeantessier.classreader; 34 35 import java.io.*; 36 import java.util.*; 37 38 import org.apache.log4j.*; 39 40 public class LineNumberTable_attribute extends Attribute_info { 41 private Collection lineNumbers = new LinkedList(); 42 43 public LineNumberTable_attribute(Classfile classfile, Visitable owner, DataInputStream in) throws IOException { 44 super(classfile, owner); 45 46 int byteCount = in.readInt(); 47 Logger.getLogger(getClass()).debug("Attribute length: " + byteCount); 48 49 int lineNumberTableLength = in.readUnsignedShort(); 50 Logger.getLogger(getClass()).debug("Reading " + lineNumberTableLength + " line number(s) ..."); 51 for (int i=0; i<lineNumberTableLength; i++) { 52 Logger.getLogger(getClass()).debug("Line number entry " + i + ":"); 53 lineNumbers.add(new LineNumber(this, in)); 54 } 55 } 56 57 public Collection getLineNumbers() { 58 return lineNumbers; 59 } 60 61 public String toString() { 62 return "Line Number Table"; 63 } 64 65 public void accept(Visitor visitor) { 66 visitor.visitLineNumberTable_attribute(this); 67 } 68 } 69 | Popular Tags |