protected abstract static class Advice.AdviceVisitor extends MethodVisitor
Modifier and Type | Class and Description |
---|---|
protected class |
Advice.AdviceVisitor.CodeCopier
A visitor for copying an advise method's byte code.
|
protected static class |
Advice.AdviceVisitor.WithExceptionHandling
An advise visitor that captures exceptions by weaving try-catch blocks around user code.
|
protected static class |
Advice.AdviceVisitor.WithoutExceptionHandling
An advise visitor that does not capture exceptions.
|
Modifier and Type | Field and Description |
---|---|
protected MethodDescription.InDefinedShape |
instrumentedMethod
A description of the instrumented method.
|
api, mv
Modifier | Constructor and Description |
---|---|
protected |
AdviceVisitor(MethodVisitor methodVisitor,
MethodDescription.InDefinedShape instrumentedMethod,
Advice.Dispatcher.Resolved.ForMethodEnter methodEnter,
Advice.Dispatcher.Resolved.ForMethodExit methodExit,
byte[] binaryRepresentation)
Creates an advise visitor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendEnter()
Appends the enter advise's byte code.
|
protected void |
appendExit()
Appends the exit advise's byte code.
|
protected abstract void |
onMethodEnd()
Writes the advise for completing the instrumented method.
|
protected abstract void |
onMethodExit()
Writes the advise for exiting the instrumented method.
|
protected abstract void |
onMethodStart()
Writes the advise for entering the instrumented method.
|
protected void |
variable(int opcode)
Access the first variable after the instrumented variables and return type are stored.
|
protected void |
variable(int opcode,
int offset)
Access the first variable after the instrumented variables and return type are stored.
|
void |
visitCode() |
void |
visitInsn(int opcode) |
void |
visitMaxs(int maxStack,
int maxLocals) |
void |
visitVarInsn(int opcode,
int offset) |
visitAnnotation, visitAnnotationDefault, visitAttribute, visitEnd, visitFieldInsn, visitFrame, visitIincInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn
protected final MethodDescription.InDefinedShape instrumentedMethod
protected AdviceVisitor(MethodVisitor methodVisitor, MethodDescription.InDefinedShape instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, Advice.Dispatcher.Resolved.ForMethodExit methodExit, byte[] binaryRepresentation)
methodVisitor
- The method visitor for the instrumented method.instrumentedMethod
- A description of the instrumented method.methodEnter
- The dispatcher to be used for method entry.methodExit
- The dispatcher to be used for method exit.binaryRepresentation
- The binary representation of the advise methods' class file.public void visitCode()
visitCode
in class MethodVisitor
protected abstract void onMethodStart()
public void visitVarInsn(int opcode, int offset)
visitVarInsn
in class MethodVisitor
public void visitInsn(int opcode)
visitInsn
in class MethodVisitor
protected abstract void onMethodExit()
protected void variable(int opcode)
opcode
- The opcode for accessing the variable.protected void variable(int opcode, int offset)
opcode
- The opcode for accessing the variable.offset
- The additional offset of the variable.public void visitMaxs(int maxStack, int maxLocals)
visitMaxs
in class MethodVisitor
protected abstract void onMethodEnd()
protected void appendEnter()
protected void appendExit()
Copyright © 2014–2016. All rights reserved.