All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.ClassFile.Raw.Attribute.AttributeSourceFile

java.lang.Object
   |
   +----harpoon.ClassFile.Raw.Attribute.Attribute
           |
           +----harpoon.ClassFile.Raw.Attribute.AttributeSourceFile

public class AttributeSourceFile
extends Attribute
The SourceFile attribute is an optional fixed-length attribute in the attributes table of the ClassFile structure. There can be no more than one SourceFile attribute in the attributes table of a given ClassFile structure.

Only the name of the source file is given by the SourceFile attribute. It never represents tha name of a directory containing the file or an absolute path name for the file. For instance, the SourceFile attribute might contain the file name foo.java but not the UNIX pathname /home/lindholm/foo.java.

Version:
$Id: AttributeSourceFile.java,v 1.10 1998/10/11 03:01:13 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Attribute, ClassFile

Variable Index

 o sourcefile_index
The value of the sourcefile_index item must be a valid index into the constant_pool table.

Constructor Index

 o AttributeSourceFile(ClassFile, int, int)
Constructor.

Method Index

 o attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
 o print(PrintWriter, int)
Pretty-print this attribute structure.
 o sourcefile()
 o sourcefile_index()
 o write(ClassDataOutputStream)
Write to bytecode stream.

Variables

 o sourcefile_index
 public int sourcefile_index
The value of the sourcefile_index item must be a valid index into the constant_pool table. The constant pool entry at that index must be a CONSTANT_Utf8_info structure representing the string giving the name of the source file from which this class file was compiled.

Constructors

 o AttributeSourceFile
 public AttributeSourceFile(ClassFile parent,
                            int attribute_name_index,
                            int sourcefile_index)
Constructor.

Methods

 o attribute_length
 public long attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.

Overrides:
attribute_length in class Attribute
 o sourcefile_index
 public ConstantUtf8 sourcefile_index()
 o sourcefile
 public String sourcefile()
 o write
 public void write(ClassDataOutputStream out) throws IOException
Write to bytecode stream.

Overrides:
write in class Attribute
 o print
 public void print(PrintWriter pw,
                   int indent)
Pretty-print this attribute structure.

Parameters:
indent - the indentation level to use.
Overrides:
print in class Attribute

All Packages  Class Hierarchy  This Package  Previous  Next  Index