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

public final Class NestMembers

extends Attribute
Class Inheritance
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Arrays, org.apache.bcel.Const, org.apache.bcel.util.Args, org.apache.commons.lang3.ArrayUtils

This class is derived from Attribute and records the classes and interfaces that are authorized to claim membership in the nest hosted by the current class or interface. There may be at most one NestMembers attribute in a ClassFile structure.
See Also
Attribute

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
NestMembers(final int
Index in constant pool
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
NestMembers(final int
Index in constant pool
nameIndex
,
final int
Content length in bytes
length
,
final int[]
Table of indices in constant pool
classes
,
final ConstantPool
Array of constants
constantPool
)

public
NestMembers(final NestMembers
Source to copy.
c
)

Initialize from another object.

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 NestMembers attribute to file stream in binary format.
public int[]

Returns:

array of indices into constant pool of class names.
getClasses
()

public String[]

Returns:

string array of class names
getClassNames
()

public int

Returns:

Length of classes table.
getNumberClasses
()

public void
setClasses(final int[]
the list of class indexes Also redefines number_of_classes according to table length.
classes
)

public String

Returns:

String representation, i.e., a list of classes.
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

classesback to summary
private int[] classes

Constructor Detail

NestMembersback to summary
pack-priv NestMembers(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

length:int

Content length in bytes

input:DataInput

Input stream

constantPool:ConstantPool

Array of constants

Exceptions
IOException:
if an I/O error occurs.
NestMembersback to summary
public NestMembers(final int nameIndex, final int length, final int[] classes, final ConstantPool constantPool)
Parameters
nameIndex:int

Index in constant pool

length:int

Content length in bytes

classes:int[]

Table of indices in constant pool

constantPool:ConstantPool

Array of constants

NestMembersback to summary
public NestMembers(final NestMembers c)

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

Parameters
c:NestMembers

Source to copy.

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 NestMembers attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getClassesback to summary
public int[] getClasses()
Returns:int[]

array of indices into constant pool of class names.

getClassNamesback to summary
public String[] getClassNames()
Returns:String[]

string array of class names

getNumberClassesback to summary
public int getNumberClasses()
Returns:int

Length of classes table.

setClassesback to summary
public void setClasses(final int[] classes)
Parameters
classes:int[]

the list of class indexes Also redefines number_of_classes according to table length.

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, i.e., a list of classes.

Annotations
@Override