Class MethodImplementationBuilder

java.lang.Object
org.jf.dexlib2.builder.MethodImplementationBuilder

public class MethodImplementationBuilder extends Object
  • Field Details

  • Constructor Details

    • MethodImplementationBuilder

      public MethodImplementationBuilder(int registerCount)
  • Method Details

    • getMethodImplementation

      public MethodImplementation getMethodImplementation()
    • addLabel

      @Nonnull public Label addLabel(@Nonnull String name)
      Adds a new named label at the current location. Any previous unplaced references to a label of this name will now refer to this label/location
      Parameters:
      name - The name of the label to add
      Returns:
      A LabelRef representing the label
    • getLabel

      @Nonnull public Label getLabel(@Nonnull String name)
      Get a reference to a label with the given name. If a label with that name has not been added yet, a new one is created, but is left in an unplaced state. It is assumed that addLabel(name) will be called at a later point to define the location of the label.
      Parameters:
      name - The name of the label to get
      Returns:
      A LabelRef representing the label
    • addCatch

      public void addCatch(@Nullable TypeReference type, @Nonnull Label from, @Nonnull Label to, @Nonnull Label handler)
    • addCatch

      public void addCatch(@Nullable String type, @Nonnull Label from, @Nonnull Label to, @Nonnull Label handler)
    • addCatch

      public void addCatch(@Nonnull Label from, @Nonnull Label to, @Nonnull Label handler)
    • addLineNumber

      public void addLineNumber(int lineNumber)
    • addStartLocal

      public void addStartLocal(int registerNumber, @Nullable StringReference name, @Nullable TypeReference type, @Nullable StringReference signature)
    • addEndLocal

      public void addEndLocal(int registerNumber)
    • addRestartLocal

      public void addRestartLocal(int registerNumber)
    • addPrologue

      public void addPrologue()
    • addEpilogue

      public void addEpilogue()
    • addSetSourceFile

      public void addSetSourceFile(@Nullable StringReference sourceFile)
    • addInstruction

      public void addInstruction(@Nullable BuilderInstruction instruction)