com.ibm.wala.shrikeCT
Class ClassWriter.Element

java.lang.Object
  extended by com.ibm.wala.shrikeCT.ClassWriter.Element
Direct Known Subclasses:
ClassWriter.RawElement, CodeWriter, ConstantValueWriter, ExceptionsWriter, InnerClassesWriter, LineNumberTableWriter, LocalVariableTableWriter, SourceDebugExtensionWriter, SourceFileWriter
Enclosing class:
ClassWriter

public abstract static class ClassWriter.Element
extends java.lang.Object

An Element is an object that can be serialized into a byte buffer. Serialization via 'copyInto' is performed when the user calls makeBytes() on the ClassWriter. At this time no new constant pool items can be allocated, so any item indices that need to be emitted must be allocated earlier.


Constructor Summary
ClassWriter.Element()
           
 
Method Summary
abstract  int copyInto(byte[] buf, int offset)
          Copy the bytes into 'buf' at offset 'offset'.
abstract  int getSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassWriter.Element

public ClassWriter.Element()
Method Detail

getSize

public abstract int getSize()
Returns:
the number of bytes that will be generated.

copyInto

public abstract int copyInto(byte[] buf,
                             int offset)
Copy the bytes into 'buf' at offset 'offset'.

Returns:
the number of bytes copies, which must be equal to getSize()