Stay organized with collections
Save and categorize content based on your preferences.
TypeDescriptor.OfField
public
static
interface
TypeDescriptor.OfField
implements
TypeDescriptor
Known indirect subclasses
Class<T> |
Instances of the class Class represent classes and
interfaces in a running Java application.
|
|
An entity that has a field type descriptor.
Field descriptors conforming to JVMS {@jvms 4.3.2} can be described
Summary
Public methods |
abstract
F
|
arrayType()
Return a descriptor for the array type whose component type is described by this
descriptor
|
abstract
F
|
componentType()
If this field descriptor describes an array type, return
a descriptor for its component type, otherwise return null .
|
abstract
boolean
|
isArray()
Does this field descriptor describe an array type?
|
abstract
boolean
|
isPrimitive()
Does this field descriptor describe a primitive type (including void.)
|
Public methods
arrayType
public abstract 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 |
componentType
public abstract 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 |
isArray
public abstract boolean isArray ()
Does this field descriptor describe an array type?
Returns |
boolean |
whether this field descriptor describes an array type |
isPrimitive
public abstract boolean isPrimitive ()
Does this field descriptor describe a primitive type (including void.)
Returns |
boolean |
whether this field descriptor describes a primitive type |
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.OfField\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nTypeDescriptor.OfField\n======================\n\n\n`\npublic\nstatic\n\n\ninterface\nTypeDescriptor.OfField\n`\n\n\n`\n\n\nimplements\n\n`[TypeDescriptor](/reference/java/lang/invoke/TypeDescriptor)`\n\n\n`\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| java.lang.invoke.TypeDescriptor.OfField\\\u003cF extends [java.lang.invoke.TypeDescriptor.OfField](/reference/java/lang/invoke/TypeDescriptor.OfField)\\\u003cF\\\u003e\\\u003e |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [Class](/reference/java/lang/Class)\\\u003cT\\\u003e |------------------------------------------|------------------------------------------------------------------------------------------------| | [Class](/reference/java/lang/Class)\\\u003cT\\\u003e | Instances of the class `Class` represent classes and interfaces in a running Java application. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn entity that has a field type descriptor.\nField descriptors conforming to JVMS {@jvms 4.3.2} can be described\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract F` | ` `[arrayType](/reference/java/lang/invoke/TypeDescriptor.OfField#arrayType())`() ` Return a descriptor for the array type whose component type is described by this descriptor |\n| ` abstract F` | ` `[componentType](/reference/java/lang/invoke/TypeDescriptor.OfField#componentType())`() ` If this field descriptor describes an array type, return a descriptor for its component type, otherwise return `null`. |\n| ` abstract boolean` | ` `[isArray](/reference/java/lang/invoke/TypeDescriptor.OfField#isArray())`() ` Does this field descriptor describe an array type? |\n| ` abstract boolean` | ` `[isPrimitive](/reference/java/lang/invoke/TypeDescriptor.OfField#isPrimitive())`() ` Does this field descriptor describe a primitive type (including void.) |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[java.lang.invoke.TypeDescriptor](/reference/java/lang/invoke/TypeDescriptor)` ` |---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| | ` 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### arrayType\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract F arrayType ()\n```\n\nReturn a descriptor for the array type whose component type is described by this\ndescriptor\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----|------------------------------------------|\n| `F` | the descriptor for the array type \u003cbr /\u003e |\n\n### componentType\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract F componentType ()\n```\n\nIf this field descriptor describes an array type, return\na descriptor for its component type, otherwise return `null`.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----|-----------------------------------------------------------------------------------------------|\n| `F` | the component type, or `null` if this field descriptor does not describe an array type \u003cbr /\u003e |\n\n### isArray\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean isArray ()\n```\n\nDoes this field descriptor describe an array type?\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|--------------------------------------------------------------|\n| `boolean` | whether this field descriptor describes an array type \u003cbr /\u003e |\n\n### isPrimitive\n\nAdded in [API level 34](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean isPrimitive ()\n```\n\nDoes this field descriptor describe a primitive type (including void.)\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|-----------------------------------------------------------------|\n| `boolean` | whether this field descriptor describes a primitive type \u003cbr /\u003e |"]]