attr
Class srcFileAttr

java.lang.Object
  |
  +--util.dataRead
        |
        +--attr.attrInfo
              |
              +--attr.srcFileAttr

public class srcFileAttr
extends attrInfo

This object represents the source file attribute. The structure of this attribute is:

SourceFile_attribute {
u2 attribute_name_index;
u4 attribute_length;
u2 sourcefile_index;
}

The attribute_name_index and attribute length are read by the attrFactory.allocAttr method. These values are passed into the class constructor.

The sourcefile_index points to a constUtf8 object in the constant pool. This object contains the file name for the object. There can be no more than one SourceFile attribute in the attributes table of a given ClassFile structure.

Author:
Ian Kaplan

Field Summary
private  constUtf8 srcFile
           
 
Fields inherited from class attr.attrInfo
attrName, len
 
Fields inherited from class util.dataRead
bytesRead
 
Constructor Summary
srcFileAttr(java.lang.String name, int length, java.io.DataInputStream dStream, constPool constPoolSec)
           
 
Method Summary
 java.lang.String getFileName()
           
 void pr()
           
 
Methods inherited from class attr.attrInfo
getName
 
Methods inherited from class util.dataRead
getBytesRead, readU1, readU2, readU4
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

srcFile

private constUtf8 srcFile
Constructor Detail

srcFileAttr

public srcFileAttr(java.lang.String name,
                   int length,
                   java.io.DataInputStream dStream,
                   constPool constPoolSec)
Method Detail

getFileName

public java.lang.String getFileName()
Returns:
a String object for the source file name

pr

public void pr()
Overrides:
pr in class attrInfo