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

public sealed Interface SourceIDAttribute

extends Attribute<SourceIDAttribute>, ClassElement
permits BoundSourceIDAttribute, UnboundSourceIDAttribute
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundSourceIDAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundSourceIDAttribute
Imports
java.lang.classfile.Attribute, .AttributeMapper, .AttributeMapper.AttributeStability, .Attributes, .ClassElement, java.lang.classfile.constantpool.Utf8Entry, jdk.internal.classfile.impl.BoundAttribute, .TemporaryConstantPool, .UnboundAttribute

Models the SourceID attribute, which records the last modified time of the source file from which this class file was compiled.

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

This attribute is not predefined in the Java SE Platform. This is a JDK-specific nonstandard attribute produced by the reference implementation of the system Java compiler, defined by the jdk.compiler module.

Since
24
See Also
Attributes#sourceId(), CompilationIDAttribute, CharacterRangeTableAttribute

Method Summary

Modifier and TypeMethod and Description
public static SourceIDAttribute

Returns:

a SourceID attribute
of
(Utf8Entry
the source id
sourceId
)

Returns a SourceID attribute.

public static SourceIDAttribute

Returns:

a SourceID attribute
of
(String
the source id
sourceId
)

Returns a SourceID attribute.

public Utf8Entry

Returns:

the source id
sourceId
()

Returns the source id. The source id is the last modified time of the source file (as reported by the file system, in milliseconds) when this class file is compiled.

Inherited from java.lang.classfile.Attribute:
attributeMapperattributeName

Method Detail

ofback to summary
public static SourceIDAttribute of(Utf8Entry sourceId)

Returns a SourceID attribute.

Parameters
sourceId:Utf8Entry

the source id

Returns:SourceIDAttribute

a SourceID attribute

ofback to summary
public static SourceIDAttribute of(String sourceId)

Returns a SourceID attribute.

Parameters
sourceId:String

the source id

Returns:SourceIDAttribute

a SourceID attribute

sourceIdback to summary
public Utf8Entry sourceId()

Returns the source id. The source id is the last modified time of the source file (as reported by the file system, in milliseconds) when this class file is compiled.

Returns:Utf8Entry

the source id