protected abstract static class Advice.AdviceVisitor extends ExceptionTableSensitiveMethodVisitor implements Advice.Dispatcher.Bound.SkipHandler
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.ForMethodExit |
methodExit
The dispatcher to be used for method exit.
|
protected Advice.MethodSizeHandler.ForInstrumentedMethod |
methodSizeHandler
A handler for computing the method size requirements.
|
protected MethodVisitor |
methodVisitor
The actual method visitor that is underlying this method visitor to which all instructions are written.
|
protected Advice.StackMapFrameHandler.ForInstrumentedMethod |
stackMapFrameHandler
A handler for translating and injecting stack map frames.
|
api, mv
Modifier | Constructor and Description |
---|---|
protected |
AdviceVisitor(MethodVisitor methodVisitor,
MethodVisitor delegate,
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 |
visitLocalVariable(String name,
String descriptor,
String signature,
Label start,
Label end,
int index) |
AnnotationVisitor |
visitLocalVariableAnnotation(int typeReference,
TypePath typePath,
Label[] start,
Label[] end,
int[] index,
String descriptor,
boolean visible) |
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, visitVarInsn
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitInsnAnnotation, visitLineNumber, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
protected final MethodVisitor methodVisitor
protected final MethodDescription.InDefinedShape instrumentedMethod
protected final Advice.Dispatcher.Bound.ForMethodExit methodExit
protected final Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler
protected final Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler
protected AdviceVisitor(MethodVisitor methodVisitor, MethodVisitor delegate, 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 actual method visitor that is underlying this method visitor to which all instructions are written.delegate
- A delegate to which all instructions of the original method are written to. Must delegate to methodVisitor
.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()
ExceptionTableSensitiveMethodVisitor
onAfterExceptionTable
in class ExceptionTableSensitiveMethodVisitor
protected abstract void onUserPrepare()
protected abstract void onUserStart()
protected void onVisitVarInsn(int opcode, int offset)
ExceptionTableSensitiveMethodVisitor
onVisitVarInsn
in class ExceptionTableSensitiveMethodVisitor
opcode
- The visited opcode.offset
- The visited offset.protected void onVisitIincInsn(int offset, int increment)
ExceptionTableSensitiveMethodVisitor
onVisitIincInsn
in class ExceptionTableSensitiveMethodVisitor
offset
- 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 MethodVisitor
public void visitMaxs(int stackSize, int localVariableLength)
visitMaxs
in class MethodVisitor
public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index)
visitLocalVariable
in class MethodVisitor
public AnnotationVisitor visitLocalVariableAnnotation(int typeReference, TypePath typePath, Label[] start, Label[] end, int[] index, String descriptor, boolean visible)
visitLocalVariableAnnotation
in class MethodVisitor
protected abstract void onUserEnd()
Copyright © 2014–2016. All rights reserved.