Package org.apache.bcel.classfile
Class BootstrapMethod
- java.lang.Object
-
- org.apache.bcel.classfile.BootstrapMethod
-
- All Implemented Interfaces:
java.lang.Cloneable
public class BootstrapMethod extends java.lang.Object implements java.lang.CloneableThis class represents a bootstrap method attribute, that is, the bootstrap method ref, the number of bootstrap arguments and an array of the bootstrap arguments.- Since:
- 6.0
- See Also:
- The class File Format : The BootstrapMethods Attribute
-
-
Field Summary
Fields Modifier and Type Field Description private int[]bootstrapArgumentsArray of references to the constant_pool tableprivate intbootstrapMethodRefIndex of the CONSTANT_MethodHandle_info structure in the constant_pool table(package private) static BootstrapMethod[]EMPTY_ARRAY
-
Constructor Summary
Constructors Modifier Constructor Description privateBootstrapMethod(int bootstrapMethodRef, int numBootstrapArguments)BootstrapMethod(int bootstrapMethodRef, int[] bootstrapArguments)Constructs a BootstrapMethod.(package private)BootstrapMethod(java.io.DataInput input)Constructs object from input stream.BootstrapMethod(BootstrapMethod c)Initialize from another object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BootstrapMethodcopy()Creates a deep copy of this object.voiddump(java.io.DataOutputStream file)Dumps object to file stream in binary format.int[]getBootstrapArguments()Gets the bootstrap arguments.intgetBootstrapMethodRef()Gets the bootstrap method reference.intgetNumBootstrapArguments()Gets the count of number of bootstrap arguments.voidsetBootstrapArguments(int[] bootstrapArguments)Sets the bootstrap arguments.voidsetBootstrapMethodRef(int bootstrapMethodRef)Sets the bootstrap method reference.java.lang.StringtoString()Gets a string representation.java.lang.StringtoString(ConstantPool constantPool)Gets a resolved string representation.
-
-
-
Field Detail
-
EMPTY_ARRAY
static final BootstrapMethod[] EMPTY_ARRAY
-
bootstrapMethodRef
private int bootstrapMethodRef
Index of the CONSTANT_MethodHandle_info structure in the constant_pool table
-
bootstrapArguments
private int[] bootstrapArguments
Array of references to the constant_pool table
-
-
Constructor Detail
-
BootstrapMethod
public BootstrapMethod(BootstrapMethod c)
Initialize from another object.- Parameters:
c- Source to copy.
-
BootstrapMethod
BootstrapMethod(java.io.DataInput input) throws java.io.IOExceptionConstructs object from input stream.- Parameters:
input- Input stream.- Throws:
java.io.IOException- if an I/O error occurs.
-
BootstrapMethod
private BootstrapMethod(int bootstrapMethodRef, int numBootstrapArguments)
-
BootstrapMethod
public BootstrapMethod(int bootstrapMethodRef, int[] bootstrapArguments)Constructs a BootstrapMethod.- Parameters:
bootstrapMethodRef- int index into constant_pool of CONSTANT_MethodHandle.bootstrapArguments- int[] indices into constant_pool of CONSTANT_[type]_info.
-
-
Method Detail
-
copy
public BootstrapMethod copy()
Creates a deep copy of this object.- Returns:
- deep copy of this object.
-
dump
public final void dump(java.io.DataOutputStream file) throws java.io.IOExceptionDumps object to file stream in binary format.- Parameters:
file- Output file stream.- Throws:
java.io.IOException- if an I/O error occurs.
-
getBootstrapArguments
public int[] getBootstrapArguments()
Gets the bootstrap arguments.- Returns:
- int[] of bootstrap_method indices into constant_pool of CONSTANT_[type]_info.
-
getBootstrapMethodRef
public int getBootstrapMethodRef()
Gets the bootstrap method reference.- Returns:
- index into constant_pool of bootstrap_method.
-
getNumBootstrapArguments
public int getNumBootstrapArguments()
Gets the count of number of bootstrap arguments.- Returns:
- count of number of bootstrap arguments.
-
setBootstrapArguments
public void setBootstrapArguments(int[] bootstrapArguments)
Sets the bootstrap arguments.- Parameters:
bootstrapArguments- int[] indices into constant_pool of CONSTANT_[type]_info.
-
setBootstrapMethodRef
public void setBootstrapMethodRef(int bootstrapMethodRef)
Sets the bootstrap method reference.- Parameters:
bootstrapMethodRef- int index into constant_pool of CONSTANT_MethodHandle.
-
toString
public final java.lang.String toString()
Gets a string representation.- Overrides:
toStringin classjava.lang.Object- Returns:
- String representation.
-
toString
public final java.lang.String toString(ConstantPool constantPool)
Gets a resolved string representation.- Parameters:
constantPool- the constant pool.- Returns:
- Resolved string representation.
-
-