Top Description Fields Constructors Methods
org.apache.bcel.classfile

public final Class InnerClasses

extends Attribute
implements Iterable<InnerClass>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Arrays, .Iterator, java.util.stream.Stream, org.apache.bcel.Const, org.apache.bcel.util.Args

This class is derived from Attribute and denotes that this class is an Inner class of another. to the source file of this class. It is instantiated from the Attribute.readAttribute() method.
See Also
Attribute

Field Summary

Modifier and TypeField and Description
private static final InnerClass[]
private InnerClass[]
Inherited from org.apache.bcel.classfile.Attribute:
constant_poolEMPTY_ARRAYlengthname_indextag

Constructor Summary

AccessConstructor and Description
public
InnerClasses(final InnerClasses
Source to copy.
c
)

Initialize from another object.

pack-priv
InnerClasses(final int
Index in constant pool to CONSTANT_Utf8
nameIndex
,
final int
Content length in bytes
length
,
final DataInput
Input stream
input
,
final ConstantPool
Array of constants
constantPool
)

Constructs object from input stream.

public
InnerClasses(final int
Index in constant pool to CONSTANT_Utf8
nameIndex
,
final int
Content length in bytes
length
,
final InnerClass[]
array of inner classes attributes
innerClasses
,
final ConstantPool
Array of constants
constantPool
)

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract org.apache.bcel.classfile.Attribute.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
public Attribute

Returns:

deep copy of this attribute
copy
(final ConstantPool
constant pool to save.
constantPool
)

Implements abstract org.apache.bcel.classfile.Attribute.copy.

public void
dump(final DataOutputStream
Output file stream
file
)

Overrides org.apache.bcel.classfile.Attribute.dump.

Dump source file attribute to file stream in binary format.
public InnerClass[]

Returns:

array of inner class "records"
getInnerClasses
()

public Iterator<InnerClass>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public void
setInnerClasses(final InnerClass[]
the array of inner classes
innerClasses
)

public String

Returns:

String representation.
toString
()

Overrides org.apache.bcel.classfile.Attribute.toString.

Returns a string representation of the object.
Inherited from org.apache.bcel.classfile.Attribute:
addAttributeReaderaddAttributeReaderclonegetConstantPoolgetLengthgetNamegetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

Field Detail

EMPTY_INNER_CLASSE_ARRAYback to summary
private static final InnerClass[] EMPTY_INNER_CLASSE_ARRAY

Empty array.

innerClassesback to summary
private InnerClass[] innerClasses

Constructor Detail

InnerClassesback to summary
public InnerClasses(final InnerClasses c)

Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Parameters
c:InnerClasses

Source to copy.

InnerClassesback to summary
pack-priv InnerClasses(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException

Constructs object from input stream.

Parameters
nameIndex:int

Index in constant pool to CONSTANT_Utf8

length:int

Content length in bytes

input:DataInput

Input stream

constantPool:ConstantPool

Array of constants

Exceptions
IOException:
if an I/O error occurs.
InnerClassesback to summary
public InnerClasses(final int nameIndex, final int length, final InnerClass[] innerClasses, final ConstantPool constantPool)
Parameters
nameIndex:int

Index in constant pool to CONSTANT_Utf8

length:int

Content length in bytes

innerClasses:InnerClass[]

array of inner classes attributes

constantPool:ConstantPool

Array of constants

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.classfile.Attribute.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters
v:Visitor

Visitor object

Annotations
@Override
copyback to summary
public Attribute copy(final ConstantPool constantPool)

Implements abstract org.apache.bcel.classfile.Attribute.copy.

Parameters
constantPool:ConstantPool

Doc from org.apache.bcel.classfile.Attribute.copy.

constant pool to save.

Returns:Attribute

deep copy of this attribute

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Overrides org.apache.bcel.classfile.Attribute.dump.

Dump source file attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getInnerClassesback to summary
public InnerClass[] getInnerClasses()
Returns:InnerClass[]

array of inner class "records"

iteratorback to summary
public Iterator<InnerClass> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<InnerClass>

an Iterator.

Annotations
@Override
setInnerClassesback to summary
public void setInnerClasses(final InnerClass[] innerClasses)
Parameters
innerClasses:InnerClass[]

the array of inner classes

toStringback to summary
public String toString()

Overrides org.apache.bcel.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation.

Annotations
@Override