com.ibm.wala.shrikeCT
Class SourceFileWriter

java.lang.Object
  extended by com.ibm.wala.shrikeCT.ClassWriter.Element
      extended by com.ibm.wala.shrikeCT.SourceFileWriter

public final class SourceFileWriter
extends ClassWriter.Element

This class builds serializable SourceFile attributes. After constructing a SourceFileWriter, you must call setSourceFileCPIndex.


Constructor Summary
SourceFileWriter(ClassWriter w)
          Build an empty writer.
 
Method Summary
 int copyInto(byte[] buf, int offset)
          Copy the bytes into 'buf' at offset 'offset'.
 int getSize()
           
 void setSourceFileCPIndex(int index)
          Set the index of the constant pool item holding the source file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceFileWriter

public SourceFileWriter(ClassWriter w)
Build an empty writer.

Throws:
java.lang.IllegalArgumentException - if w is null
Method Detail

getSize

public int getSize()
            throws java.lang.IllegalArgumentException
Specified by:
getSize in class ClassWriter.Element
Returns:
the number of bytes that will be generated.
Throws:
java.lang.IllegalArgumentException

copyInto

public int copyInto(byte[] buf,
                    int offset)
             throws java.lang.IllegalArgumentException
Description copied from class: ClassWriter.Element
Copy the bytes into 'buf' at offset 'offset'.

Specified by:
copyInto in class ClassWriter.Element
Returns:
the number of bytes copies, which must be equal to getSize()
Throws:
java.lang.IllegalArgumentException

setSourceFileCPIndex

public void setSourceFileCPIndex(int index)
                          throws java.lang.IllegalArgumentException
Set the index of the constant pool item holding the source file name.

Throws:
java.lang.IllegalArgumentException