Package org.apache.bcel.classfile
Class InnerClass
- java.lang.Object
-
- org.apache.bcel.classfile.InnerClass
-
- All Implemented Interfaces:
java.lang.Cloneable
,Node
public final class InnerClass extends java.lang.Object implements java.lang.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:
InnerClasses
-
-
Constructor Summary
Constructors Constructor Description InnerClass(int innerClassIndex, int outerClassIndex, int innerNameIndex, int innerAccessFlags)
InnerClass(InnerClass c)
Initialize from another object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.InnerClass
copy()
void
dump(java.io.DataOutputStream file)
Dump inner class attribute to file stream in binary format.int
getInnerAccessFlags()
int
getInnerClassIndex()
int
getInnerNameIndex()
int
getOuterClassIndex()
void
setInnerAccessFlags(int innerAccessFlags)
void
setInnerClassIndex(int innerClassIndex)
void
setInnerNameIndex(int innerNameIndex)
void
setOuterClassIndex(int outerClassIndex)
java.lang.String
toString()
java.lang.String
toString(ConstantPool constantPool)
-
-
-
Constructor Detail
-
InnerClass
public InnerClass(InnerClass c)
Initialize from another object.
-
InnerClass
public InnerClass(int innerClassIndex, int outerClassIndex, int innerNameIndex, int innerAccessFlags)
- Parameters:
innerClassIndex
- Class index in constant pool of inner classouterClassIndex
- Class index in constant pool of outer classinnerNameIndex
- Name index in constant pool of inner classinnerAccessFlags
- Access flags of inner class
-
-
Method Detail
-
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.
-
dump
public void dump(java.io.DataOutputStream file) throws java.io.IOException
Dump inner class attribute to file stream in binary format.- Parameters:
file
- Output file stream- Throws:
java.io.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 innerAccessFlags)
- Parameters:
innerAccessFlags
- access flags for this inner class
-
setInnerClassIndex
public void setInnerClassIndex(int innerClassIndex)
- Parameters:
innerClassIndex
- index into the constant pool for this class
-
setInnerNameIndex
public void setInnerNameIndex(int innerNameIndex)
- Parameters:
innerNameIndex
- index into the constant pool for this class's name
-
setOuterClassIndex
public void setOuterClassIndex(int outerClassIndex)
- Parameters:
outerClassIndex
- index into the constant pool for the owning class
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation.
-
toString
public java.lang.String toString(ConstantPool constantPool)
- Returns:
- Resolved string representation
-
copy
public InnerClass copy()
- Returns:
- deep copy of this object
-
-