public final class ConstantInvokeDynamicInfo extends CPInfo
ConstantInvokeDynamicInfo
denotes a CONSTANT_InvokeDynamic_info structure in the constant_pool of a ClassFile structure.
The CONSTANT_InvokeDynamic_info structure was added to Java in version 7.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the CONSTANT_InvokeDynamic_info structure.
|
static int |
TAG
The tag for CONSTANT_InvokeDynamic.
|
Modifier and Type | Method and Description |
---|---|
ConstantInvokeDynamicInfo |
copy()
Returns a copy of this
ConstantInvokeDynamicInfo instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ConstantInvokeDynamicInfo , and that ConstantInvokeDynamicInfo instance is equal to this ConstantInvokeDynamicInfo
instance, false otherwise. |
static java.util.List<ConstantInvokeDynamicInfo> |
filter(Node node)
Returns a
List with all ConstantInvokeDynamicInfo s. |
int |
getBootstrapMethodAttrIndex()
Returns the bootstrap_method_attr_index of this
ConstantInvokeDynamicInfo instance. |
int |
getNameAndTypeIndex()
Returns the name_and_type_index of this
ConstantInvokeDynamicInfo instance. |
int |
hashCode()
Returns a hash code for this
ConstantInvokeDynamicInfo instance. |
static ConstantInvokeDynamicInfo |
newInstance(int bootstrapMethodAttrIndex,
int nameAndTypeIndex)
Returns a new
ConstantInvokeDynamicInfo . |
void |
setBootstrapMethodAttrIndex(int bootstrapMethodAttrIndex)
Sets a new bootstrap_method_attr_index for this
ConstantInvokeDynamicInfo instance. |
void |
setNameAndTypeIndex(int nameAndTypeIndex)
Sets a new name_and_type_index for this
ConstantInvokeDynamicInfo instance. |
java.lang.String |
toString()
Returns a
String representation of this ConstantInvokeDynamicInfo instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ConstantInvokeDynamicInfo to dataOutput . |
void |
write(Document document)
Writes this
ConstantInvokeDynamicInfo to document . |
getConstantPoolEntryCount, getName, getTag
public static final java.lang.String NAME
public static final int TAG
public ConstantInvokeDynamicInfo copy()
ConstantInvokeDynamicInfo
instance.public java.lang.String toString()
String
representation of this ConstantInvokeDynamicInfo
instance.toString
in class java.lang.Object
String
representation of this ConstantInvokeDynamicInfo
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ConstantInvokeDynamicInfo
, and that ConstantInvokeDynamicInfo
instance is equal to this ConstantInvokeDynamicInfo
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ConstantInvokeDynamicInfo
instance for equalitytrue
if, and only if, object
is an instance of ConstantInvokeDynamicInfo
, and that ConstantInvokeDynamicInfo
instance is equal to this ConstantInvokeDynamicInfo
instance, false
otherwisepublic int getBootstrapMethodAttrIndex()
ConstantInvokeDynamicInfo
instance.ConstantInvokeDynamicInfo
instancepublic int getNameAndTypeIndex()
ConstantInvokeDynamicInfo
instance.ConstantInvokeDynamicInfo
instancepublic int hashCode()
ConstantInvokeDynamicInfo
instance.hashCode
in class java.lang.Object
ConstantInvokeDynamicInfo
instancepublic void setBootstrapMethodAttrIndex(int bootstrapMethodAttrIndex)
ConstantInvokeDynamicInfo
instance.
If bootstrapMethodAttrIndex
is less than 0
, an IllegalArgumentException
will be thrown.
bootstrapMethodAttrIndex
- the new bootstrap_method_attr_index for this ConstantInvokeDynamicInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, bootstrapMethodAttrIndex
is less than 0
public void setNameAndTypeIndex(int nameAndTypeIndex)
ConstantInvokeDynamicInfo
instance.
If nameAndTypeIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
nameAndTypeIndex
- the new name_and_type_index for this ConstantInvokeDynamicInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, nameAndTypeIndex
is less than or equal to 0
public void write(java.io.DataOutput dataOutput)
ConstantInvokeDynamicInfo
to dataOutput
.
If dataOutput
is an OutputStream
(or any other type of stream), this method will not close it.
If dataOutput
is null
, a NullPointerException
will be thrown.
If an I/O-error occurs, an UncheckedIOException
will be thrown.
public void write(Document document)
ConstantInvokeDynamicInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
public static ConstantInvokeDynamicInfo newInstance(int bootstrapMethodAttrIndex, int nameAndTypeIndex)
ConstantInvokeDynamicInfo
.
If bootstrapMethodAttrIndex
is less than 0
, or nameAndTypeIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
bootstrapMethodAttrIndex
- the bootstrap_method_attr_index of the new ConstantInvokeDynamicInfo
instancenameAndTypeIndex
- the name_and_type_index of the new ConstantInvokeDynamicInfo
instanceConstantInvokeDynamicInfo
java.lang.IllegalArgumentException
- thrown if, and only if, bootstrapMethodAttrIndex
is less than 0
, or nameAndTypeIndex
is less than or equal to 0
public static java.util.List<ConstantInvokeDynamicInfo> filter(Node node)
List
with all ConstantInvokeDynamicInfo
s.
All ConstantInvokeDynamicInfo
s are found by traversing node
using a simple NodeHierarchicalVisitor
implementation.
If node
is null
, a NullPointerException
will be thrown.
node
- the Node
to start traversal fromList
with all ConstantInvokeDynamicInfo
sjava.lang.NullPointerException
- thrown if, and only if, node
is null