Package javassist.bytecode
Class InnerClassesAttribute
java.lang.Object
javassist.bytecode.AttributeInfo
javassist.bytecode.InnerClassesAttribute
InnerClasses_attribute.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty InnerClasses attribute. -
Method Summary
Modifier and TypeMethodDescriptionintaccessFlags(int nth) Returnsclasses[nth].inner_class_access_flags.voidappend(int inner, int outer, int name, int flags) Appends a new entry.voidAppends a new entry.Makes a copy.intFinds the entry for the given inner class.innerClass(int nth) Returns the class name indicated byclasses[nth].inner_class_info_index.intinnerClassIndex(int nth) Returnsclasses[nth].inner_class_info_index.innerName(int nth) Returns the simple class name indicated byclasses[nth].inner_name_index.intinnerNameIndex(int nth) Returnsclasses[nth].inner_name_index.outerClass(int nth) Returns the class name indicated byclasses[nth].outer_class_info_index.intouterClassIndex(int nth) Returnsclasses[nth].outer_class_info_index.intremove(int nth) Removes thenthentry.voidsetAccessFlags(int nth, int flags) Setsclasses[nth].inner_class_access_flagsto the given index.voidsetInnerClassIndex(int nth, int index) Setsclasses[nth].inner_class_info_indexto the given index.voidsetInnerNameIndex(int nth, int index) Setsclasses[nth].inner_name_indexto the given index.voidsetOuterClassIndex(int nth, int index) Setsclasses[nth].outer_class_info_indexto the given index.intReturnsnumber_of_classes.Methods inherited from class javassist.bytecode.AttributeInfo
get, getConstPool, getName, length, set
-
Field Details
-
tag
The name of this attribute"InnerClasses".- See Also:
-
-
Constructor Details
-
InnerClassesAttribute
Constructs an empty InnerClasses attribute.- See Also:
-
-
Method Details
-
tableLength
public int tableLength()Returnsnumber_of_classes. -
innerClassIndex
public int innerClassIndex(int nth) Returnsclasses[nth].inner_class_info_index. -
innerClass
Returns the class name indicated byclasses[nth].inner_class_info_index. The class name is fully-qualified and separated by dot.- Returns:
- null or the class name.
- See Also:
-
setInnerClassIndex
public void setInnerClassIndex(int nth, int index) Setsclasses[nth].inner_class_info_indexto the given index. -
outerClassIndex
public int outerClassIndex(int nth) Returnsclasses[nth].outer_class_info_index. -
outerClass
Returns the class name indicated byclasses[nth].outer_class_info_index.- Returns:
- null or the class name.
-
setOuterClassIndex
public void setOuterClassIndex(int nth, int index) Setsclasses[nth].outer_class_info_indexto the given index. -
innerNameIndex
public int innerNameIndex(int nth) Returnsclasses[nth].inner_name_index. -
innerName
Returns the simple class name indicated byclasses[nth].inner_name_index.- Returns:
- null or the class name.
-
setInnerNameIndex
public void setInnerNameIndex(int nth, int index) Setsclasses[nth].inner_name_indexto the given index. -
accessFlags
public int accessFlags(int nth) Returnsclasses[nth].inner_class_access_flags. -
setAccessFlags
public void setAccessFlags(int nth, int flags) Setsclasses[nth].inner_class_access_flagsto the given index. -
find
Finds the entry for the given inner class.- Parameters:
name- the fully-qualified class name separated by dot and $.- Returns:
- the index or -1 if not found.
- Since:
- 3.22
-
append
Appends a new entry.- Parameters:
inner-inner_class_info_indexouter-outer_class_info_indexname-inner_name_indexflags-inner_class_access_flags
-
append
public void append(int inner, int outer, int name, int flags) Appends a new entry.- Parameters:
inner-inner_class_info_indexouter-outer_class_info_indexname-inner_name_indexflags-inner_class_access_flags
-
remove
public int remove(int nth) Removes thenthentry. 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- 0, 1, 2, ...- Returns:
- the number of items after the removal.
- See Also:
-
copy
Makes a copy. Class names are replaced according to the givenMapobject.- Overrides:
copyin classAttributeInfo- Parameters:
newCp- the constant pool table used by the new copy.classnames- pairs of replaced and substituted class names.
-