public final class ConstantDynamicInfo extends CPInfo
ConstantDynamicInfo
denotes a CONSTANT_Dynamic_info structure in the constant_pool of a ClassFile structure.
The CONSTANT_Dynamic_info structure was added to Java in version 11.
This class is not thread-safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME
The name of the CONSTANT_Dynamic_info structure.
|
static int |
TAG
The tag for CONSTANT_Dynamic.
|
Modifier and Type | Method and Description |
---|---|
ConstantDynamicInfo |
copy()
Returns a copy of this
ConstantDynamicInfo instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ConstantDynamicInfo , and that ConstantDynamicInfo instance is equal to this ConstantDynamicInfo instance, false otherwise. |
static java.util.List<ConstantDynamicInfo> |
filter(Node node)
Returns a
List with all ConstantDynamicInfo s. |
int |
getBootstrapMethodAttrIndex()
Returns the bootstrap_method_attr_index of this
ConstantDynamicInfo instance. |
int |
getNameAndTypeIndex()
Returns the name_and_type_index of this
ConstantDynamicInfo instance. |
int |
hashCode()
Returns a hash code for this
ConstantDynamicInfo instance. |
static ConstantDynamicInfo |
newInstance(int bootstrapMethodAttrIndex,
int nameAndTypeIndex)
Returns a new
ConstantDynamicInfo . |
void |
setBootstrapMethodAttrIndex(int bootstrapMethodAttrIndex)
Sets a new bootstrap_method_attr_index for this
ConstantDynamicInfo instance. |
void |
setNameAndTypeIndex(int nameAndTypeIndex)
Sets a new name_and_type_index for this
ConstantDynamicInfo instance. |
java.lang.String |
toString()
Returns a
String representation of this ConstantDynamicInfo instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ConstantDynamicInfo to dataOutput . |
void |
write(Document document)
Writes this
ConstantDynamicInfo to document . |
getConstantPoolEntryCount, getName, getTag
public static final java.lang.String NAME
public static final int TAG
public ConstantDynamicInfo copy()
ConstantDynamicInfo
instance.public java.lang.String toString()
String
representation of this ConstantDynamicInfo
instance.toString
in class java.lang.Object
String
representation of this ConstantDynamicInfo
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ConstantDynamicInfo
, and that ConstantDynamicInfo
instance is equal to this ConstantDynamicInfo
instance, false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ConstantDynamicInfo
instance for equalitytrue
if, and only if, object
is an instance of ConstantDynamicInfo
, and that ConstantDynamicInfo
instance is equal to this ConstantDynamicInfo
instance, false
otherwisepublic int getBootstrapMethodAttrIndex()
ConstantDynamicInfo
instance.ConstantDynamicInfo
instancepublic int getNameAndTypeIndex()
ConstantDynamicInfo
instance.ConstantDynamicInfo
instancepublic int hashCode()
ConstantDynamicInfo
instance.hashCode
in class java.lang.Object
ConstantDynamicInfo
instancepublic void setBootstrapMethodAttrIndex(int bootstrapMethodAttrIndex)
ConstantDynamicInfo
instance.
If bootstrapMethodAttrIndex
is less than 0
, an IllegalArgumentException
will be thrown.
bootstrapMethodAttrIndex
- the new bootstrap_method_attr_index for this ConstantDynamicInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, bootstrapMethodAttrIndex
is less than 0
public void setNameAndTypeIndex(int nameAndTypeIndex)
ConstantDynamicInfo
instance.
If nameAndTypeIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
nameAndTypeIndex
- the new name_and_type_index for this ConstantDynamicInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, nameAndTypeIndex
is less than or equal to 0
public void write(java.io.DataOutput dataOutput)
ConstantDynamicInfo
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)
ConstantDynamicInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
public static ConstantDynamicInfo newInstance(int bootstrapMethodAttrIndex, int nameAndTypeIndex)
ConstantDynamicInfo
.
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 ConstantDynamicInfo
instancenameAndTypeIndex
- the name_and_type_index of the new ConstantDynamicInfo
instanceConstantDynamicInfo
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<ConstantDynamicInfo> filter(Node node)
List
with all ConstantDynamicInfo
s.
All ConstantDynamicInfo
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 ConstantDynamicInfo
sjava.lang.NullPointerException
- thrown if, and only if, node
is null