protected abstract static class Advice.AdviceVisitor extends MethodVisitor
Modifier and Type | Class and Description |
---|---|
protected class |
Advice.AdviceVisitor.CodeCopier
A visitor for copying an advice method's byte code.
|
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.MetaDataHandler.ForInstrumentedMethod |
metaDataHandler
A handler to use for translating meta embedded in the byte code.
|
api, mv
Modifier | Constructor and Description |
---|---|
protected |
AdviceVisitor(MethodVisitor methodVisitor,
MethodDescription.InDefinedShape instrumentedMethod,
Advice.Dispatcher.Resolved.ForMethodEnter methodEnter,
List<? extends TypeDescription> yieldedTypes,
byte[] binaryRepresentation,
int writerFlags,
int readerFlags)
Creates a new advice visitor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
append(Advice.Dispatcher.Resolved dispatcher)
Applies the supplied advice dispatcher onto the target method visitor.
|
protected abstract void |
onUserEnd()
Writes the advice for completing the instrumented method.
|
protected abstract void |
onUserStart()
Writes the advice 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 |
visitFrame(int frameType,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack) |
void |
visitIincInsn(int offset,
int increment) |
void |
visitMaxs(int stackSize,
int localVariableLength) |
void |
visitVarInsn(int opcode,
int offset) |
visitAnnotation, visitAnnotationDefault, visitAttribute, visitEnd, visitFieldInsn, visitInsn, 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 final Advice.MetaDataHandler.ForInstrumentedMethod metaDataHandler
protected AdviceVisitor(MethodVisitor methodVisitor, MethodDescription.InDefinedShape instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, List<? extends TypeDescription> yieldedTypes, byte[] binaryRepresentation, int writerFlags, int readerFlags)
methodVisitor
- The method visitor to which all instructions are written.instrumentedMethod
- The instrumented method.methodEnter
- The method enter advice.yieldedTypes
- The types that are expected to be added after the instrumented method returns.binaryRepresentation
- The binary representation of the advice class.writerFlags
- The ASM writer flags that were set.readerFlags
- The ASM reader flags that were set.public void visitCode()
visitCode
in class MethodVisitor
protected abstract void onUserStart()
public void visitVarInsn(int opcode, int offset)
visitVarInsn
in class MethodVisitor
public void visitIincInsn(int offset, int increment)
visitIincInsn
in class MethodVisitor
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
protected abstract void onUserEnd()
protected void append(Advice.Dispatcher.Resolved dispatcher)
dispatcher
- The dispatcher to apply.Copyright © 2014–2016. All rights reserved.