Class CodeAttribute

All Implemented Interfaces:
Serializable, Processable

public class CodeAttribute extends Attribute
This Attribute represents a code attribute.
See Also:
  • Field Details

    • u2maxStack

      public int u2maxStack
    • u2maxLocals

      public int u2maxLocals
    • u4codeLength

      public int u4codeLength
    • code

      public byte[] code
    • u2exceptionTableLength

      public int u2exceptionTableLength
    • exceptionTable

      public ExceptionInfo[] exceptionTable
    • u2attributesCount

      public int u2attributesCount
    • attributes

      public Attribute[] attributes
  • Constructor Details

    • CodeAttribute

      public CodeAttribute()
      Creates an uninitialized CodeAttribute.
    • CodeAttribute

      public CodeAttribute(int u2attributeNameIndex)
      Creates a partially initialized CodeAttribute without code, exceptions, or attributes.
    • CodeAttribute

      public CodeAttribute(int u2attributeNameIndex, int u2maxStack, int u2maxLocals, int u4codeLength, byte[] code)
      Creates an initialized CodeAttribute without exceptions or attributes.
    • CodeAttribute

      public CodeAttribute(int u2attributeNameIndex, int u2maxStack, int u2maxLocals, int u4codeLength, byte[] code, int u2exceptionTableLength, ExceptionInfo[] exceptionTable, int u2attributesCount, Attribute[] attributes)
      Creates an initialized CodeAttribute.
  • Method Details

    • getAttribute

      public Attribute getAttribute(Clazz clazz, String name)
      Returns the (first) attribute with the given name.
    • accept

      public void accept(Clazz clazz, Method method, AttributeVisitor attributeVisitor)
      Description copied from class: Attribute
      Accepts the given visitor in the context of the given method.
      Overrides:
      accept in class Attribute
    • instructionsAccept

      public void instructionsAccept(Clazz clazz, Method method, InstructionVisitor instructionVisitor)
      Applies the given instruction visitor to all instructions.
    • instructionAccept

      public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor)
      Applies the given instruction visitor to the instruction at the specified offset.
    • instructionsAccept

      public void instructionsAccept(Clazz clazz, Method method, int startOffset, int endOffset, InstructionVisitor instructionVisitor)
      Applies the given instruction visitor to all instructions in the specified range of offsets.
    • exceptionsAccept

      public void exceptionsAccept(Clazz clazz, Method method, ExceptionInfoVisitor exceptionInfoVisitor)
      Applies the given exception visitor to all exceptions.
    • exceptionsAccept

      public void exceptionsAccept(Clazz clazz, Method method, int offset, ExceptionInfoVisitor exceptionInfoVisitor)
      Applies the given exception visitor to all exceptions that are applicable to the instruction at the specified offset.
    • exceptionsAccept

      public void exceptionsAccept(Clazz clazz, Method method, int startOffset, int endOffset, ExceptionInfoVisitor exceptionInfoVisitor)
      Applies the given exception visitor to all exceptions that are applicable to any of the instructions in the specified range of offsets.
    • attributesAccept

      public void attributesAccept(Clazz clazz, Method method, AttributeVisitor attributeVisitor)
      Applies the given attribute visitor to all attributes.