Class SourceFile
- java.lang.Object
-
- org.fife.rsta.ac.java.classreader.attributes.AttributeInfo
-
- org.fife.rsta.ac.java.classreader.attributes.SourceFile
-
public class SourceFile extends AttributeInfo
TheSourceFileattribute, an optional fixed-length attribute in the attributes table of aClassFile. There can be no more than oneSourceFileattribute for a givenClassFile.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private intsourceFileIndexIndex into the constant pool of aConstantUtf8Infostructure representing the name of the source file from which this class file was compiled.
-
Constructor Summary
Constructors Constructor Description SourceFile(ClassFile cf, int sourceFileIndex)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetSourceFileName()Returns the name of the source file that was compiled to create this class file.java.lang.StringtoString()Returns a string representation of this attribute.-
Methods inherited from class org.fife.rsta.ac.java.classreader.attributes.AttributeInfo
getClassFile, getName, readUnsupportedAttribute
-
-
-
-
Field Detail
-
sourceFileIndex
private int sourceFileIndex
Index into the constant pool of aConstantUtf8Infostructure representing the name of the source file from which this class file was compiled.
-
-
Constructor Detail
-
SourceFile
public SourceFile(ClassFile cf, int sourceFileIndex)
Constructor.- Parameters:
cf- The class file.sourceFileIndex- Index into the constant pool of aConstantUtf8Infostructure representing the source file name.
-
-
Method Detail
-
getSourceFileName
public java.lang.String getSourceFileName()
Returns the name of the source file that was compiled to create this class file.- Returns:
- The name of the source file.
-
toString
public java.lang.String toString()
Returns a string representation of this attribute. Useful for debugging.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of this attribute.
-
-