TypeDescriptor
public
interface
TypeDescriptor
java.lang.invoke.TypeDescriptor
|
Known indirect subclasses
Class<T> |
Instances of the class Class represent classes and
interfaces in a running Java application.
|
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.
|
TypeDescriptor.OfField<F extends OfField<F>> |
An entity that has a field type descriptor.
|
TypeDescriptor.OfMethod<F extends OfField<F>, M extends OfMethod<F, M>> |
An entity that has a method type descriptor
Method descriptors conforming to JVMS {@jvms 4.3.3} can be described
|
|
An entity that has a type descriptor.
Summary
Nested classes |
interface |
TypeDescriptor.OfField<F extends OfField<F>>
An entity that has a field type descriptor.
|
interface |
TypeDescriptor.OfMethod<F extends OfField<F>, M extends OfMethod<F, M>>
An entity that has a method type descriptor
Method descriptors conforming to JVMS {@jvms 4.3.3} can be described
|
Public methods |
abstract
String
|
descriptorString()
Returns the descriptor string for this TypeDescriptor object.
|
Public methods
descriptorString
public abstract 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.
Returns |
String |
the descriptor string for this TypeDescriptor object |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TypeDescriptor\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Nested Classes](#nestedclasses) \\| [Methods](#pubmethods) \n\nTypeDescriptor\n==============\n\n\n`\npublic\n\n\ninterface\nTypeDescriptor\n`\n\n\n`\n\n\n`\n\n|---------------------------------|\n| java.lang.invoke.TypeDescriptor |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [Class](/reference/java/lang/Class)\\\u003cT\\\u003e, [MethodType](/reference/java/lang/invoke/MethodType), [TypeDescriptor.OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF extends [OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF\\\u003e\\\u003e, [TypeDescriptor.OfMethod](/reference/java/lang/invoke/TypeDescriptor.OfMethod)\\\u003cF extends [OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF\\\u003e, M extends [OfMethod](/reference/java/lang/invoke/TypeDescriptor.OfMethod)\\\u003cF, M\\\u003e\\\u003e |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Class](/reference/java/lang/Class)\\\u003cT\\\u003e | Instances of the class `Class` represent classes and interfaces in a running Java application. | | [MethodType](/reference/java/lang/invoke/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. | | [TypeDescriptor.OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF extends [OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF\\\u003e\\\u003e | An entity that has a field type descriptor. | | [TypeDescriptor.OfMethod](/reference/java/lang/invoke/TypeDescriptor.OfMethod)\\\u003cF extends [OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF\\\u003e, M extends [OfMethod](/reference/java/lang/invoke/TypeDescriptor.OfMethod)\\\u003cF, M\\\u003e\\\u003e | An entity that has a method type descriptor Method descriptors conforming to JVMS {@jvms 4.3.3} can be described | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn entity that has a type descriptor.\n\nSummary\n-------\n\n| ### Nested classes ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` interface` | [TypeDescriptor.OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)`\u003cF extends `[OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)`\u003cF\u003e\u003e` An entity that has a field type descriptor. |\n| ` interface` | [TypeDescriptor.OfMethod](/reference/java/lang/invoke/TypeDescriptor.OfMethod)`\u003cF extends `[OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)`\u003cF\u003e, M extends `[OfMethod](/reference/java/lang/invoke/TypeDescriptor.OfMethod)`\u003cF, M\u003e\u003e` An entity that has a method type descriptor Method descriptors conforming to JVMS {@jvms 4.3.3} can be described |\n\n| ### Public methods ||\n|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[String](/reference/java/lang/String) | ` `[descriptorString](/reference/java/lang/invoke/TypeDescriptor#descriptorString())`() ` Returns the descriptor string for this `TypeDescriptor` object. |\n\nPublic methods\n--------------\n\n### descriptorString\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String descriptorString ()\n```\n\nReturns the descriptor string for this `TypeDescriptor` object.\n\nIf this `TypeDescriptor` object can be described in nominal form,\nthen this method returns a type descriptor as specified in JVMS {@jvms 4.3}.\nThe result descriptor string can be used to produce\na `java.lang.constant.ConstantDesc nominal descriptor`.\n\nOtherwise, the result string is not a type descriptor.\nNo `java.lang.constant.ConstantDesc nominal descriptor`\ncan be produced from the result string.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|---------------------------------------------------------------|\n| [String](/reference/java/lang/String) | the descriptor string for this `TypeDescriptor` object \u003cbr /\u003e |"]]