protected abstract static class Advice.AdviceVisitor extends ExceptionTableSensitiveMethodVisitor
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Advice.AdviceVisitor.WithExitAdvice
An advice visitor that applies exit advice.
|
protected static class |
Advice.AdviceVisitor.WithoutExitAdvice
An advice visitor that does not apply exit advice.
|
| Modifier and Type | Field and Description |
|---|---|
protected MethodDescription.InDefinedShape |
instrumentedMethod
A description of the instrumented method.
|
protected Advice.Dispatcher.Bound |
methodExit
The dispatcher to be used for method exit.
|
protected Advice.MethodSizeHandler |
methodSizeHandler
A handler for computing the method size requirements.
|
protected Advice.StackMapFrameHandler.ForInstrumentedMethod |
stackMapFrameHandler
A handler for translating and injecting stack map frames.
|
api, mv| Modifier | Constructor and Description |
|---|---|
protected |
AdviceVisitor(MethodVisitor methodVisitor,
MethodDescription.InDefinedShape instrumentedMethod,
Advice.Dispatcher.Resolved.ForMethodEnter methodEnter,
Advice.Dispatcher.Resolved.ForMethodExit methodExit,
List<? extends TypeDescription> yieldedTypes,
ClassFileVersion classFileVersion,
int writerFlags,
int readerFlags)
Creates a new advice visitor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
onAfterExceptionTable()
Invoked after the exception table was visited.
|
protected abstract void |
onUserEnd()
Writes the advice for completing the instrumented method.
|
protected abstract void |
onUserPrepare()
Invoked when the user method's exception handler (if any) is supposed to be prepared.
|
protected abstract void |
onUserStart()
Writes the advice for entering the instrumented method.
|
protected void |
onVisitIincInsn(int offset,
int increment)
Visits an increment instruction.
|
protected void |
onVisitVarInsn(int opcode,
int offset)
Visits an variable instruction.
|
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 |
visitFrame(int frameType,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack) |
void |
visitMaxs(int stackSize,
int localVariableLength) |
onVisitFieldInsn, onVisitInsn, onVisitIntInsn, onVisitInvokeDynamicInsn, onVisitJumpInsn, onVisitLabel, onVisitLdcInsn, onVisitLookupSwitchInsn, onVisitMethodInsn, onVisitMethodInsn, onVisitMultiANewArrayInsn, onVisitTableSwitchInsn, onVisitTypeInsn, visitFieldInsn, visitIincInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTypeInsn, visitVarInsnvisitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitInsnAnnotation, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotationprotected final MethodDescription.InDefinedShape instrumentedMethod
protected final Advice.Dispatcher.Bound methodExit
protected final Advice.MethodSizeHandler methodSizeHandler
protected final Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler
protected AdviceVisitor(MethodVisitor methodVisitor, MethodDescription.InDefinedShape instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, Advice.Dispatcher.Resolved.ForMethodExit methodExit, List<? extends TypeDescription> yieldedTypes, ClassFileVersion classFileVersion, int writerFlags, int readerFlags)
methodVisitor - The method visitor to which all instructions are written.instrumentedMethod - The instrumented method.methodEnter - The method enter advice.methodExit - The method exit advice.yieldedTypes - The types that are expected to be added after the instrumented method returns.classFileVersion - The instrumented type's class file version.writerFlags - The ASM writer flags that were set.readerFlags - The ASM reader flags that were set.protected void onAfterExceptionTable()
ExceptionTableSensitiveMethodVisitoronAfterExceptionTable in class ExceptionTableSensitiveMethodVisitorprotected abstract void onUserPrepare()
protected abstract void onUserStart()
protected void onVisitVarInsn(int opcode,
int offset)
ExceptionTableSensitiveMethodVisitoronVisitVarInsn in class ExceptionTableSensitiveMethodVisitoropcode - The visited opcode.offset - The visited offset.protected void onVisitIincInsn(int offset,
int increment)
ExceptionTableSensitiveMethodVisitoronVisitIincInsn in class ExceptionTableSensitiveMethodVisitoroffset - The offset of the accessed variable.increment - The value with which to increment.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 visitFrame(int frameType,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
visitFrame in class MethodVisitorpublic void visitMaxs(int stackSize,
int localVariableLength)
visitMaxs in class MethodVisitorprotected abstract void onUserEnd()
Copyright © 2014–2016. All rights reserved.