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

public sealed Interface RecordComponentInfo

extends AttributedElement
permits BoundRecordComponentInfo, UnboundRecordComponentInfo
Known Direct Implementers
jdk.internal.classfile.impl.BoundRecordComponentInfo, jdk.internal.classfile.impl.UnboundAttribute.UnboundRecordComponentInfo
Imports
java.lang.classfile.Attribute, .AttributedElement, java.lang.classfile.constantpool.Utf8Entry, java.lang.constant.ClassDesc, java.lang.reflect.RecordComponent, java.util.List, jdk.internal.classfile.impl.BoundRecordComponentInfo, .TemporaryConstantPool, .UnboundAttribute, .Util

Models a single record component in the RecordAttribute.

SignatureAttribute, RuntimeVisibleAnnotationsAttribute, RuntimeInvisibleAnnotationsAttribute, RuntimeVisibleTypeAnnotationsAttribute, and RuntimeInvisibleTypeAnnotationsAttribute are the only predefined attributes that may exist on record components.

Since
24
Java Virtual Machine Specification
4.7.30 The Record Attribute
See Also
RecordAttribute#components(), RecordComponent

Method Summary

Modifier and TypeMethod and Description
public Utf8Entry

Returns:

the field descriptor string of this component
descriptor
()

Returns the field descriptor string of this component.

public default ClassDesc

Returns:

the symbolic field descriptor of this component
descriptorSymbol
()

Returns the symbolic field descriptor of this component.

public Utf8Entry

Returns:

the name of this component
name
()

Returns the name of this component.

public static RecordComponentInfo

Returns:

a record component description
of
(Utf8Entry
the component name
name
,
Utf8Entry
the component field descriptor string
descriptor
,
List<Attribute<?>>
the component attributes
attributes
)

Returns a record component description.

public static RecordComponentInfo

Returns:

a record component description
of
(Utf8Entry
the component name
name
,
Utf8Entry
the component field descriptor sting
descriptor
,
Attribute<?>...
the component attributes
attributes
)

Returns a record component description.

public static RecordComponentInfo

Returns:

a record component description
of
(String
the component name
name
,
ClassDesc
the component symbolic field descriptor
descriptor
,
List<Attribute<?>>
the component attributes
attributes
)

Returns a record component description.

public static RecordComponentInfo

Returns:

a record component description
of
(String
the component name
name
,
ClassDesc
the component symbolic field descriptor
descriptor
,
Attribute<?>...
the component attributes
attributes
)

Returns a record component description.

Inherited from java.lang.classfile.AttributedElement:
attributesfindAttributefindAttributes

Method Detail

descriptorback to summary
public Utf8Entry descriptor()

Returns the field descriptor string of this component.

API Note

A record component may have a generic type; this information is stored in the Signature attribute in this component.

Returns:Utf8Entry

the field descriptor string of this component

See Also
RecordComponent#getType()
descriptorSymbolback to summary
public default ClassDesc descriptorSymbol()

Returns the symbolic field descriptor of this component.

API Note

A record component may have a generic type; this information is stored in the Signature attribute in this component.

Returns:ClassDesc

the symbolic field descriptor of this component

See Also
RecordComponent#getType()
nameback to summary
public Utf8Entry name()

Returns the name of this component.

Returns:Utf8Entry

the name of this component

See Also
RecordComponent#getName()
ofback to summary
public static RecordComponentInfo of(Utf8Entry name, Utf8Entry descriptor, List<Attribute<?>> attributes)

Returns a record component description.

Parameters
name:Utf8Entry

the component name

descriptor:Utf8Entry

the component field descriptor string

attributes:List<Attribute<?>>

the component attributes

Returns:RecordComponentInfo

a record component description

Exceptions
IllegalArgumentException:
if the number of attributes exceeds the limit of u2
ofback to summary
public static RecordComponentInfo of(Utf8Entry name, Utf8Entry descriptor, Attribute<?>... attributes)

Returns a record component description.

Parameters
name:Utf8Entry

the component name

descriptor:Utf8Entry

the component field descriptor sting

attributes:Attribute<?>[]

the component attributes

Returns:RecordComponentInfo

a record component description

Exceptions
IllegalArgumentException:
if the number of attributes exceeds the limit of u2
ofback to summary
public static RecordComponentInfo of(String name, ClassDesc descriptor, List<Attribute<?>> attributes)

Returns a record component description.

Parameters
name:String

the component name

descriptor:ClassDesc

the component symbolic field descriptor

attributes:List<Attribute<?>>

the component attributes

Returns:RecordComponentInfo

a record component description

Exceptions
IllegalArgumentException:
if the number of attributes exceeds the limit of u2
ofback to summary
public static RecordComponentInfo of(String name, ClassDesc descriptor, Attribute<?>... attributes)

Returns a record component description.

Parameters
name:String

the component name

descriptor:ClassDesc

the component symbolic field descriptor

attributes:Attribute<?>[]

the component attributes

Returns:RecordComponentInfo

a record component description

Exceptions
IllegalArgumentException:
if the number of attributes exceeds the limit of u2