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

public sealed Interface SourceDebugExtensionAttribute

extends Attribute<SourceDebugExtensionAttribute>, ClassElement
permits BoundSourceDebugExtensionAttribute, UnboundSourceDebugExtensionAttribute
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundSourceDebugExtensionAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundSourceDebugExtensionAttribute
Imports
java.io.DataInput, java.lang.classfile.Attribute, .AttributeMapper, .AttributeMapper.AttributeStability, .Attributes, .ClassElement, .ClassFile, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute

Models the SourceDebugExtension attribute (JVMS 4.7.11), which stores arbitrary modified UTF-8 data.

This attribute only appears on classes, and does not permit multiple instances in a class. It has no data dependency.

The attribute was introduced in the Java SE Platform version 5.0, major version 49.

Since
24
Java Virtual Machine Specification
4.7.11 The SourceDebugExtension Attribute
See Also
Attributes#sourceDebugExtension()

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the debug extension payload
contents
()

Returns the debug extension payload.

public static SourceDebugExtensionAttribute

Returns:

a SourceDebugExtension attribute
of
(byte[]
the extension contents
contents
)

Returns a SourceDebugExtension attribute.

Inherited from java.lang.classfile.Attribute:
attributeMapperattributeName

Method Detail

contentsback to summary
public byte[] contents()

Returns the debug extension payload. The payload may denote a string longer than that which can be represented with a String.

Returns:byte[]

the debug extension payload

ofback to summary
public static SourceDebugExtensionAttribute of(byte[] contents)

Returns a SourceDebugExtension attribute.

Parameters
contents:byte[]

the extension contents

Returns:SourceDebugExtensionAttribute

a SourceDebugExtension attribute