gnu.bytecode

Class SourceFileAttr


public class SourceFileAttr
extends Attribute

Constructor Summary

SourceFileAttr(String filename)
Create a new Attribute.
SourceFileAttr(int index, ClassType ctype)

Method Summary

void
assignConstants(ClassType cl)
Add any needed constant pool entries for this Attribute.
static String
fixSourceFile(String fname)
int
getLength()
Return the length of the attribute in bytes.
String
getSourceFile()
void
print(ClassTypeWriter dst)
void
setSourceFile(String filename)
static void
setSourceFile(ClassType cl, String filename)
void
write(DataOutputStream dstr)
Write out the contents of the Attribute.

Methods inherited from class gnu.bytecode.Attribute

addToFrontOf, assignConstants, assignConstants, count, get, getContainer, getLength, getLengthAll, getName, getNameIndex, getNext, isSkipped, print, setContainer, setName, setNameIndex, setNext, setSkipped, setSkipped, write, writeAll

Constructor Details

SourceFileAttr

public SourceFileAttr(String filename)
Create a new Attribute.
Parameters:

SourceFileAttr

public SourceFileAttr(int index,
                      ClassType ctype)

Method Details

assignConstants

public void assignConstants(ClassType cl)
Add any needed constant pool entries for this Attribute. Overridden by sub-classes. Do any other cleanup needed before writing out a .class file.
Overrides:
assignConstants in interface Attribute

fixSourceFile

public static String fixSourceFile(String fname)

getLength

public final int getLength()
Return the length of the attribute in bytes. Does not include the 6-byte header (for the name_index and the length).
Overrides:
getLength in interface Attribute

getSourceFile

public String getSourceFile()

print

public void print(ClassTypeWriter dst)
Overrides:
print in interface Attribute

setSourceFile

public void setSourceFile(String filename)

setSourceFile

public static void setSourceFile(ClassType cl,
                                 String filename)

write

public void write(DataOutputStream dstr)
            throws java.io.IOException
Write out the contents of the Attribute. Does not write the 6-byte attribute header.
Overrides:
write in interface Attribute