org.cojen.classfile.attribute
Class SourceFileAttr

java.lang.Object
  extended by org.cojen.classfile.Attribute
      extended by org.cojen.classfile.attribute.SourceFileAttr

public class SourceFileAttr
extends Attribute

This class corresponds to the SourceFile_attribute structure as defined in section 4.7.2 of The Java Virtual Machine Specification.

Author:
Brian S O'Neill
See Also:
cojen.classfile.ClassFile

Field Summary
 
Fields inherited from class org.cojen.classfile.Attribute
CODE, CONSTANT_VALUE, DEPRECATED, ENCLOSING_METHOD, EXCEPTIONS, INNER_CLASSES, LINE_NUMBER_TABLE, LOCAL_VARIABLE_TABLE, RUNTIME_INVISIBLE_ANNOTATIONS, RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS, RUNTIME_VISIBLE_ANNOTATIONS, RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS, SIGNATURE, SOURCE_FILE, SYNTHETIC
 
Constructor Summary
SourceFileAttr(ConstantPool cp, String fileName)
           
SourceFileAttr(ConstantPool cp, String name, int length, DataInput din)
           
SourceFileAttr(ConstantPool cp, String name, String fileName)
           
 
Method Summary
 ConstantUTFInfo getFileName()
          Returns the source file name.
 int getLength()
          Returns the length of the source file attribute, which is 2 bytes.
 void writeDataTo(DataOutput dout)
          Write just the attribute specific data.
 
Methods inherited from class org.cojen.classfile.Attribute
getAttributes, getConstantPool, getName, getNameConstant, readFrom, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceFileAttr

public SourceFileAttr(ConstantPool cp,
                      String fileName)

SourceFileAttr

public SourceFileAttr(ConstantPool cp,
                      String name,
                      String fileName)

SourceFileAttr

public SourceFileAttr(ConstantPool cp,
                      String name,
                      int length,
                      DataInput din)
               throws IOException
Throws:
IOException
Method Detail

getFileName

public ConstantUTFInfo getFileName()
Returns the source file name.


getLength

public int getLength()
Returns the length of the source file attribute, which is 2 bytes.

Specified by:
getLength in class Attribute

writeDataTo

public void writeDataTo(DataOutput dout)
                 throws IOException
Description copied from class: Attribute
Write just the attribute specific data. The default implementation writes nothing.

Overrides:
writeDataTo in class Attribute
Throws:
IOException


Copyright © 2004-2011 Brian S O'Neill. All Rights Reserved.