Package com.ibm.wala.shrike.shrikeCT
Class SourceFileWriter
- java.lang.Object
-
- com.ibm.wala.shrike.shrikeCT.ClassWriter.Element
-
- com.ibm.wala.shrike.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
Constructors Constructor Description SourceFileWriter(ClassWriter w)Build an empty writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcopyInto(byte[] buf, int offset)Copy the bytes into 'buf' at offset 'offset'.intgetSize()voidsetSourceFileCPIndex(int index)Set the index of the constant pool item holding the source file name.
-
-
-
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:
getSizein classClassWriter.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.IllegalArgumentExceptionDescription copied from class:ClassWriter.ElementCopy the bytes into 'buf' at offset 'offset'.- Specified by:
copyIntoin classClassWriter.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.IllegalArgumentExceptionSet the index of the constant pool item holding the source file name.- Throws:
java.lang.IllegalArgumentException
-
-