|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.IR.RawClass.Attribute
harpoon.IR.RawClass.AttributeSourceFile
public class AttributeSourceFile
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
.
Attribute
,
ClassFile
Field Summary | |
---|---|
static String |
ATTRIBUTE_NAME
The string naming this Attribute type. |
int |
sourcefile_index
The value of the sourcefile_index item must be a
valid index into the constant_pool table. |
Fields inherited from class harpoon.IR.RawClass.Attribute |
---|
attribute_name_index, parent |
Constructor Summary | |
---|---|
AttributeSourceFile(ClassFile parent,
int attribute_name_index,
int sourcefile_index)
Constructor. |
Method Summary | |
---|---|
long |
attribute_length()
The value of the attribute_length item indicates
the length of the attribute, excluding the initial six bytes. |
void |
print(PrintWriter pw,
int indent)
Pretty-print this attribute structure. |
ConstantUtf8 |
sourcefile_index()
|
String |
sourcefile()
|
void |
write(ClassDataOutputStream out)
Write to bytecode stream. |
Methods inherited from class harpoon.IR.RawClass.Attribute |
---|
attribute_name_index, attribute_name, read, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTE_NAME
Attribute
type.
public int sourcefile_index
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.
Constructor Detail |
---|
public AttributeSourceFile(ClassFile parent, int attribute_name_index, int sourcefile_index)
Method Detail |
---|
public long attribute_length()
Attribute
attribute_length
item indicates
the length of the attribute, excluding the initial six bytes.
attribute_length
in class Attribute
public ConstantUtf8 sourcefile_index()
public String sourcefile()
public void write(ClassDataOutputStream out) throws IOException
write
in class Attribute
IOException
public void print(PrintWriter pw, int indent)
print
in class Attribute
indent
- the indentation level to use.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |