Class InnerClass

java.lang.Object
org.apache.bcel.classfile.InnerClass
All Implemented Interfaces:
Cloneable, Node

public final class InnerClass extends Object implements Cloneable, Node
This class represents a inner class attribute, i.e., the class indices of the inner and outer classes, the name and the attributes of the inner class.
See Also:
  • Field Details

    • inner_class_index

      private int inner_class_index
    • outer_class_index

      private int outer_class_index
    • inner_name_index

      private int inner_name_index
    • inner_access_flags

      private int inner_access_flags
  • Constructor Details

    • InnerClass

      public InnerClass(InnerClass c)
      Initialize from another object.
    • InnerClass

      InnerClass(DataInput file) throws IOException
      Construct object from file stream.
      Parameters:
      file - Input stream
      Throws:
      IOException
    • InnerClass

      public InnerClass(int inner_class_index, int outer_class_index, int inner_name_index, int inner_access_flags)
      Parameters:
      inner_class_index - Class index in constant pool of inner class
      outer_class_index - Class index in constant pool of outer class
      inner_name_index - Name index in constant pool of inner class
      inner_access_flags - Access flags of inner class
  • Method Details

    • accept

      public void accept(Visitor v)
      Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
      Specified by:
      accept in interface Node
      Parameters:
      v - Visitor object
    • dump

      public void dump(DataOutputStream file) throws IOException
      Dump inner class attribute to file stream in binary format.
      Parameters:
      file - Output file stream
      Throws:
      IOException
    • getInnerAccessFlags

      public int getInnerAccessFlags()
      Returns:
      access flags of inner class.
    • getInnerClassIndex

      public int getInnerClassIndex()
      Returns:
      class index of inner class.
    • getInnerNameIndex

      public int getInnerNameIndex()
      Returns:
      name index of inner class.
    • getOuterClassIndex

      public int getOuterClassIndex()
      Returns:
      class index of outer class.
    • setInnerAccessFlags

      public void setInnerAccessFlags(int inner_access_flags)
      Parameters:
      inner_access_flags - access flags for this inner class
    • setInnerClassIndex

      public void setInnerClassIndex(int inner_class_index)
      Parameters:
      inner_class_index - index into the constant pool for this class
    • setInnerNameIndex

      public void setInnerNameIndex(int inner_name_index)
      Parameters:
      inner_name_index - index into the constant pool for this class's name
    • setOuterClassIndex

      public void setOuterClassIndex(int outer_class_index)
      Parameters:
      outer_class_index - index into the constant pool for the owning class
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      String representation.
    • toString

      public String toString(ConstantPool constant_pool)
      Returns:
      Resolved string representation
    • copy

      public InnerClass copy()
      Returns:
      deep copy of this object