Interface SourceFileAttribute

All Superinterfaces:
Attribute<SourceFileAttribute>, ClassElement, ClassFileElement

public sealed interface SourceFileAttribute extends Attribute<SourceFileAttribute>, ClassElement
Models the SourceFile attribute (JVMS 4.7.10), which can appear on classes. Delivered as a ClassElement when traversing a ClassModel.

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:
24
  • Method Details

    • sourceFile

      Utf8Entry sourceFile()
      Returns the name of the source file from which this class was compiled.
      Returns:
      the name of the source file from which this class was compiled
    • of

      static SourceFileAttribute of(String sourceFile)
      Returns a source file attribute.
      Parameters:
      sourceFile - the source file name
      Returns:
      a source file attribute
    • of

      static SourceFileAttribute of(Utf8Entry sourceFile)
      Returns a source file attribute.
      Parameters:
      sourceFile - the source file name
      Returns:
      a source file attribute