Class ClassWriter.Element

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

public abstract static class ClassWriter.Element extends 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 Details

    • Element

      public Element()
  • Method Details

    • 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()