< prev index next >
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/SourceFile.java
Print this page
*** 31,41 ****
* This class is derived from <em>Attribute</em> and represents a reference
* to the source file of this class. At most one SourceFile attribute
* should appear per classfile. The intention of this class is that it is
* instantiated from the <em>Attribute.readAttribute()</em> method.
*
- * @version $Id$
* @see Attribute
*/
public final class SourceFile extends Attribute {
private int sourcefile_index;
--- 31,40 ----
*** 101,147 ****
*
* @param file Output file stream
* @throws IOException
*/
@Override
! public final void dump( final DataOutputStream file ) throws IOException {
super.dump(file);
file.writeShort(sourcefile_index);
}
/**
* @return Index in constant pool of source file name.
*/
! public final int getSourceFileIndex() {
return sourcefile_index;
}
/**
* @param sourcefile_index
*/
! public final void setSourceFileIndex( final int sourcefile_index ) {
this.sourcefile_index = sourcefile_index;
}
/**
* @return Source file name.
*/
! public final String getSourceFileName() {
final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(sourcefile_index,
Const.CONSTANT_Utf8);
return c.getBytes();
}
/**
* @return String representation
*/
@Override
! public final String toString() {
return "SourceFile: " + getSourceFileName();
}
/**
--- 100,146 ----
*
* @param file Output file stream
* @throws IOException
*/
@Override
! public void dump( final DataOutputStream file ) throws IOException {
super.dump(file);
file.writeShort(sourcefile_index);
}
/**
* @return Index in constant pool of source file name.
*/
! public int getSourceFileIndex() {
return sourcefile_index;
}
/**
* @param sourcefile_index
*/
! public void setSourceFileIndex( final int sourcefile_index ) {
this.sourcefile_index = sourcefile_index;
}
/**
* @return Source file name.
*/
! public String getSourceFileName() {
final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(sourcefile_index,
Const.CONSTANT_Utf8);
return c.getBytes();
}
/**
* @return String representation
*/
@Override
! public String toString() {
return "SourceFile: " + getSourceFileName();
}
/**
< prev index next >