FileDocCategorySizeDatePackage
SourceFileAttribute.javaAPI DocGlassfish v2 API3447Fri May 04 22:34:28 BST 2007com.sun.jdo.api.persistence.enhancer.classfile

SourceFileAttribute

public class SourceFileAttribute extends ClassAttribute
Represents the source file attribute in a class file

Fields Summary
public static final String
expectedAttrName
private ConstUtf8
sourceFileName
Constructors Summary
public SourceFileAttribute(ConstUtf8 attrName, ConstUtf8 sourceName)
Constructor for a source file attribute

    super(attrName);
    sourceFileName = sourceName;
  
Methods Summary
public ConstUtf8fileName()
Returns the source file name The file name should not include directories


  /* public accessors */

                 
     
    return sourceFileName;
  
voidprint(java.io.PrintStream out, int indent)

    ClassPrint.spaces(out, indent);
    out.println("SourceFile: " + sourceFileName.asString());//NOI18N
  
static com.sun.jdo.api.persistence.enhancer.classfile.SourceFileAttributeread(ConstUtf8 attrName, java.io.DataInputStream data, ConstantPool pool)

    int index = 0;
    index = data.readUnsignedShort();

    return new SourceFileAttribute(attrName,
				   (ConstUtf8) pool.constantAt(index));
  
public voidsetFileName(ConstUtf8 name)
Sets the source file name

    sourceFileName = name;
  
voidwrite(java.io.DataOutputStream out)

    out.writeShort(attrName().getIndex());
    out.writeInt(2);
    out.writeShort(sourceFileName.getIndex());