Interface SourceIDAttribute

All Superinterfaces:
AttributePREVIEW<SourceIDAttributePREVIEW>, ClassElementPREVIEW, ClassFileElementPREVIEW, WritableElementPREVIEW<SourceIDAttributePREVIEW>

public sealed interface SourceIDAttribute extends AttributePREVIEW<SourceIDAttributePREVIEW>, ClassElementPREVIEW
SourceIDAttribute is a preview API of the Java platform.
Programs can only use SourceIDAttribute when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the SourceID attribute, which can appear on classes. Delivered as a ClassElementPREVIEW when traversing a ClassModelPREVIEW.

The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.

Since:
22
  • Method Details

    • sourceId

      Utf8EntryPREVIEW sourceId()
      Returns the source id. The source id is the last modified time of the source file (as reported by the filesystem, in milliseconds) when the classfile is compiled.
      Returns:
      the source id
    • of

      Returns a SourceID attribute.
      Parameters:
      sourceId - the source id
      Returns:
      a SourceID attribute
    • of

      static SourceIDAttributePREVIEW of(String sourceId)
      Returns a SourceID attribute.
      Parameters:
      sourceId - the source id
      Returns:
      a SourceID attribute