protected abstract static class Advice.Dispatcher.Active.CodeTranslationVisitor extends MethodVisitor
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Advice.Dispatcher.Active.CodeTranslationVisitor.ForMethodEnter
A code translation visitor that retains the return value of the represented advise method.
|
protected static class |
Advice.Dispatcher.Active.CodeTranslationVisitor.ForMethodExit
A code translation visitor that discards the return value of the represented advise method.
|
protected static interface |
Advice.Dispatcher.Active.CodeTranslationVisitor.SuppressionHandler
A suppression handler for optionally suppressing exceptions.
|
| Modifier and Type | Field and Description |
|---|---|
protected MethodDescription.InDefinedShape |
adviseMethod
The advise method.
|
protected Label |
endOfMethod
A label indicating the end of the advise byte code.
|
protected Advice.FrameTranslator.Bound |
frameTranslator
The frame translator to use.
|
protected MethodDescription.InDefinedShape |
instrumentedMethod
The instrumented method.
|
api, mv| Modifier | Constructor and Description |
|---|---|
protected |
CodeTranslationVisitor(MethodVisitor methodVisitor,
Advice.FrameTranslator.Bound frameTranslator,
MethodDescription.InDefinedShape instrumentedMethod,
MethodDescription.InDefinedShape adviseMethod,
Map<Integer,Advice.Dispatcher.Active.Resolved.OffsetMapping.Target> offsetMappings,
TypeDescription throwableType)
Creates a new code translation visitor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
adjust(int offset)
Adjusts the offset of a variable instruction within the advise method such that no arguments to
the instrumented method are overridden.
|
void |
makeDefault(MethodVisitor methodVisitor)
Sets a default return value for an advised method.
|
AnnotationVisitor |
visitAnnotation(String descriptor,
boolean visible) |
AnnotationVisitor |
visitAnnotationDefault() |
void |
visitAttribute(Attribute attr) |
void |
visitCode() |
void |
visitEnd() |
void |
visitFrame(int type,
int nLocal,
Object[] local,
int nStack,
Object[] stack) |
abstract void |
visitInsn(int opcode) |
void |
visitLineNumber(int line,
Label start) |
void |
visitMaxs(int maxStack,
int maxLocals) |
void |
visitParameter(String name,
int modifiers) |
AnnotationVisitor |
visitParameterAnnotation(int index,
String descriptor,
boolean visible) |
AnnotationVisitor |
visitTypeAnnotation(int typeReference,
TypePath typePath,
String descriptor,
boolean visible) |
void |
visitVarInsn(int opcode,
int offset) |
visitFieldInsn, visitIincInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeInsnprotected final Advice.FrameTranslator.Bound frameTranslator
protected final MethodDescription.InDefinedShape instrumentedMethod
protected final MethodDescription.InDefinedShape adviseMethod
protected final Label endOfMethod
protected CodeTranslationVisitor(MethodVisitor methodVisitor, Advice.FrameTranslator.Bound frameTranslator, MethodDescription.InDefinedShape instrumentedMethod, MethodDescription.InDefinedShape adviseMethod, Map<Integer,Advice.Dispatcher.Active.Resolved.OffsetMapping.Target> offsetMappings, TypeDescription throwableType)
methodVisitor - A method visitor for writing the instrumented method's byte code.frameTranslator - The frame translator to use.instrumentedMethod - The instrumented method.adviseMethod - The advise method.offsetMappings - A mapping of offsets to resolved target offsets in the instrumented method.throwableType - A throwable type to be suppressed or NoSuppression if no suppression should be applied.public void visitParameter(String name, int modifiers)
visitParameter in class MethodVisitorpublic AnnotationVisitor visitAnnotationDefault()
visitAnnotationDefault in class MethodVisitorpublic AnnotationVisitor visitAnnotation(String descriptor, boolean visible)
visitAnnotation in class MethodVisitorpublic AnnotationVisitor visitTypeAnnotation(int typeReference, TypePath typePath, String descriptor, boolean visible)
visitTypeAnnotation in class MethodVisitorpublic AnnotationVisitor visitParameterAnnotation(int index, String descriptor, boolean visible)
visitParameterAnnotation in class MethodVisitorpublic void visitAttribute(Attribute attr)
visitAttribute in class MethodVisitorpublic void visitCode()
visitCode in class MethodVisitorpublic void visitFrame(int type,
int nLocal,
Object[] local,
int nStack,
Object[] stack)
visitFrame in class MethodVisitorpublic void visitLineNumber(int line,
Label start)
visitLineNumber in class MethodVisitorpublic void visitEnd()
visitEnd in class MethodVisitorpublic void visitMaxs(int maxStack,
int maxLocals)
visitMaxs in class MethodVisitorpublic void visitVarInsn(int opcode,
int offset)
visitVarInsn in class MethodVisitorprotected abstract int adjust(int offset)
offset - The original offset.public abstract void visitInsn(int opcode)
visitInsn in class MethodVisitorpublic void makeDefault(MethodVisitor methodVisitor)
methodVisitor - The instrumented method's method visitor.Copyright © 2014–2016. All rights reserved.