Class CodeAttributeEditor.Label

  • Enclosing class:
    CodeAttributeEditor

    public static class CodeAttributeEditor.Label
    extends Instruction
    This pseudo-instruction represents a label that marks an instruction offset, for use in the context of the code attribute editor only.
    • Field Detail

      • identifier

        protected final int identifier
    • Constructor Detail

      • Label

        public Label​(int identifier)
        Creates a new Label.
        Parameters:
        identifier - an identifier that can be chosen freely.
    • Method Detail

      • offset

        public int offset()
        Returns the offset that can then be used as a branch target in other replacement instructions.
      • shrink

        public Instruction shrink()
        Description copied from class: Instruction
        Shrinks this instruction to its shortest possible form.
        Specified by:
        shrink in class Instruction
        Returns:
        this instruction.
      • write

        public void write​(byte[] code,
                          int offset)
        Description copied from class: Instruction
        Writes the Instruction at the given offset in the given code array.
        Overrides:
        write in class Instruction
      • readInfo

        protected void readInfo​(byte[] code,
                                int offset)
        Description copied from class: Instruction
        Reads the data following the instruction opcode.
        Specified by:
        readInfo in class Instruction
      • writeInfo

        protected void writeInfo​(byte[] code,
                                 int offset)
        Description copied from class: Instruction
        Writes data following the instruction opcode.
        Specified by:
        writeInfo in class Instruction
      • length

        public int length​(int offset)
        Description copied from class: Instruction
        Returns the length in bytes of the instruction.
        Specified by:
        length in class Instruction
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in class Instruction
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object