APIdia Launch Partner
Top Description Methods
java.lang.classfile.constantpool

public sealed Interface MethodTypeEntry

extends LoadableConstantEntry
permits MethodTypeEntryImpl
Known Direct Implementers
jdk.internal.classfile.impl.AbstractPoolEntry.MethodTypeEntryImpl
Imports
java.lang.constant.ConstantDesc, .MethodTypeDesc, jdk.internal.classfile.impl.AbstractPoolEntry

Models a CONSTANT_MethodType_info structure, or a symbolic reference to a method type, in the constant pool of a class file.

The use of a MethodTypeEntry is modeled by a MethodTypeDesc. Conversions are through ConstantPoolBuilder#methodTypeEntry(MethodTypeDesc) and asSymbol().

A method type entry is composite:

MethodTypeEntry(Utf8Entry descriptor)
MethodTypeEntry(Utf8Entry descriptor)
where descriptor is a method descriptor string.
Since
24
Java Virtual Machine Specification
4.4.9 The CONSTANT_MethodType_info Structure

Method Summary

Modifier and TypeMethod and Description
public MethodTypeDesc

Returns:

a symbolic descriptor for the method type
asSymbol
()

Returns a symbolic descriptor for the method type.

public default ConstantDesc
constantValue()

Implements java.lang.classfile.constantpool.LoadableConstantEntry.constantValue.

Returns a symbolic descriptor of this constant.

public Utf8Entry

Returns:

the method descriptor string
descriptor
()

Returns the method descriptor string.

public boolean

Returns:

whether this entry describes the given method type
matches
(MethodTypeDesc
the method type descriptor
desc
)

Returns whether this entry describes the given method type.

Inherited from java.lang.classfile.constantpool.LoadableConstantEntry:
typeKind

Method Detail

asSymbolback to summary
public MethodTypeDesc asSymbol()

Returns a symbolic descriptor for the method type.

API Note

If only symbol equivalence is desired, matches should be used. It requires reduced parsing and can improve class file reading performance.

Returns:MethodTypeDesc

a symbolic descriptor for the method type

constantValueback to summary
public default ConstantDesc constantValue()

Implements java.lang.classfile.constantpool.LoadableConstantEntry.constantValue.

Doc from java.lang.classfile.constantpool.LoadableConstantEntry.constantValue.

Returns a symbolic descriptor of this constant.

This is equivalent to asSymbol().

Annotations
@Override
descriptorback to summary
public Utf8Entry descriptor()

Returns the method descriptor string.

Returns:Utf8Entry

the method descriptor string

matchesback to summary
public boolean matches(MethodTypeDesc desc)

Returns whether this entry describes the given method type.

Parameters
desc:MethodTypeDesc

the method type descriptor

Returns:boolean

whether this entry describes the given method type

Since
25