|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectproguard.classfile.util.SimplifiedVisitor
proguard.classfile.editor.CodeAttributeEditor
public class CodeAttributeEditor
This AttributeVisitor accumulates specified changes to code, and then applies these accumulated changes to the code attributes that it visits.
| Field Summary | |
|---|---|
boolean[] |
deleted
|
Instruction[] |
postInsertions
|
Instruction[] |
preInsertions
|
Instruction[] |
replacements
|
| Constructor Summary | |
|---|---|
CodeAttributeEditor()
|
|
CodeAttributeEditor(boolean updateFrameSizes)
|
|
| Method Summary | |
|---|---|
void |
deleteInstruction(int instructionOffset)
Remembers to delete the instruction at the given offset. |
void |
insertAfterInstruction(int instructionOffset,
Instruction instruction)
Remembers to place the given instruction right after the instruction at the given offset. |
void |
insertAfterInstruction(int instructionOffset,
Instruction[] instructions)
Remembers to place the given instructions right after the instruction at the given offset. |
void |
insertBeforeInstruction(int instructionOffset,
Instruction instruction)
Remembers to place the given instruction right before the instruction at the given offset. |
void |
insertBeforeInstruction(int instructionOffset,
Instruction[] instructions)
Remembers to place the given instructions right before the instruction at the given offset. |
boolean |
isModified(int instructionOffset)
Returns whether the instruction at the given offset has been modified in any way. |
void |
replaceInstruction(int instructionOffset,
Instruction instruction)
Remembers to replace the instruction at the given offset by the given instruction. |
void |
replaceInstruction(int instructionOffset,
Instruction[] instructions)
Remembers to replace the instruction at the given offset by the given instructions. |
void |
reset(int codeLength)
Resets the accumulated code changes. |
void |
undeleteInstruction(int instructionOffset)
Remembers not to delete the instruction at the given offset. |
void |
visitAnyAttribute(Clazz clazz,
Attribute attribute)
Visit any type of attribute. |
void |
visitAnyStackMapFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
StackMapFrame stackMapFrame)
Visits any type of VerificationType. |
void |
visitAnyVerificationType(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VerificationType verificationType)
Visits any type of VerificationType. |
void |
visitBranchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
BranchInstruction branchInstruction)
|
void |
visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute)
|
void |
visitCodeAttribute0(Clazz clazz,
Method method,
CodeAttribute codeAttribute)
|
void |
visitConstantInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
ConstantInstruction constantInstruction)
|
void |
visitExceptionInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
ExceptionInfo exceptionInfo)
|
void |
visitFullFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
FullFrame fullFrame)
|
void |
visitLineNumberInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LineNumberInfo lineNumberInfo)
|
void |
visitLineNumberTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LineNumberTableAttribute lineNumberTableAttribute)
|
void |
visitLocalVariableInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableInfo localVariableInfo)
|
void |
visitLocalVariableTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableTableAttribute localVariableTableAttribute)
|
void |
visitLocalVariableTypeInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableTypeInfo localVariableTypeInfo)
|
void |
visitLocalVariableTypeTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
|
void |
visitLookUpSwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
LookUpSwitchInstruction lookUpSwitchInstruction)
|
void |
visitMoreZeroFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
MoreZeroFrame moreZeroFrame)
|
void |
visitSameOneFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SameOneFrame sameOneFrame)
|
void |
visitSimpleInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SimpleInstruction simpleInstruction)
|
void |
visitStackMapAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
StackMapAttribute stackMapAttribute)
|
void |
visitStackMapTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
StackMapTableAttribute stackMapTableAttribute)
|
void |
visitTableSwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
TableSwitchInstruction tableSwitchInstruction)
|
void |
visitUninitializedType(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
UninitializedType uninitializedType)
|
void |
visitVariableInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VariableInstruction variableInstruction)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface proguard.classfile.attribute.preverification.visitor.StackMapFrameVisitor |
|---|
visitLessZeroFrame, visitSameZeroFrame |
| Field Detail |
|---|
public Instruction[] preInsertions
public Instruction[] replacements
public Instruction[] postInsertions
public boolean[] deleted
| Constructor Detail |
|---|
public CodeAttributeEditor()
public CodeAttributeEditor(boolean updateFrameSizes)
| Method Detail |
|---|
public void reset(int codeLength)
codeLength - the length of the code that will be edited next.
public void insertBeforeInstruction(int instructionOffset,
Instruction instruction)
instructionOffset - the offset of the instruction.instruction - the new instruction.
public void insertBeforeInstruction(int instructionOffset,
Instruction[] instructions)
instructionOffset - the offset of the instruction.instructions - the new instructions.
public void replaceInstruction(int instructionOffset,
Instruction instruction)
instructionOffset - the offset of the instruction to be replaced.instruction - the new instruction.
public void replaceInstruction(int instructionOffset,
Instruction[] instructions)
instructionOffset - the offset of the instruction to be replaced.instructions - the new instructions.
public void insertAfterInstruction(int instructionOffset,
Instruction instruction)
instructionOffset - the offset of the instruction.instruction - the new instruction.
public void insertAfterInstruction(int instructionOffset,
Instruction[] instructions)
instructionOffset - the offset of the instruction.instructions - the new instructions.public void deleteInstruction(int instructionOffset)
instructionOffset - the offset of the instruction to be deleted.public void undeleteInstruction(int instructionOffset)
instructionOffset - the offset of the instruction not to be deleted.public boolean isModified(int instructionOffset)
public void visitAnyAttribute(Clazz clazz,
Attribute attribute)
SimplifiedVisitor
visitAnyAttribute in class SimplifiedVisitor
public void visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute)
visitCodeAttribute in interface AttributeVisitorvisitCodeAttribute in class SimplifiedVisitor
public void visitCodeAttribute0(Clazz clazz,
Method method,
CodeAttribute codeAttribute)
public void visitStackMapAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
StackMapAttribute stackMapAttribute)
visitStackMapAttribute in interface AttributeVisitorvisitStackMapAttribute in class SimplifiedVisitor
public void visitStackMapTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
StackMapTableAttribute stackMapTableAttribute)
visitStackMapTableAttribute in interface AttributeVisitorvisitStackMapTableAttribute in class SimplifiedVisitor
public void visitLineNumberTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LineNumberTableAttribute lineNumberTableAttribute)
visitLineNumberTableAttribute in interface AttributeVisitorvisitLineNumberTableAttribute in class SimplifiedVisitor
public void visitLocalVariableTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableTableAttribute localVariableTableAttribute)
visitLocalVariableTableAttribute in interface AttributeVisitorvisitLocalVariableTableAttribute in class SimplifiedVisitor
public void visitLocalVariableTypeTableAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableTypeTableAttribute localVariableTypeTableAttribute)
visitLocalVariableTypeTableAttribute in interface AttributeVisitorvisitLocalVariableTypeTableAttribute in class SimplifiedVisitor
public void visitSimpleInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SimpleInstruction simpleInstruction)
visitSimpleInstruction in interface InstructionVisitorvisitSimpleInstruction in class SimplifiedVisitor
public void visitConstantInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
ConstantInstruction constantInstruction)
visitConstantInstruction in interface InstructionVisitorvisitConstantInstruction in class SimplifiedVisitor
public void visitVariableInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VariableInstruction variableInstruction)
visitVariableInstruction in interface InstructionVisitorvisitVariableInstruction in class SimplifiedVisitor
public void visitBranchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
BranchInstruction branchInstruction)
visitBranchInstruction in interface InstructionVisitorvisitBranchInstruction in class SimplifiedVisitor
public void visitTableSwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
TableSwitchInstruction tableSwitchInstruction)
visitTableSwitchInstruction in interface InstructionVisitorvisitTableSwitchInstruction in class SimplifiedVisitor
public void visitLookUpSwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
LookUpSwitchInstruction lookUpSwitchInstruction)
visitLookUpSwitchInstruction in interface InstructionVisitorvisitLookUpSwitchInstruction in class SimplifiedVisitor
public void visitExceptionInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
ExceptionInfo exceptionInfo)
visitExceptionInfo in interface ExceptionInfoVisitor
public void visitAnyStackMapFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
StackMapFrame stackMapFrame)
SimplifiedVisitor
visitAnyStackMapFrame in class SimplifiedVisitor
public void visitSameOneFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SameOneFrame sameOneFrame)
visitSameOneFrame in interface StackMapFrameVisitorvisitSameOneFrame in class SimplifiedVisitor
public void visitMoreZeroFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
MoreZeroFrame moreZeroFrame)
visitMoreZeroFrame in interface StackMapFrameVisitorvisitMoreZeroFrame in class SimplifiedVisitor
public void visitFullFrame(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
FullFrame fullFrame)
visitFullFrame in interface StackMapFrameVisitorvisitFullFrame in class SimplifiedVisitor
public void visitAnyVerificationType(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VerificationType verificationType)
SimplifiedVisitor
visitAnyVerificationType in class SimplifiedVisitor
public void visitUninitializedType(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
UninitializedType uninitializedType)
visitUninitializedType in interface VerificationTypeVisitorvisitUninitializedType in class SimplifiedVisitor
public void visitLineNumberInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LineNumberInfo lineNumberInfo)
visitLineNumberInfo in interface LineNumberInfoVisitor
public void visitLocalVariableInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableInfo localVariableInfo)
visitLocalVariableInfo in interface LocalVariableInfoVisitor
public void visitLocalVariableTypeInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
LocalVariableTypeInfo localVariableTypeInfo)
visitLocalVariableTypeInfo in interface LocalVariableTypeInfoVisitor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||