Class SourceFileWriter
java.lang.Object
com.ibm.wala.shrike.shrikeCT.ClassWriter.Element
com.ibm.wala.shrike.shrikeCT.SourceFileWriter
This class builds serializable SourceFile attributes.
After constructing a SourceFileWriter, you must call setSourceFileCPIndex.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
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.
-
Constructor Details
-
SourceFileWriter
Build an empty writer.- Throws:
IllegalArgumentException
- if w is null
-
-
Method Details
-
getSize
- Specified by:
getSize
in classClassWriter.Element
- Returns:
- the number of bytes that will be generated.
- Throws:
IllegalArgumentException
-
copyInto
Description copied from class:ClassWriter.Element
Copy the bytes into 'buf' at offset 'offset'.- Specified by:
copyInto
in classClassWriter.Element
- Returns:
- the number of bytes copies, which must be equal to getSize()
- Throws:
IllegalArgumentException
-
setSourceFileCPIndex
Set the index of the constant pool item holding the source file name.- Throws:
IllegalArgumentException
-