OfMethod
interface OfMethod<F : TypeDescriptor.OfField<F>!, M : TypeDescriptor.OfMethod<F, M>!> : TypeDescriptor
Known Direct Subclasses
MethodType |
A method type represents the arguments and return type accepted and returned by a method handle, or the arguments and return type passed and expected by a method handle caller.
|
|
An entity that has a method type descriptor Method descriptors conforming to JVMS {@jvms 4.3.3} can be described
Summary
Public methods |
abstract M |
Return a method descriptor that is identical to this one, except that a single parameter type has been changed to the specified type.
|
abstract M |
Return a method descriptor that is identical to this one, except that the return type has been changed to the specified type
|
abstract M |
Return a method descriptor that is identical to this one, except that a range of parameter types have been removed.
|
abstract M |
Return a method descriptor that is identical to this one, except that a range of additional parameter types have been inserted.
|
abstract Array<F>! |
Return an array of field descriptors for the parameter types of the method type described by this descriptor
|
abstract Int |
Return the number of parameters in the method type
|
abstract MutableList<F>! |
Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor
|
abstract F |
Return a field descriptor describing the requested parameter of the method type described by this descriptor
|
abstract F |
Return a field descriptor describing the return type of the method type described by this descriptor
|
Inherited functions |
From class TypeDescriptor
String! |
descriptorString()
Returns the descriptor string for this TypeDescriptor object. If this TypeDescriptor object can be described in nominal form, then this method returns a type descriptor as specified in JVMS {@jvms 4.3}. The result descriptor string can be used to produce a java.lang.constant.ConstantDesc nominal descriptor . Otherwise, the result string is not a type descriptor. No java.lang.constant.ConstantDesc nominal descriptor can be produced from the result string.
|
|
Public methods
changeParameterType
abstract fun changeParameterType(
index: Int,
paramType: F
): M
Return a method descriptor that is identical to this one, except that a single parameter type has been changed to the specified type.
Parameters |
index |
Int: the index of the parameter to change |
paramType |
F: a field descriptor describing the new parameter type |
Return |
M |
the new method descriptor |
Exceptions |
java.lang.NullPointerException |
if any argument is null |
java.lang.IndexOutOfBoundsException |
if the index is outside the half-open range {[0, parameterCount)} |
changeReturnType
abstract fun changeReturnType(newReturn: F): M
Return a method descriptor that is identical to this one, except that the return type has been changed to the specified type
Parameters |
newReturn |
F: a field descriptor for the new return type |
Return |
M |
the new method descriptor |
Exceptions |
java.lang.NullPointerException |
if any argument is null |
dropParameterTypes
abstract fun dropParameterTypes(
start: Int,
end: Int
): M
Return a method descriptor that is identical to this one, except that a range of parameter types have been removed.
Parameters |
start |
Int: the index of the first parameter to remove |
end |
Int: the index after the last parameter to remove |
Return |
M |
the new method descriptor |
Exceptions |
java.lang.IndexOutOfBoundsException |
if start is outside the half-open range [0, parameterCount) , or end is outside the closed range [0, parameterCount] , or if start > end |
insertParameterTypes
abstract fun insertParameterTypes(
pos: Int,
vararg paramTypes: F
): M
Return a method descriptor that is identical to this one, except that a range of additional parameter types have been inserted.
Parameters |
pos |
Int: the index at which to insert the first inserted parameter |
paramTypes |
F: field descriptors describing the new parameter types to insert |
Return |
M |
the new method descriptor |
Exceptions |
java.lang.NullPointerException |
if any argument is null |
java.lang.IndexOutOfBoundsException |
if pos is outside the closed range {[0, parameterCount]} |
parameterArray
abstract fun parameterArray(): Array<F>!
Return an array of field descriptors for the parameter types of the method type described by this descriptor
Return |
Array<F>! |
field descriptors for the parameter types |
parameterCount
abstract fun parameterCount(): Int
Return the number of parameters in the method type
Return |
Int |
the number of parameters |
parameterList
abstract fun parameterList(): MutableList<F>!
Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor
Return |
MutableList<F>! |
field descriptors for the parameter types |
parameterType
abstract fun parameterType(i: Int): F
Return a field descriptor describing the requested parameter of the method type described by this descriptor
Parameters |
i |
Int: the index of the parameter |
Return |
F |
a field descriptor for the requested parameter type |
Exceptions |
java.lang.IndexOutOfBoundsException |
if the index is outside the half-open range {[0, parameterCount)} |
returnType
abstract fun returnType(): F
Return a field descriptor describing the return type of the method type described by this descriptor
Return |
F |
a field descriptor for the return type |