public final class ConstantMethodHandleInfo extends CPInfo
ConstantMethodHandleInfo
denotes a CONSTANT_MethodHandle_info structure in the constant_pool of a ClassFile structure.
The CONSTANT_MethodHandle_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_MethodHandle_info structure.
|
static int |
REF_GET_FIELD
An
int denoting REF_getField. |
static int |
REF_GET_STATIC
An
int denoting REF_getStatic. |
static int |
REF_INVOKE_INTERFACE
An
int denoting REF_invokeInterface. |
static int |
REF_INVOKE_SPECIAL
An
int denoting REF_invokeSpecial. |
static int |
REF_INVOKE_STATIC
An
int denoting REF_invokeStatic. |
static int |
REF_INVOKE_VIRTUAL
An
int denoting REF_invokeVirtual. |
static int |
REF_NEW_INVOKE_SPECIAL
An
int denoting REF_newInvokeSpecial. |
static int |
REF_PUT_FIELD
An
int denoting REF_putField. |
static int |
REF_PUT_STATIC
An
int denoting REF_putStatic. |
static int |
TAG
The tag for CONSTANT_MethodHandle.
|
Modifier and Type | Method and Description |
---|---|
ConstantMethodHandleInfo |
copy()
Returns a copy of this
ConstantMethodHandleInfo instance. |
boolean |
equals(java.lang.Object object)
Returns
true if, and only if, object is an instance of ConstantMethodHandleInfo , and that ConstantMethodHandleInfo instance is equal to this ConstantMethodHandleInfo instance,
false otherwise. |
static java.util.List<ConstantMethodHandleInfo> |
filter(Node node)
Returns a
List with all ConstantMethodHandleInfo s. |
int |
getReferenceIndex()
Returns the reference_index of this
ConstantMethodHandleInfo instance. |
int |
getReferenceKind()
Returns the reference_kind of this
ConstantMethodHandleInfo instance. |
int |
hashCode()
Returns a hash code for this
ConstantMethodHandleInfo instance. |
static ConstantMethodHandleInfo |
newInstance(int referenceKind,
int referenceIndex)
Returns a new
ConstantMethodHandleInfo . |
void |
setReferenceIndex(int referenceIndex)
Sets a new reference_index for this
ConstantMethodHandleInfo instance. |
void |
setReferenceKind(int referenceKind)
Sets a new reference_kind for this
ConstantMethodHandleInfo instance. |
java.lang.String |
toString()
Returns a
String representation of this ConstantMethodHandleInfo instance. |
void |
write(java.io.DataOutput dataOutput)
Writes this
ConstantMethodHandleInfo to dataOutput . |
void |
write(Document document)
Writes this
ConstantMethodHandleInfo to document . |
getConstantPoolEntryCount, getName, getTag
public static final java.lang.String NAME
public static final int REF_GET_FIELD
int
denoting REF_getField.public static final int REF_GET_STATIC
int
denoting REF_getStatic.public static final int REF_INVOKE_INTERFACE
int
denoting REF_invokeInterface.public static final int REF_INVOKE_SPECIAL
int
denoting REF_invokeSpecial.public static final int REF_INVOKE_STATIC
int
denoting REF_invokeStatic.public static final int REF_INVOKE_VIRTUAL
int
denoting REF_invokeVirtual.public static final int REF_NEW_INVOKE_SPECIAL
int
denoting REF_newInvokeSpecial.public static final int REF_PUT_FIELD
int
denoting REF_putField.public static final int REF_PUT_STATIC
int
denoting REF_putStatic.public static final int TAG
public ConstantMethodHandleInfo copy()
ConstantMethodHandleInfo
instance.public java.lang.String toString()
String
representation of this ConstantMethodHandleInfo
instance.toString
in class java.lang.Object
String
representation of this ConstantMethodHandleInfo
instancepublic boolean equals(java.lang.Object object)
true
if, and only if, object
is an instance of ConstantMethodHandleInfo
, and that ConstantMethodHandleInfo
instance is equal to this ConstantMethodHandleInfo
instance,
false
otherwise.equals
in class java.lang.Object
object
- an Object
to compare to this ConstantMethodHandleInfo
instance for equalitytrue
if, and only if, object
is an instance of ConstantMethodHandleInfo
, and that ConstantMethodHandleInfo
instance is equal to this ConstantMethodHandleInfo
instance,
false
otherwisepublic int getReferenceIndex()
ConstantMethodHandleInfo
instance.ConstantMethodHandleInfo
instancepublic int getReferenceKind()
ConstantMethodHandleInfo
instance.ConstantMethodHandleInfo
instancepublic int hashCode()
ConstantMethodHandleInfo
instance.hashCode
in class java.lang.Object
ConstantMethodHandleInfo
instancepublic void setReferenceIndex(int referenceIndex)
ConstantMethodHandleInfo
instance.
If referenceIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
referenceIndex
- the new reference_index for this ConstantMethodHandleInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, referenceIndex
is less than or equal to 0
public void setReferenceKind(int referenceKind)
ConstantMethodHandleInfo
instance.
If referenceKind
is less than 0
, an IllegalArgumentException
will be thrown.
referenceKind
- the new reference_kind for this ConstantMethodHandleInfo
instancejava.lang.IllegalArgumentException
- thrown if, and only if, referenceKind
is less than 0
public void write(java.io.DataOutput dataOutput)
ConstantMethodHandleInfo
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)
ConstantMethodHandleInfo
to document
.
If document
is null
, a NullPointerException
may be thrown. But no guarantees can be made.
public static ConstantMethodHandleInfo newInstance(int referenceKind, int referenceIndex)
ConstantMethodHandleInfo
.
If referenceKind
is less than 0
, or referenceIndex
is less than or equal to 0
, an IllegalArgumentException
will be thrown.
referenceKind
- the reference_kind for the new ConstantMethodHandleInfo
instancereferenceIndex
- the reference_index for the new ConstantMethodHandleInfo
instanceConstantMethodHandleInfo
java.lang.IllegalArgumentException
- thrown if, and only if, referenceKind
is less than 0
, or referenceIndex
is less than or equal to 0
public static java.util.List<ConstantMethodHandleInfo> filter(Node node)
List
with all ConstantMethodHandleInfo
s.
All ConstantMethodHandleInfo
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 ConstantMethodHandleInfo
sjava.lang.NullPointerException
- thrown if, and only if, node
is null