Package com.tonic.parser.attribute
Class BootstrapMethodsAttribute
- java.lang.Object
-
- com.tonic.parser.attribute.Attribute
-
- com.tonic.parser.attribute.BootstrapMethodsAttribute
-
public class BootstrapMethodsAttribute extends Attribute
The BootstrapMethods attribute: bootstrap method entries for invokedynamic call sites.
-
-
Constructor Summary
Constructors Constructor Description BootstrapMethodsAttribute(ConstPool constPool)Constructor for programmatic creation of a BootstrapMethods attribute.BootstrapMethodsAttribute(String name, ClassFile parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a class.BootstrapMethodsAttribute(String name, MemberEntry parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a member.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBootstrapMethod(int methodHandleIndex, List<Integer> arguments)Adds a bootstrap method entry.List<BootstrapMethod>getBootstrapMethods()voidread(ClassFile classFile, int length)Reads the attribute data from the class file.StringtoString()voidupdateLength()Recomputes the attribute length field from the current in-memory content.
-
-
-
Constructor Detail
-
BootstrapMethodsAttribute
public BootstrapMethodsAttribute(String name, MemberEntry parent, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a member.- Parameters:
name- the attribute nameparent- the member the attribute belongs tonameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
BootstrapMethodsAttribute
public BootstrapMethodsAttribute(String name, ClassFile parent, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a class.- Parameters:
name- the attribute nameparent- the class the attribute belongs tonameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
BootstrapMethodsAttribute
public BootstrapMethodsAttribute(ConstPool constPool)
Constructor for programmatic creation of a BootstrapMethods attribute.- Parameters:
constPool- The constant pool to use for creating the attribute name.
-
-
Method Detail
-
getBootstrapMethods
public List<BootstrapMethod> getBootstrapMethods()
- Returns:
- the bootstrap methods
-
addBootstrapMethod
public void addBootstrapMethod(int methodHandleIndex, List<Integer> arguments)Adds a bootstrap method entry.- Parameters:
methodHandleIndex- The constant pool index of the method handle.arguments- The list of constant pool indices for the bootstrap arguments.
-
read
public void read(ClassFile classFile, int length)
Description copied from class:AttributeReads the attribute data from the class file.
-
updateLength
public void updateLength()
Description copied from class:AttributeRecomputes the attribute length field from the current in-memory content.- Specified by:
updateLengthin classAttribute
-
-