org.fife.rsta.ac.java.classreader.attributes
Class SourceFile

java.lang.Object
  extended by org.fife.rsta.ac.java.classreader.attributes.AttributeInfo
      extended by org.fife.rsta.ac.java.classreader.attributes.SourceFile

public class SourceFile
extends AttributeInfo

The SourceFile attribute, an optional fixed-length attribute in the attributes table of a ClassFile. There can be no more than one SourceFile attribute for a given ClassFile.

Version:
1.0
Author:
Robert Futrell

Field Summary
 
Fields inherited from class org.fife.rsta.ac.java.classreader.attributes.AttributeInfo
attributeNameIndex
 
Constructor Summary
SourceFile(ClassFile cf, int sourceFileIndex)
          Constructor.
 
Method Summary
 String getSourceFileName()
          Returns the name of the source file that was compiled to create this class file.
 String toString()
          Returns a string representation of this attribute.
 
Methods inherited from class org.fife.rsta.ac.java.classreader.attributes.AttributeInfo
getClassFile, getName, readUnsupportedAttribute, skipBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SourceFile

public SourceFile(ClassFile cf,
                  int sourceFileIndex)
Constructor.

Parameters:
cf - The class file.
sourceFileIndex - Index into the constant pool of a ConstantUtf8Info structure representing the source file name.
Method Detail

getSourceFileName

public 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 String toString()
Returns a string representation of this attribute. Useful for debugging.

Overrides:
toString in class Object
Returns:
A string representation of this attribute.


Copyright © 2003-2011. All Rights Reserved.