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 InnerClasses_attribute extends Attribute_info { 41 private Collection classes = new LinkedList(); 42 43 public InnerClasses_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 classCount = in.readUnsignedShort(); 50 Logger.getLogger(getClass()).debug("Reading " + classCount + " inner class(es) ..."); 51 for (int i=0; i<classCount; i++) { 52 Logger.getLogger(getClass()).debug("Inner class " + i + ":"); 53 classes.add(new InnerClass(this, in)); 54 } 55 } 56 57 public Collection getClasses() { 58 return classes; 59 } 60 61 public String toString() { 62 return "InnerClasses"; 63 } 64 65 public void accept(Visitor visitor) { 66 visitor.visitInnerClasses_attribute(this); 67 } 68 } 69 | Popular Tags |