APIdia Launch Partner
Top Description Inners Methods
java.lang.invoke

public Interface TypeDescriptor

Known Direct Subinterfaces
java.lang.invoke.TypeDescriptor.OfField, java.lang.invoke.TypeDescriptor.OfMethod
Imports
java.util.List

An entity that has a type descriptor.
Since
12

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
TypeDescriptor.OfField<
the class implementing TypeDescriptor.OfField
F extends TypeDescriptor.OfField<F>
>

An entity that has a field type descriptor.

public static interface
TypeDescriptor.OfMethod<
the type representing field type descriptors
F extends TypeDescriptor.OfField<F>
,
the class implementing TypeDescriptor.OfMethod
M extends TypeDescriptor.OfMethod<F, M>
>

An entity that has a method type descriptor Method descriptors conforming to JVMS 4.3.3 can be described nominally via MethodType::describeConstable; otherwise they cannot be described nominally.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the descriptor string for this TypeDescriptor object
descriptorString
()

Returns the descriptor string for this TypeDescriptor object.

Method Detail

descriptorStringback to summary
public 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 4.3. The result descriptor string can be used to produce a nominal descriptor. Otherwise, the result string is not a type descriptor. No nominal descriptor can be produced from the result string.

Returns:String

the descriptor string for this TypeDescriptor object

Java Virtual Machine Specification
4.3.2 Field Descriptors, 4.3.3 Method Descriptors
java.lang.invoke back to summary

public Interface TypeDescriptor.OfField<F extends TypeDescriptor.OfField<F>>

extends TypeDescriptor
Known Direct Subinterfaces
java.lang.constant.ClassDesc
Known Direct Implementers
java.lang.Class
Type Parameters
<F>
the class implementing TypeDescriptor.OfField

An entity that has a field type descriptor. Field descriptors conforming to JVMS 4.3.2 can be described nominally via Class::describeConstable; otherwise they cannot be described nominally.
Since
12
Java Virtual Machine Specification
4.3.2 Field Descriptors

Method Summary

Modifier and TypeMethod and Description
public F

Returns:

the descriptor for the array type
arrayType
()

Return a descriptor for the array type whose component type is described by this descriptor

public F

Returns:

the component type, or null if this field descriptor does not describe an array type
componentType
()

If this field descriptor describes an array type, return a descriptor for its component type, otherwise return null.

public boolean

Returns:

whether this field descriptor describes an array type
isArray
()

Does this field descriptor describe an array type?

public boolean

Returns:

whether this field descriptor describes a primitive type
isPrimitive
()

Does this field descriptor describe a primitive type (including void.)

Inherited from java.lang.invoke.TypeDescriptor:
descriptorString

Method Detail

arrayTypeback to summary
public F arrayType()

Return a descriptor for the array type whose component type is described by this descriptor

Returns:F

the descriptor for the array type

componentTypeback to summary
public F componentType()

If this field descriptor describes an array type, return a descriptor for its component type, otherwise return null.

Returns:F

the component type, or null if this field descriptor does not describe an array type

isArrayback to summary
public boolean isArray()

Does this field descriptor describe an array type?

Returns:boolean

whether this field descriptor describes an array type

isPrimitiveback to summary
public boolean isPrimitive()

Does this field descriptor describe a primitive type (including void.)

Returns:boolean

whether this field descriptor describes a primitive type

java.lang.invoke back to summary

public Interface TypeDescriptor.OfMethod<F extends TypeDescriptor.OfField<F>, M extends TypeDescriptor.OfMethod<F, M>>

extends TypeDescriptor
Known Direct Subinterfaces
java.lang.constant.MethodTypeDesc
Known Direct Implementers
java.lang.invoke.MethodType
Type Parameters
<F>
the type representing field type descriptors
<M>
the class implementing TypeDescriptor.OfMethod

An entity that has a method type descriptor Method descriptors conforming to JVMS 4.3.3 can be described nominally via MethodType::describeConstable; otherwise they cannot be described nominally.
Since
12
Java Virtual Machine Specification
4.3.2 Field Descriptors, 4.3.3 Method Descriptors

Method Summary

Modifier and TypeMethod and Description
public M

Returns:

the new method descriptor
changeParameterType
(int
the index of the parameter to change
index
,
F
a field descriptor describing the new parameter type
paramType
)

Return a method descriptor that is identical to this one, except that a single parameter type has been changed to the specified type.

public M

Returns:

the new method descriptor
changeReturnType
(F
a field descriptor for the new return type
newReturn
)

Return a method descriptor that is identical to this one, except that the return type has been changed to the specified type

public M

Returns:

the new method descriptor
dropParameterTypes
(int
the index of the first parameter to remove
start
,
int
the index after the last parameter to remove
end
)

Return a method descriptor that is identical to this one, except that a range of parameter types have been removed.

public M

Returns:

the new method descriptor
insertParameterTypes
(int
the index at which to insert the first inserted parameter
pos
,
F...
field descriptors describing the new parameter types to insert
paramTypes
)

Return a method descriptor that is identical to this one, except that a range of additional parameter types have been inserted.

public F[]

Returns:

field descriptors for the parameter types
parameterArray
()

Return an array of field descriptors for the parameter types of the method type described by this descriptor

public int

Returns:

the number of parameters
parameterCount
()

Return the number of parameters in the method type

public List<F>

Returns:

field descriptors for the parameter types
parameterList
()

Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor

public F

Returns:

a field descriptor for the requested parameter type
parameterType
(int
the index of the parameter
i
)

Return a field descriptor describing the requested parameter of the method type described by this descriptor

public F

Returns:

a field descriptor for the return type
returnType
()

Return a field descriptor describing the return type of the method type described by this descriptor

Inherited from java.lang.invoke.TypeDescriptor:
descriptorString

Method Detail

changeParameterTypeback to summary
public M changeParameterType(int index, F paramType)

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

Returns:M

the new method descriptor

Exceptions
NullPointerException:
if any argument is null
IndexOutOfBoundsException:
if the index is outside the half-open range {[0, parameterCount)}
changeReturnTypeback to summary
public M changeReturnType(F newReturn)

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

Returns:M

the new method descriptor

Exceptions
NullPointerException:
if any argument is null
dropParameterTypesback to summary
public M dropParameterTypes(int start, int end)

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

Returns:M

the new method descriptor

Exceptions
IndexOutOfBoundsException:
if start is outside the half-open range [0, parameterCount), or end is outside the closed range [0, parameterCount], or if start > end
insertParameterTypesback to summary
public M insertParameterTypes(int pos, F... paramTypes)

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

Returns:M

the new method descriptor

Annotations
@SuppressWarnings:unchecked
Exceptions
NullPointerException:
if any argument is null
IndexOutOfBoundsException:
if pos is outside the closed range {[0, parameterCount]}
parameterArrayback to summary
public F[] parameterArray()

Return an array of field descriptors for the parameter types of the method type described by this descriptor

Returns:F[]

field descriptors for the parameter types

parameterCountback to summary
public int parameterCount()

Return the number of parameters in the method type

Returns:int

the number of parameters

parameterListback to summary
public List<F> parameterList()

Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor

Returns:List<F>

field descriptors for the parameter types

parameterTypeback to summary
public F parameterType(int i)

Return a field descriptor describing the requested parameter of the method type described by this descriptor

Parameters
i:int

the index of the parameter

Returns:F

a field descriptor for the requested parameter type

Exceptions
IndexOutOfBoundsException:
if the index is outside the half-open range {[0, parameterCount)}
returnTypeback to summary
public F returnType()

Return a field descriptor describing the return type of the method type described by this descriptor

Returns:F

a field descriptor for the return type