Package org.jf.dexlib2.builder
Class MethodImplementationBuilder
java.lang.Object
org.jf.dexlib2.builder.MethodImplementationBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MethodLocationprivate final MutableMethodImplementation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddCatch(TypeReference type, Label from, Label to, Label handler) voidaddEndLocal(int registerNumber) voidvoidaddInstruction(BuilderInstruction instruction) Adds a new named label at the current location.voidaddLineNumber(int lineNumber) voidvoidaddRestartLocal(int registerNumber) voidaddSetSourceFile(StringReference sourceFile) voidaddStartLocal(int registerNumber, StringReference name, TypeReference type, StringReference signature) Get a reference to a label with the given name.
-
Field Details
-
labels
-
impl
-
currentLocation
-
-
Constructor Details
-
MethodImplementationBuilder
public MethodImplementationBuilder(int registerCount)
-
-
Method Details
-
getMethodImplementation
-
addLabel
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
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
-
addCatch
-
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
-
addInstruction
-