类的使用
cn.taketoday.bytecode.MethodVisitor
使用MethodVisitor的程序包
程序包
说明
CGLIB or ASM other byte code library
Provides some useful class and method adapters.
Provides an ASM visitor that constructs a tree representation of the
classes it visits.
Provides ASM visitors that can be useful for programming and
debugging purposes.
SpEL's central implementation package.
SpEL's abstract syntax tree.
SpEL's default implementations for various core abstractions.
-
cn.taketoday.bytecode中MethodVisitor的使用
修饰符和类型字段说明protected MethodVisitorMethodVisitor.mvThe method visitor to which this visitor must delegate method calls.修饰符和类型方法说明ClassVisitor.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) Visits a method of the class.final MethodVisitorClassWriter.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) 参数类型为MethodVisitor的cn.taketoday.bytecode中的构造器 -
cn.taketoday.bytecode.commons中MethodVisitor的使用
修饰符和类型类说明classAMethodVisitorto insert before, after and around advices in methods and constructors.classAMethodVisitorthat keeps track of stack map frame changes betweenAnalyzerAdapter.visitFrame(int, int, Object[], int, Object[])calls.classAMethodVisitorthat approximates the size of the methods it visits.classAMethodVisitorwith convenient methods to generate code.classAMethodVisitorproviding a more detailed API to generate and transform instructions.classAMethodVisitorthat removes JSR instructions and inlines the referenced subroutines.classAMethodVisitorthat renumbers local variables in their order of appearance.classAMethodVisitorthat remaps types with aRemapper.classAMethodVisitoradapter to sort the exception handlers.修饰符和类型方法说明protected MethodVisitorClassRemapper.createMethodRemapper(MethodVisitor methodVisitor) Constructs a new remapper for methods.ClassRemapper.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) SerialVersionUIDAdder.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) StaticInitMerger.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) 修饰符和类型方法说明static voidInstructionAdapter.cast(MethodVisitor methodVisitor, Type from, Type to) Generates the instruction to cast from the first given type to the other.protected MethodVisitorClassRemapper.createMethodRemapper(MethodVisitor methodVisitor) Constructs a new remapper for methods.static voidInstructionAdapter.newArray(MethodVisitor methodVisitor, Type type) Generates the instruction to create and push on the stack an array of the given type.static voidInstructionAdapter.push(MethodVisitor mv, int value) 参数类型为MethodVisitor的cn.taketoday.bytecode.commons中的构造器限定符构造器说明protectedAdviceAdapter(MethodVisitor methodVisitor, int access, String name, String descriptor) Constructs a newAdviceAdapter.AnalyzerAdapter(String owner, int access, String name, String descriptor, MethodVisitor methodVisitor) Constructs a newAnalyzerAdapter.CodeSizeEvaluator(MethodVisitor methodVisitor) GeneratorAdapter(int access, MethodSignature method, MethodVisitor methodVisitor) Constructs a newGeneratorAdapter.GeneratorAdapter(MethodVisitor methodVisitor, int access, String name, String descriptor) Constructs a newGeneratorAdapter.InstructionAdapter(MethodVisitor methodVisitor) Constructs a newInstructionAdapter.JSRInlinerAdapter(MethodVisitor methodVisitor, int access, String name, String descriptor, String signature, String[] exceptions) Constructs a newJSRInlinerAdapter.LocalVariablesSorter(int access, Type[] argumentTypes, MethodVisitor methodVisitor) LocalVariablesSorter(int access, String descriptor, MethodVisitor methodVisitor) Constructs a newLocalVariablesSorter.MethodRemapper(MethodVisitor methodVisitor, Remapper remapper) Constructs a newMethodRemapper.TryCatchBlockSorter(MethodVisitor methodVisitor, int access, String name, String descriptor, String signature, String[] exceptions) Constructs a newTryCatchBlockSorter. -
cn.taketoday.bytecode.core中MethodVisitor的使用
修饰符和类型方法说明ClassEmitter.visitMethod(int access, String name, String desc, String signature, String[] exceptions) 参数类型为MethodVisitor的cn.taketoday.bytecode.core中的方法修饰符和类型方法说明ClassEmitter.begin_static(boolean hook, MethodVisitor visitor) voidCodeFlow.ClinitAdder.generateCode(MethodVisitor mv, CodeFlow codeflow) static voidCodeFlow.insertAnyNecessaryTypeConversionBytecodes(MethodVisitor mv, char targetDescriptor, String stackDescriptor) Insert any necessary numeric conversion bytecodes based upon what is on the stack and the desired target type.static voidCodeFlow.insertArrayStore(MethodVisitor mv, String arrayElementType) Produce appropriate bytecode to store a stack item in an array.static voidCodeFlow.insertBoxIfNecessary(MethodVisitor mv, char ch) Determine the appropriate boxing instruction for a specific type (if it needs boxing) and insert the instruction into the supplied visitor.static voidCodeFlow.insertBoxIfNecessary(MethodVisitor mv, String descriptor) Determine the appropriate boxing instruction for a specific type (if it needs boxing) and insert the instruction into the supplied visitor.static voidCodeFlow.insertCheckCast(MethodVisitor mv, String descriptor) Insert the appropriate CHECKCAST instruction for the supplied descriptor.static voidCodeFlow.insertNewArrayCode(MethodVisitor mv, int size, String arraytype) Produce the correct bytecode to build an array.static voidCodeFlow.insertNumericUnboxOrPrimitiveTypeCoercion(MethodVisitor mv, String stackDescriptor, char targetDescriptor) For use in mathematical operators, handles converting from a (possibly boxed) number on the stack to a primitive numeric type.static voidCodeFlow.insertOptimalLoad(MethodVisitor mv, int value) Create the optimal instruction for loading a number on the stack.static voidCodeFlow.insertUnboxInsns(MethodVisitor mv, char ch, String stackDescriptor) Insert any necessary cast and value call to convert from a boxed type to a primitive value.static voidCodeFlow.insertUnboxNumberInsns(MethodVisitor mv, char targetDescriptor, String stackDescriptor) For numbers, use the appropriate method on the number to convert it to the primitive type requested.voidCodeFlow.loadEvaluationContext(MethodVisitor mv) Push the bytecode to load the EvaluationContext (the second parameter passed to the compiled expression method).voidCodeFlow.loadTarget(MethodVisitor mv) Push the byte code to load the target (i.e. what was passed as the first argument to CompiledExpression.getValue(target, context))voidCodeFlow.unboxBooleanIfNecessary(MethodVisitor mv) If the codeflow shows the last expression evaluated to java.lang.Boolean then insert the necessary instructions to unbox that to a boolean primitive. -
cn.taketoday.bytecode.transform中MethodVisitor的使用
修饰符和类型方法说明AbstractClassFilterTransformer.visitMethod(int access, String name, String desc, String signature, String[] exceptions) ClassTransformerChain.visitMethod(int access, String name, String desc, String signature, String[] exceptions) ClassVisitorTee.visitMethod(int access, String name, String desc, String signature, String[] exceptions) MethodFilterTransformer.visitMethod(int access, String name, String desc, String signature, String[] exceptions) 参数类型为MethodVisitor的cn.taketoday.bytecode.transform中的构造器 -
cn.taketoday.bytecode.tree中MethodVisitor的使用
修饰符和类型方法说明ClassNode.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) 参数类型为MethodVisitor的cn.taketoday.bytecode.tree中的方法修饰符和类型方法说明abstract voidAbstractInsnNode.accept(MethodVisitor methodVisitor) Makes the given method visitor visit this instruction.voidFieldInsnNode.accept(MethodVisitor methodVisitor) voidFrameNode.accept(MethodVisitor methodVisitor) voidIincInsnNode.accept(MethodVisitor methodVisitor) voidInsnList.accept(MethodVisitor methodVisitor) Makes the given visitor visit all the instructions in this list.voidInsnNode.accept(MethodVisitor methodVisitor) voidIntInsnNode.accept(MethodVisitor methodVisitor) voidInvokeDynamicInsnNode.accept(MethodVisitor methodVisitor) voidJumpInsnNode.accept(MethodVisitor methodVisitor) voidLabelNode.accept(MethodVisitor methodVisitor) voidLdcInsnNode.accept(MethodVisitor methodVisitor) voidLineNumberNode.accept(MethodVisitor methodVisitor) voidLocalVariableAnnotationNode.accept(MethodVisitor methodVisitor, boolean visible) Makes the given visitor visit this type annotation.voidLocalVariableNode.accept(MethodVisitor methodVisitor) Makes the given visitor visit this local variable declaration.voidLookupSwitchInsnNode.accept(MethodVisitor methodVisitor) voidMethodInsnNode.accept(MethodVisitor methodVisitor) voidMethodNode.accept(MethodVisitor methodVisitor) Makes the given method visitor visit this method.voidMultiANewArrayInsnNode.accept(MethodVisitor methodVisitor) voidParameterNode.accept(MethodVisitor methodVisitor) Makes the given visitor visit this parameter declaration.voidTableSwitchInsnNode.accept(MethodVisitor methodVisitor) voidTryCatchBlockNode.accept(MethodVisitor methodVisitor) Makes the given visitor visit this try catch block.voidTypeInsnNode.accept(MethodVisitor methodVisitor) voidVarInsnNode.accept(MethodVisitor methodVisitor) protected final voidAbstractInsnNode.acceptAnnotations(MethodVisitor methodVisitor) Makes the given visitor visit the annotations of this instruction. -
cn.taketoday.bytecode.util中MethodVisitor的使用
修饰符和类型类说明classAMethodVisitorthat checks that its methods are properly used.final classAMethodVisitorthat prints the methods it visits with aPrinter.修饰符和类型方法说明CheckClassAdapter.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) TraceClassVisitor.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) 参数类型为MethodVisitor的cn.taketoday.bytecode.util中的构造器限定符构造器说明CheckMethodAdapter(int access, String name, String descriptor, MethodVisitor methodVisitor, Map<Label, Integer> labelInsnIndices) Constructs a newCheckMethodAdapterobject.CheckMethodAdapter(MethodVisitor methodvisitor) Constructs a newCheckMethodAdapterobject.CheckMethodAdapter(MethodVisitor methodVisitor, Map<Label, Integer> labelInsnIndices) Constructs a newCheckMethodAdapterobject.TraceMethodVisitor(MethodVisitor methodVisitor, Printer printer) Constructs a newTraceMethodVisitor. -
cn.taketoday.expression.spel中MethodVisitor的使用
修饰符和类型方法说明voidCompilablePropertyAccessor.generateCode(String propertyName, MethodVisitor mv, CodeFlow cf) Generate the bytecode the performs the access operation into the specified MethodVisitor using context information from the codeflow where necessary. -
cn.taketoday.expression.spel.ast中MethodVisitor的使用
修饰符和类型方法说明voidBooleanLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidCompoundExpression.generateCode(MethodVisitor mv, CodeFlow cf) voidConstructorReference.generateCode(MethodVisitor mv, CodeFlow cf) voidElvis.generateCode(MethodVisitor mv, CodeFlow cf) voidFloatLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidFunctionReference.generateCode(MethodVisitor mv, CodeFlow cf) voidIndexer.generateCode(MethodVisitor mv, CodeFlow cf) voidInlineList.generateCode(MethodVisitor mv, CodeFlow codeflow) voidIntLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidLongLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidMethodReference.generateCode(MethodVisitor mv, CodeFlow cf) voidNullLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidOpAnd.generateCode(MethodVisitor mv, CodeFlow cf) voidOpDivide.generateCode(MethodVisitor mv, CodeFlow cf) voidOpEQ.generateCode(MethodVisitor mv, CodeFlow cf) voidOperatorInstanceof.generateCode(MethodVisitor mv, CodeFlow cf) voidOperatorNot.generateCode(MethodVisitor mv, CodeFlow cf) voidOpGE.generateCode(MethodVisitor mv, CodeFlow cf) voidOpGT.generateCode(MethodVisitor mv, CodeFlow cf) voidOpLE.generateCode(MethodVisitor mv, CodeFlow cf) voidOpLT.generateCode(MethodVisitor mv, CodeFlow cf) voidOpMinus.generateCode(MethodVisitor mv, CodeFlow cf) voidOpModulus.generateCode(MethodVisitor mv, CodeFlow cf) voidOpMultiply.generateCode(MethodVisitor mv, CodeFlow cf) voidOpNE.generateCode(MethodVisitor mv, CodeFlow cf) voidOpOr.generateCode(MethodVisitor mv, CodeFlow cf) voidOpPlus.generateCode(MethodVisitor mv, CodeFlow cf) voidPropertyOrFieldReference.generateCode(MethodVisitor mv, CodeFlow cf) voidRealLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidSpelNodeImpl.generateCode(MethodVisitor mv, CodeFlow cf) Generate the bytecode for this node into the supplied visitor.voidStringLiteral.generateCode(MethodVisitor mv, CodeFlow cf) voidTernary.generateCode(MethodVisitor mv, CodeFlow cf) voidTypeReference.generateCode(MethodVisitor mv, CodeFlow cf) voidVariableReference.generateCode(MethodVisitor mv, CodeFlow cf) protected static voidSpelNodeImpl.generateCodeForArgument(MethodVisitor mv, CodeFlow cf, SpelNodeImpl argument, String paramDesc) Ask an argument to generate its bytecode and then follow it up with any boxing/unboxing/checkcasting to ensure it matches the expected parameter descriptor.protected static voidSpelNodeImpl.generateCodeForArguments(MethodVisitor mv, CodeFlow cf, Member member, SpelNodeImpl[] arguments) Generate code that handles building the argument values for the specified method.protected voidOperator.generateComparisonCode(MethodVisitor mv, CodeFlow cf, int compInstruction1, int compInstruction2) Numeric comparison operators share very similar generated code, only differing in two comparison instructions. -
cn.taketoday.expression.spel.support中MethodVisitor的使用
修饰符和类型方法说明voidReflectivePropertyAccessor.OptimalPropertyAccessor.generateCode(String propertyName, MethodVisitor mv, CodeFlow cf)