Top Description Fields Constructors Methods
javassist.bytecode

public Class InnerClassesAttribute

extends AttributeInfo
Class Inheritance
Imports
java.io.DataInputStream, .IOException, java.util.Map

InnerClasses_attribute.

Field Summary

Modifier and TypeField and Description
public static final String
tag

The name of this attribute "InnerClasses".

Inherited from javassist.bytecode.AttributeInfo:
constPoolinfoname

Constructor Summary

AccessConstructor and Description
pack-priv
private
public
InnerClassesAttribute(ConstPool cp)

Constructs an empty InnerClasses attribute.

Method Summary

Modifier and TypeMethod and Description
public int
accessFlags(int nth)

Returns classes[nth].inner_class_access_flags.

public void
append(String
inner_class_info_index
inner
,
String
outer_class_info_index
outer
,
String
inner_name_index
name
,
int
inner_class_access_flags
flags
)

Appends a new entry.

public void
append(int
inner_class_info_index
inner
,
int
outer_class_info_index
outer
,
int
inner_name_index
name
,
int
inner_class_access_flags
flags
)

Appends a new entry.

public AttributeInfo
copy(ConstPool
the constant pool table used by the new copy.
newCp
,
Map<String, String>
pairs of replaced and substituted class names.
classnames
)

Overrides javassist.bytecode.AttributeInfo.copy.

Makes a copy.

public int

Returns:

the index or -1 if not found.
find
(String
the fully-qualified class name separated by dot and $.
name
)

Finds the entry for the given inner class.

public String

Returns:

null or the class name.
innerClass
(int nth)

Returns the class name indicated by classes[nth].inner_class_info_index.

public int
innerClassIndex(int nth)

Returns classes[nth].inner_class_info_index.

public String

Returns:

null or the class name.
innerName
(int nth)

Returns the simple class name indicated by classes[nth].inner_name_index.

public int
innerNameIndex(int nth)

Returns classes[nth].inner_name_index.

public String

Returns:

null or the class name.
outerClass
(int nth)

Returns the class name indicated by classes[nth].outer_class_info_index.

public int
outerClassIndex(int nth)

Returns classes[nth].outer_class_info_index.

public int

Returns:

the number of items after the removal.
remove
(int
0, 1, 2, ...
nth
)

Removes the nth entry.

public void
setAccessFlags(int nth, int flags)

Sets classes[nth].inner_class_access_flags to the given index.

public void
setInnerClassIndex(int nth, int index)

Sets classes[nth].inner_class_info_index to the given index.

public void
setInnerNameIndex(int nth, int index)

Sets classes[nth].inner_name_index to the given index.

public void
setOuterClassIndex(int nth, int index)

Sets classes[nth].outer_class_info_index to the given index.

public int
tableLength()

Returns number_of_classes.

Inherited from javassist.bytecode.AttributeInfo:
copyAllgetgetConstPoolgetLengthgetNamegetRefClassesgetRefClasseslengthlookupreadremoverenameClassrenameClassrenameClassrenameClasssetwritewriteAll

Field Detail

tagback to summary
public static final String tag

The name of this attribute "InnerClasses".

Constructor Detail

InnerClassesAttributeback to summary
pack-priv InnerClassesAttribute(ConstPool cp, int n, DataInputStream in) throws IOException
InnerClassesAttributeback to summary
private InnerClassesAttribute(ConstPool cp, byte[] info)
InnerClassesAttributeback to summary
public InnerClassesAttribute(ConstPool cp)

Constructs an empty InnerClasses attribute.

See Also
append(String, String, String, int)

Method Detail

accessFlagsback to summary
public int accessFlags(int nth)

Returns classes[nth].inner_class_access_flags.

appendback to summary
public void append(String inner, String outer, String name, int flags)

Appends a new entry.

Parameters
inner:String

inner_class_info_index

outer:String

outer_class_info_index

name:String

inner_name_index

flags:int

inner_class_access_flags

appendback to summary
public void append(int inner, int outer, int name, int flags)

Appends a new entry.

Parameters
inner:int

inner_class_info_index

outer:int

outer_class_info_index

name:int

inner_name_index

flags:int

inner_class_access_flags

copyback to summary
public AttributeInfo copy(ConstPool newCp, Map<String, String> classnames)

Overrides javassist.bytecode.AttributeInfo.copy.

Makes a copy. Class names are replaced according to the given Map object.

Parameters
newCp:ConstPool

the constant pool table used by the new copy.

classnames:Map<String, String>

pairs of replaced and substituted class names.

Annotations
@Override
findback to summary
public int find(String name)

Finds the entry for the given inner class.

Parameters
name:String

the fully-qualified class name separated by dot and $.

Returns:int

the index or -1 if not found.

Since
3.22
innerClassback to summary
public String innerClass(int nth)

Returns the class name indicated by classes[nth].inner_class_info_index. The class name is fully-qualified and separated by dot.

Returns:String

null or the class name.

See Also
ConstPool#getClassInfo(int)
innerClassIndexback to summary
public int innerClassIndex(int nth)

Returns classes[nth].inner_class_info_index.

innerNameback to summary
public String innerName(int nth)

Returns the simple class name indicated by classes[nth].inner_name_index.

Returns:String

null or the class name.

innerNameIndexback to summary
public int innerNameIndex(int nth)

Returns classes[nth].inner_name_index.

outerClassback to summary
public String outerClass(int nth)

Returns the class name indicated by classes[nth].outer_class_info_index.

Returns:String

null or the class name.

outerClassIndexback to summary
public int outerClassIndex(int nth)

Returns classes[nth].outer_class_info_index.

removeback to summary
public int remove(int nth)

Removes the nth entry. It does not eliminate constant pool items that the removed entry refers to. ClassFile#compact() should be executed to remove these unnecessary items.

Parameters
nth:int

0, 1, 2, ...

Returns:int

the number of items after the removal.

See Also
ClassFile#compact()
setAccessFlagsback to summary
public void setAccessFlags(int nth, int flags)

Sets classes[nth].inner_class_access_flags to the given index.

setInnerClassIndexback to summary
public void setInnerClassIndex(int nth, int index)

Sets classes[nth].inner_class_info_index to the given index.

setInnerNameIndexback to summary
public void setInnerNameIndex(int nth, int index)

Sets classes[nth].inner_name_index to the given index.

setOuterClassIndexback to summary
public void setOuterClassIndex(int nth, int index)

Sets classes[nth].outer_class_info_index to the given index.

tableLengthback to summary
public int tableLength()

Returns number_of_classes.