Class RemappingMethodAdapter
java.lang.Object
org.objectweb.asm.MethodAdapter
org.objectweb.asm.commons.LocalVariablesSorter
org.objectweb.asm.commons.RemappingMethodAdapter
- All Implemented Interfaces:
MethodVisitor
A
MethodAdapter for type mapping.- Author:
- Eugene Kuleshov
-
Field Summary
FieldsFields inherited from class LocalVariablesSorter
firstLocal, nextLocalFields inherited from class MethodAdapter
mv -
Constructor Summary
ConstructorsConstructorDescriptionRemappingMethodAdapter(int access, String desc, MethodVisitor mv, Remapper renamer) -
Method Summary
Modifier and TypeMethodDescriptionvisitAnnotation(String desc, boolean visible) Visits an annotation of this method.Visits the default value of this annotation interface method.voidvisitFieldInsn(int opcode, String owner, String name, String desc) Visits a field instruction.voidvisitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) Visits the current state of the local variables and operand stack elements.voidvisitLdcInsn(Object cst) Visits a LDC instruction.voidVisits a local variable declaration.voidvisitMethodInsn(int opcode, String owner, String name, String desc) Visits a method instruction.voidvisitMultiANewArrayInsn(String desc, int dims) Visits a MULTIANEWARRAY instruction.visitParameterAnnotation(int parameter, String desc, boolean visible) Visits an annotation of a parameter this method.voidvisitTryCatchBlock(Label start, Label end, Label handler, String type) Visits a try catch block.voidvisitTypeInsn(int opcode, String type) Visits a type instruction.Methods inherited from class LocalVariablesSorter
newLocal, newLocalMapping, setLocalType, visitIincInsn, visitMaxs, visitVarInsnMethods inherited from class MethodAdapter
visitAttribute, visitCode, visitEnd, visitInsn, visitIntInsn, visitJumpInsn, visitLabel, visitLineNumber, visitLookupSwitchInsn, visitTableSwitchInsn
-
Field Details
-
remapper
-
-
Constructor Details
-
RemappingMethodAdapter
-
-
Method Details
-
visitFieldInsn
Description copied from interface:MethodVisitorVisits a field instruction. A field instruction is an instruction that loads or stores the value of a field of an object.- Specified by:
visitFieldInsnin interfaceMethodVisitor- Overrides:
visitFieldInsnin classMethodAdapter- Parameters:
opcode- the opcode of the type instruction to be visited. This opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.owner- the internal name of the field's owner class (seegetInternalName).name- the field's name.desc- the field's descriptor (seeType).
-
visitMethodInsn
Description copied from interface:MethodVisitorVisits a method instruction. A method instruction is an instruction that invokes a method.- Specified by:
visitMethodInsnin interfaceMethodVisitor- Overrides:
visitMethodInsnin classMethodAdapter- Parameters:
opcode- the opcode of the type instruction to be visited. This opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC, INVOKEINTERFACE or INVOKEDYNAMIC.owner- the internal name of the method's owner class (seegetInternalName) orOpcodes.INVOKEDYNAMIC_OWNER.name- the method's name.desc- the method's descriptor (seeType).
-
visitTypeInsn
Description copied from interface:MethodVisitorVisits a type instruction. A type instruction is an instruction that takes the internal name of a class as parameter.- Specified by:
visitTypeInsnin interfaceMethodVisitor- Overrides:
visitTypeInsnin classMethodAdapter- Parameters:
opcode- the opcode of the type instruction to be visited. This opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.type- the operand of the instruction to be visited. This operand must be the internal name of an object or array class (seegetInternalName).
-
visitLdcInsn
Description copied from interface:MethodVisitorVisits a LDC instruction.- Specified by:
visitLdcInsnin interfaceMethodVisitor- Overrides:
visitLdcInsnin classMethodAdapter- Parameters:
cst- the constant to be loaded on the stack. This parameter must be a non nullInteger, aFloat, aLong, aDoubleaString(or aTypefor .class constants, for classes whose version is 49.0 or more).
-
visitMultiANewArrayInsn
Description copied from interface:MethodVisitorVisits a MULTIANEWARRAY instruction.- Specified by:
visitMultiANewArrayInsnin interfaceMethodVisitor- Overrides:
visitMultiANewArrayInsnin classMethodAdapter- Parameters:
desc- an array type descriptor (seeType).dims- number of dimensions of the array to allocate.
-
visitTryCatchBlock
Description copied from interface:MethodVisitorVisits a try catch block.- Specified by:
visitTryCatchBlockin interfaceMethodVisitor- Overrides:
visitTryCatchBlockin classMethodAdapter- Parameters:
start- beginning of the exception handler's scope (inclusive).end- end of the exception handler's scope (exclusive).handler- beginning of the exception handler's code.type- internal name of the type of exceptions handled by the handler, or null to catch any exceptions (for "finally" blocks).
-
visitLocalVariable
public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) Description copied from interface:MethodVisitorVisits a local variable declaration.- Specified by:
visitLocalVariablein interfaceMethodVisitor- Overrides:
visitLocalVariablein classLocalVariablesSorter- Parameters:
name- the name of a local variable.desc- the type descriptor of this local variable.signature- the type signature of this local variable. May be null if the local variable type does not use generic types.start- the first instruction corresponding to the scope of this local variable (inclusive).end- the last instruction corresponding to the scope of this local variable (exclusive).index- the local variable's index.
-
visitAnnotation
Description copied from interface:MethodVisitorVisits an annotation of this method.- Specified by:
visitAnnotationin interfaceMethodVisitor- Overrides:
visitAnnotationin classMethodAdapter- Parameters:
desc- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- Returns:
- a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
-
visitAnnotationDefault
Description copied from interface:MethodVisitorVisits the default value of this annotation interface method.- Specified by:
visitAnnotationDefaultin interfaceMethodVisitor- Overrides:
visitAnnotationDefaultin classMethodAdapter- Returns:
- a visitor to the visit the actual default value of this annotation interface method, or null if this visitor is not interested in visiting this default value. The 'name' parameters passed to the methods of this annotation visitor are ignored. Moreover, exacly one visit method must be called on this annotation visitor, followed by visitEnd.
-
visitParameterAnnotation
Description copied from interface:MethodVisitorVisits an annotation of a parameter this method.- Specified by:
visitParameterAnnotationin interfaceMethodVisitor- Overrides:
visitParameterAnnotationin classMethodAdapter- Parameters:
parameter- the parameter index.desc- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- Returns:
- a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
-
visitFrame
Description copied from interface:MethodVisitorVisits the current state of the local variables and operand stack elements. This method must(*) be called just before any instruction i that follows an unconditional branch instruction such as GOTO or THROW, that is the target of a jump instruction, or that starts an exception handler block. The visited types must describe the values of the local variables and of the operand stack elements just before i is executed.
(*) this is mandatory only for classes whose version is greater than or equal toV1_6.
Packed frames are basically "deltas" from the state of the previous frame (very first frame is implicitly defined by the method's parameters and access flags):Opcodes.F_SAMErepresenting frame with exactly the same locals as the previous frame and with the empty stack.Opcodes.F_SAME1representing frame with exactly the same locals as the previous frame and with single value on the stack (nStackis 1 andstack[0]contains value for the type of the stack item).Opcodes.F_APPENDrepresenting frame with current locals are the same as the locals in the previous frame, except that additional locals are defined (nLocalis 1, 2 or 3 andlocalelements contains values representing added types).Opcodes.F_CHOPrepresenting frame with current locals are the same as the locals in the previous frame, except that the last 1-3 locals are absent and with the empty stack (nLocalsis 1, 2 or 3).Opcodes.F_FULLrepresenting complete frame data.
- Specified by:
visitFramein interfaceMethodVisitor- Overrides:
visitFramein classLocalVariablesSorter- Parameters:
type- the type of this stack map frame. Must beOpcodes.F_NEWfor expanded frames, orOpcodes.F_FULL,Opcodes.F_APPEND,Opcodes.F_CHOP,Opcodes.F_SAMEorOpcodes.F_APPEND,Opcodes.F_SAME1for compressed frames.nLocal- the number of local variables in the visited frame.local- the local variable types in this frame. This array must not be modified. Primitive types are represented byOpcodes.TOP,Opcodes.INTEGER,Opcodes.FLOAT,Opcodes.LONG,Opcodes.DOUBLE,Opcodes.NULLorOpcodes.UNINITIALIZED_THIS(long and double are represented by a single element). Reference types are represented by String objects (representing internal names), and uninitialized types by Label objects (this label designates the NEW instruction that created this uninitialized value).nStack- the number of operand stack elements in the visited frame.stack- the operand stack types in this frame. This array must not be modified. Its content has the same format as the "local" array.
-