Package org.jf.dexlib2.builder
Class MethodImplementationBuilder
- java.lang.Object
-
- org.jf.dexlib2.builder.MethodImplementationBuilder
-
public class MethodImplementationBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MethodImplementationBuilder(int registerCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCatch(java.lang.String type, Label from, Label to, Label handler)
void
addCatch(Label from, Label to, Label handler)
void
addCatch(TypeReference type, Label from, Label to, Label handler)
void
addEndLocal(int registerNumber)
void
addEpilogue()
void
addInstruction(BuilderInstruction instruction)
Label
addLabel(java.lang.String name)
Adds a new named label at the current location.void
addLineNumber(int lineNumber)
void
addPrologue()
void
addRestartLocal(int registerNumber)
void
addSetSourceFile(StringReference sourceFile)
void
addStartLocal(int registerNumber, StringReference name, TypeReference type, StringReference signature)
Label
getLabel(java.lang.String name)
Get a reference to a label with the given name.MethodImplementation
getMethodImplementation()
-
-
-
Method Detail
-
getMethodImplementation
public MethodImplementation getMethodImplementation()
-
addLabel
@Nonnull public Label addLabel(@Nonnull java.lang.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 java.lang.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 java.lang.String type, @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)
-
-