类 ASMifier
java.lang.Object
cn.taketoday.bytecode.util.Printer
cn.taketoday.bytecode.util.ASMifier
A
Printer that prints the ASM code to generate the classes if visits.- 作者:
- Eric Bruneton
-
字段概要
字段修饰符和类型字段说明private static final intA pseudo access flag used to distinguish class access flags.private static final intA pseudo access flag used to distinguish field access flags.private static final intA pseudo access flag used to distinguish inner class flags.private static final intA pseudo access flag used to distinguish module requires / exports flags.private static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprotected final intThe identifier of the annotation visitor variable in the produced code.The name of the Label variables in the produced code.protected final StringThe name of the visitor variable in the produced code.private static final Stringprivate static final StringThe help message shown when command line arguments are incorrect.private static final String从类继承的字段 cn.taketoday.bytecode.util.Printer
HANDLE_TAG, OPCODES, stringBuilder, text, TYPES -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private voidappendAccessFlags(int accessFlags) Appends a string representation of the given access flags toPrinter.stringBuilder.protected voidappendConstant(Object value) Appends a string representation of the given constant toPrinter.stringBuilder.private voidappendFrameTypes(int numTypes, Object[] frameTypes) Appends the given stack map frame types toPrinter.stringBuilder.protected voidappendLabel(Label label) Appends the name of the given label toPrinter.stringBuilder.protected ASMifiercreateASMifier(String visitorVariableName, int annotationVisitorId) Constructs a newASMifier.private voiddeclareFrameTypes(int numTypes, Object[] frameTypes) CallsdeclareLabel(cn.taketoday.bytecode.Label)for each label in the given stack map frame types.protected voiddeclareLabel(Label label) Appends a declaration of the given label toPrinter.stringBuilder.static voidPrints the ASM source code to generate the given class to the standard output.(专用程序包) static voidmain(String[] args, PrintWriter output, PrintWriter logger) Prints the ASM source code to generate the given class to the given output.voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces) Class header.voidAnnotation value.visitAnnotableParameterCount(int parameterCount, boolean visible) Number of method parameters that can have annotations.visitAnnotation(String descriptor, boolean visible) Visits a class, field or method annotation.visitAnnotation(String name, String descriptor) Nested annotation value.Method default annotation.voidAnnotation end.visitArray(String name) Annotation array value.voidvisitAttribute(Attribute attribute) Visit a class, field or method attribute.visitClassAnnotation(String descriptor, boolean visible) Class annotation.voidvisitClassAttribute(Attribute attribute) Class attribute.voidClass end.visitClassTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Class type annotation.voidMethod start.voidAnnotation enum value.voidvisitExport(String packaze, int access, String... modules) Module export.private voidvisitExportOrOpen(String visitMethod, String packaze, int access, String... modules) visitField(int access, String name, String descriptor, String signature, Object value) Class field.visitFieldAnnotation(String descriptor, boolean visible) Field annotation.voidvisitFieldAttribute(Attribute attribute) Field attribute.voidField end.voidvisitFieldInsn(int opcode, String owner, String name, String descriptor) Method instruction.visitFieldTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Field type annotation.voidvisitFrame(int type, int numLocal, Object[] local, int numStack, Object[] stack) Method stack frame.voidvisitIincInsn(int var, int increment) Method instruction.voidvisitInnerClass(String name, String outerName, String innerName, int access) Class inner name.voidvisitInsn(int opcode) Method instruction.visitInsnAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Instruction type annotation.voidvisitIntInsn(int opcode, int operand) Method instruction.voidvisitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) Method instruction.voidvisitJumpInsn(int opcode, Label label) Method jump instruction.voidvisitLabel(Label label) Method label.voidvisitLdcInsn(Object value) Method instruction.voidvisitLineNumber(int line, Label start) Method debug info.voidvisitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) Method debug info.visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String descriptor, boolean visible) Local variable type annotation.voidvisitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) Method instruction.voidvisitMainClass(String mainClass) Module main class.voidvisitMaxs(int maxStack, int maxLocals) Method max stack and max locals.private voidVisits the end of a field, record component or method.visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) Class method.visitMethodAnnotation(String descriptor, boolean visible) Method annotation.voidvisitMethodAttribute(Attribute attribute) Method attribute.voidMethod end.voidvisitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) Method instruction.visitMethodTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Method type annotation.visitModule(String name, int flags, String version) Module.voidModule end.voidvisitMultiANewArrayInsn(String descriptor, int numDimensions) Method instruction.voidvisitNestHost(String nestHost) Visits the nest host class of the class.voidvisitNestMember(String nestMember) Visits a member of the nest.voidModule open.voidvisitOuterClass(String owner, String name, String descriptor) Class outer class.voidvisitPackage(String packaze) Module package.voidvisitParameter(String parameterName, int access) Method parameter.visitParameterAnnotation(int parameter, String descriptor, boolean visible) Method parameter annotation.voidvisitPermittedSubclass(String permittedSubclass) Visits a permitted subclasses.voidvisitProvide(String service, String... providers) Module provide.visitRecordComponent(String name, String descriptor, String signature) Visits a record component of the class.visitRecordComponentAnnotation(String descriptor, boolean visible) Visits an annotation of the record component.voidvisitRecordComponentAttribute(Attribute attribute) Visits a non standard attribute of the record component.voidVisits the end of the record component.visitRecordComponentTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Visits an annotation on a type in the record component signature.voidvisitRequire(String module, int access, String version) Module require.voidvisitSource(String file, String debug) Class source.voidvisitTableSwitchInsn(int min, int max, Label dflt, Label... labels) Method instruction.visitTryCatchAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Try catch block type annotation.voidvisitTryCatchBlock(Label start, Label end, Label handler, String type) Method exception handler.visitTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Visits a class, field or method type annotation.visitTypeAnnotation(String method, int typeRef, TypePath typePath, String descriptor, boolean visible) Visits a class, field, method, instruction or try catch block type annotation.voidvisitTypeInsn(int opcode, String type) Method instruction.voidModule use.voidvisitVarInsn(int opcode, int var) Method instruction.从类继承的方法 cn.taketoday.bytecode.util.Printer
appendString, getText, main, print, printList, visitMethodInsn
-
字段详细资料
-
USAGE
The help message shown when command line arguments are incorrect.- 另请参阅:
-
ACCESS_CLASS
private static final int ACCESS_CLASSA pseudo access flag used to distinguish class access flags.- 另请参阅:
-
ACCESS_FIELD
private static final int ACCESS_FIELDA pseudo access flag used to distinguish field access flags.- 另请参阅:
-
ACCESS_INNER
private static final int ACCESS_INNERA pseudo access flag used to distinguish inner class flags.- 另请参阅:
-
ACCESS_MODULE
private static final int ACCESS_MODULEA pseudo access flag used to distinguish module requires / exports flags.- 另请参阅:
-
ANNOTATION_VISITOR
- 另请参阅:
-
ANNOTATION_VISITOR0
- 另请参阅:
-
COMMA
- 另请参阅:
-
END_ARRAY
- 另请参阅:
-
END_PARAMETERS
- 另请参阅:
-
NEW_OBJECT_ARRAY
- 另请参阅:
-
VISIT_END
- 另请参阅:
-
FRAME_TYPES
-
CLASS_VERSIONS
-
name
The name of the visitor variable in the produced code. -
id
protected final int idThe identifier of the annotation visitor variable in the produced code. -
labelNames
The name of the Label variables in the produced code.
-
-
构造器详细资料
-
方法详细资料
-
main
Prints the ASM source code to generate the given class to the standard output.Usage: ASMifier [-nodebug] <binary class name or class file name>
- 参数:
args- the command line arguments.- 抛出:
IOException- if the class cannot be found, or if an IOException occurs.
-
main
Prints the ASM source code to generate the given class to the given output.Usage: ASMifier [-nodebug] <binary class name or class file name>
- 参数:
args- the command line arguments.output- where to print the result.logger- where to log errors.- 抛出:
IOException- if the class cannot be found, or if an IOException occurs.
-
visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) 从类复制的说明:PrinterClass header. SeeClassVisitor.visit(int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).- 指定者:
visit在类中Printer- 参数:
version- the class version. The minor version is stored in the 16 most significant bits, and the major version in the 16 least significant bits.access- the class's access flags (seeOpcodes). This parameter also indicates if the class is deprecated.name- the internal name of the class (seeType.getInternalName()).signature- the signature of this class. May be null if the class is not a generic one, and does not extend or implement generic classes or interfaces.superName- the internal of name of the super class (seeType.getInternalName()). For interfaces, the super class isObject. May be null, but only for theObjectclass.interfaces- the internal names of the class's interfaces (seeType.getInternalName()). May be null.
-
visitSource
从类复制的说明:PrinterClass source. SeeClassVisitor.visitSource(java.lang.String, java.lang.String).- 指定者:
visitSource在类中Printer- 参数:
file- the name of the source file from which the class was compiled. May be null.debug- additional debug information to compute the correspondence between source and compiled elements of the class. May be null.
-
visitModule
从类复制的说明:Printer- 覆盖:
visitModule在类中Printer- 参数:
name- the fully qualified name (using dots) of the module.flags- the module access flags, amongACC_OPEN,ACC_SYNTHETICandACC_MANDATED.version- the module version, or null.- 返回:
- the printer.
-
visitNestHost
从类复制的说明:PrinterVisits the nest host class of the class. A nest is a set of classes of the same package that share access to their private members. One of these classes, called the host, lists the other members of the nest, which in turn should link to the host of their nest. This method must be called only once and only if the visited class is a non-host member of a nest. A class is implicitly its own nest, so it's invalid to call this method with the visited class name as argument.- 覆盖:
visitNestHost在类中Printer- 参数:
nestHost- the internal name of the host class of the nest.
-
visitOuterClass
从类复制的说明:PrinterClass outer class. SeeClassVisitor.visitOuterClass(java.lang.String, java.lang.String, java.lang.String).- 指定者:
visitOuterClass在类中Printer- 参数:
owner- internal name of the enclosing class of the class.name- the name of the method that contains the class, or null if the class is not enclosed in a method of its enclosing class.descriptor- the descriptor of the method that contains the class, or null if the class is not enclosed in a method of its enclosing class.
-
visitClassAnnotation
从类复制的说明:PrinterClass annotation. SeeClassVisitor.visitAnnotation(java.lang.String, boolean).- 指定者:
visitClassAnnotation在类中Printer- 参数:
descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitClassTypeAnnotation
public ASMifier visitClassTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) 从类复制的说明:PrinterClass type annotation. SeeClassVisitor.visitTypeAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitClassTypeAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.CLASS_TYPE_PARAMETER,TypeReference.CLASS_TYPE_PARAMETER_BOUNDorTypeReference.CLASS_EXTENDS. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitClassAttribute
从类复制的说明:PrinterClass attribute. SeeClassVisitor.visitAttribute(cn.taketoday.bytecode.Attribute).- 指定者:
visitClassAttribute在类中Printer- 参数:
attribute- an attribute.
-
visitNestMember
从类复制的说明:PrinterVisits a member of the nest. A nest is a set of classes of the same package that share access to their private members. One of these classes, called the host, lists the other members of the nest, which in turn should link to the host of their nest. This method must be called only if the visited class is the host of a nest. A nest host is implicitly a member of its own nest, so it's invalid to call this method with the visited class name as argument.- 覆盖:
visitNestMember在类中Printer- 参数:
nestMember- the internal name of a nest member.
-
visitPermittedSubclass
从类复制的说明:PrinterVisits a permitted subclasses. A permitted subclass is one of the allowed subclasses of the current class. SeeClassVisitor.visitPermittedSubclass(String).- 覆盖:
visitPermittedSubclass在类中Printer- 参数:
permittedSubclass- the internal name of a permitted subclass.
-
visitInnerClass
从类复制的说明:PrinterClass inner name. SeeClassVisitor.visitInnerClass(java.lang.String, java.lang.String, java.lang.String, int).- 指定者:
visitInnerClass在类中Printer- 参数:
name- the internal name of an inner class (seeType.getInternalName()).outerName- the internal name of the class to which the inner class belongs (seeType.getInternalName()). May be null for not member classes.innerName- the (simple) name of the inner class inside its enclosing class. May be null for anonymous inner classes.access- the access flags of the inner class as originally declared in the enclosing class.
-
visitRecordComponent
从类复制的说明:PrinterVisits a record component of the class. SeeClassVisitor.visitRecordComponent(String, String, String).- 覆盖:
visitRecordComponent在类中Printer- 参数:
name- the field's name.descriptor- the record component descriptor (seeType).signature- the record component signature. May be null if the record component type does not use generic types.- 返回:
- a visitor to visit this record component annotations and attributes, or null if this class visitor is not interested in visiting these annotations and attributes.
-
visitField
public ASMifier visitField(int access, String name, String descriptor, String signature, Object value) 从类复制的说明:PrinterClass field. SeeClassVisitor.visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object).- 指定者:
visitField在类中Printer- 参数:
access- the field's access flags (seeOpcodes). This parameter also indicates if the field is synthetic and/or deprecated.name- the field's name.descriptor- the field's descriptor (seeType).signature- the field's signature. May be null if the field's type does not use generic types.value- the field's initial value. This parameter, which may be null if the field does not have an initial value, must be anInteger, aFloat, aLong, aDoubleor aString(forint,float,longorStringfields respectively). This parameter is only used for static fields. Its value is ignored for non static fields, which must be initialized through bytecode instructions in constructors or methods.- 返回:
- the printer.
-
visitMethod
public ASMifier visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) 从类复制的说明:PrinterClass method. SeeClassVisitor.visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).- 指定者:
visitMethod在类中Printer- 参数:
access- the method's access flags (seeOpcodes). This parameter also indicates if the method is synthetic and/or deprecated.name- the method's name.descriptor- the method's descriptor (seeType).signature- the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.exceptions- the internal names of the method's exception classes (seeType.getInternalName()). May be null.- 返回:
- the printer.
-
visitClassEnd
public void visitClassEnd()从类复制的说明:PrinterClass end. SeeClassVisitor.visitEnd().- 指定者:
visitClassEnd在类中Printer
-
visitMainClass
从类复制的说明:PrinterModule main class. SeeModuleVisitor.visitMainClass(java.lang.String).- 覆盖:
visitMainClass在类中Printer- 参数:
mainClass- the internal name of the main class of the current module.
-
visitPackage
从类复制的说明:PrinterModule package. SeeModuleVisitor.visitPackage(java.lang.String).- 覆盖:
visitPackage在类中Printer- 参数:
packaze- the internal name of a package.
-
visitRequire
从类复制的说明:PrinterModule require. SeeModuleVisitor.visitRequire(java.lang.String, int, java.lang.String).- 覆盖:
visitRequire在类中Printer- 参数:
module- the fully qualified name (using dots) of the dependence.access- the access flag of the dependence amongACC_TRANSITIVE,ACC_STATIC_PHASE,ACC_SYNTHETICandACC_MANDATED.version- the module version at compile time, or null.
-
visitExport
从类复制的说明:PrinterModule export. SeeModuleVisitor.visitExport(java.lang.String, int, java.lang.String...).- 覆盖:
visitExport在类中Printer- 参数:
packaze- the internal name of the exported package.access- the access flag of the exported package, valid values are amongACC_SYNTHETICandACC_MANDATED.modules- the fully qualified names (using dots) of the modules that can access the public classes of the exported package, or null.
-
visitOpen
从类复制的说明:PrinterModule open. SeeModuleVisitor.visitOpen(java.lang.String, int, java.lang.String...).- 覆盖:
visitOpen在类中Printer- 参数:
packaze- the internal name of the opened package.access- the access flag of the opened package, valid values are amongACC_SYNTHETICandACC_MANDATED.modules- the fully qualified names (using dots) of the modules that can use deep reflection to the classes of the open package, or null.
-
visitExportOrOpen
-
visitUse
从类复制的说明:PrinterModule use. SeeModuleVisitor.visitUse(java.lang.String). -
visitProvide
从类复制的说明:PrinterModule provide. SeeModuleVisitor.visitProvide(java.lang.String, java.lang.String...).- 覆盖:
visitProvide在类中Printer- 参数:
service- the internal name of the service.providers- the internal names of the implementations of the service (there is at least one provider).
-
visitModuleEnd
public void visitModuleEnd()从类复制的说明:PrinterModule end. SeeModuleVisitor.visitEnd().- 覆盖:
visitModuleEnd在类中Printer
-
visit
从类复制的说明:PrinterAnnotation value. SeeAnnotationVisitor.visit(java.lang.String, java.lang.Object).- 指定者:
visit在类中Printer- 参数:
name- the value name.value- the actual value, whose type must beByte,Boolean,Character,Short,Integer,Long,Float,Double,StringorTypeofType.OBJECTorType.ARRAYsort. This value can also be an array of byte, boolean, short, char, int, long, float or double values (this is equivalent to usingPrinter.visitArray(java.lang.String)and visiting each array element in turn, but is more convenient).
-
visitEnum
从类复制的说明:PrinterAnnotation enum value. SeeAnnotationVisitor.visitEnum(java.lang.String, java.lang.String, java.lang.String). -
visitAnnotation
从类复制的说明:PrinterNested annotation value. SeeAnnotationVisitor.visitAnnotation(java.lang.String, java.lang.String).- 指定者:
visitAnnotation在类中Printer- 参数:
name- the value name.descriptor- the class descriptor of the nested annotation class.- 返回:
- the printer.
-
visitArray
从类复制的说明:PrinterAnnotation array value. SeeAnnotationVisitor.visitArray(java.lang.String).- 指定者:
visitArray在类中Printer- 参数:
name- the value name.- 返回:
- the printer.
-
visitAnnotationEnd
public void visitAnnotationEnd()从类复制的说明:PrinterAnnotation end. SeeAnnotationVisitor.visitEnd().- 指定者:
visitAnnotationEnd在类中Printer
-
visitRecordComponentAnnotation
从类复制的说明:PrinterVisits an annotation of the record component. SeeRecordComponentVisitor.visitAnnotation(java.lang.String, boolean).- 覆盖:
visitRecordComponentAnnotation在类中Printer- 参数:
descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
-
visitRecordComponentTypeAnnotation
public ASMifier visitRecordComponentTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) 从类复制的说明:PrinterVisits an annotation on a type in the record component signature. SeeRecordComponentVisitor.visitTypeAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitRecordComponentTypeAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.CLASS_TYPE_PARAMETER,TypeReference.CLASS_TYPE_PARAMETER_BOUNDorTypeReference.CLASS_EXTENDS. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
-
visitRecordComponentAttribute
从类复制的说明:PrinterVisits a non standard attribute of the record component. SeeRecordComponentVisitor.visitAttribute(cn.taketoday.bytecode.Attribute).- 覆盖:
visitRecordComponentAttribute在类中Printer- 参数:
attribute- an attribute.
-
visitRecordComponentEnd
public void visitRecordComponentEnd()从类复制的说明:PrinterVisits the end of the record component. SeeRecordComponentVisitor.visitEnd(). This method, which is the last one to be called, is used to inform the visitor that everything have been visited.- 覆盖:
visitRecordComponentEnd在类中Printer
-
visitFieldAnnotation
从类复制的说明:PrinterField annotation. SeeFieldVisitor.visitAnnotation(java.lang.String, boolean).- 指定者:
visitFieldAnnotation在类中Printer- 参数:
descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitFieldTypeAnnotation
public ASMifier visitFieldTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) 从类复制的说明:PrinterField type annotation. SeeFieldVisitor.visitTypeAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitFieldTypeAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.FIELD. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitFieldAttribute
从类复制的说明:PrinterField attribute. SeeFieldVisitor.visitAttribute(cn.taketoday.bytecode.Attribute).- 指定者:
visitFieldAttribute在类中Printer- 参数:
attribute- an attribute.
-
visitFieldEnd
public void visitFieldEnd()从类复制的说明:PrinterField end. SeeFieldVisitor.visitEnd().- 指定者:
visitFieldEnd在类中Printer
-
visitParameter
从类复制的说明:PrinterMethod parameter. SeeMethodVisitor.visitParameter(String, int).- 覆盖:
visitParameter在类中Printer- 参数:
parameterName- parameter name or null if none is provided.access- the parameter's access flags, onlyACC_FINAL,ACC_SYNTHETICor/andACC_MANDATEDare allowed (seeOpcodes).
-
visitAnnotationDefault
从类复制的说明:PrinterMethod default annotation. SeeMethodVisitor.visitAnnotationDefault().- 指定者:
visitAnnotationDefault在类中Printer- 返回:
- the printer.
-
visitMethodAnnotation
从类复制的说明:PrinterMethod annotation. SeeMethodVisitor.visitAnnotation(java.lang.String, boolean).- 指定者:
visitMethodAnnotation在类中Printer- 参数:
descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitMethodTypeAnnotation
public ASMifier visitMethodTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) 从类复制的说明:PrinterMethod type annotation. SeeMethodVisitor.visitTypeAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitMethodTypeAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.METHOD_TYPE_PARAMETER,TypeReference.METHOD_TYPE_PARAMETER_BOUND,TypeReference.METHOD_RETURN,TypeReference.METHOD_RECEIVER,TypeReference.METHOD_FORMAL_PARAMETERorTypeReference.THROWS. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitAnnotableParameterCount
从类复制的说明:PrinterNumber of method parameters that can have annotations. SeeMethodVisitor.visitAnnotableParameterCount(int, boolean).- 覆盖:
visitAnnotableParameterCount在类中Printer- 参数:
parameterCount- the number of method parameters than can have annotations. This number must be less or equal than the number of parameter types in the method descriptor. It can be strictly less when a method has synthetic parameters and when these parameters are ignored when computing parameter indices for the purpose of parameter annotations (see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).visible- true to define the number of method parameters that can have annotations visible at runtime, false to define the number of method parameters that can have annotations invisible at runtime.- 返回:
- the printer.
-
visitParameterAnnotation
从类复制的说明:PrinterMethod parameter annotation. SeeMethodVisitor.visitParameterAnnotation(int, java.lang.String, boolean).- 指定者:
visitParameterAnnotation在类中Printer- 参数:
parameter- the parameter index. This index must be strictly smaller than the number of parameters in the method descriptor, and strictly smaller than the parameter count specified inPrinter.visitAnnotableParameterCount(int, boolean). Important note: a parameter index i is not required to correspond to the i'th parameter descriptor in the method descriptor, in particular in case of synthetic parameters (see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitMethodAttribute
从类复制的说明:PrinterMethod attribute. SeeMethodVisitor.visitAttribute(cn.taketoday.bytecode.Attribute).- 指定者:
visitMethodAttribute在类中Printer- 参数:
attribute- an attribute.
-
visitCode
public void visitCode()从类复制的说明:PrinterMethod start. SeeMethodVisitor.visitCode(). -
visitFrame
从类复制的说明:PrinterMethod stack frame. SeeMethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[]).- 指定者:
visitFrame在类中Printer- 参数:
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.numLocal- 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).numStack- 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.
-
visitInsn
public void visitInsn(int opcode) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitInsn(int)- 指定者:
visitInsn在类中Printer- 参数:
opcode- the opcode of the instruction to be visited. This opcode is either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER, or MONITOREXIT.
-
visitIntInsn
public void visitIntInsn(int opcode, int operand) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitIntInsn(int, int).- 指定者:
visitIntInsn在类中Printer- 参数:
opcode- the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH or NEWARRAY.operand- the operand of the instruction to be visited.
When opcode is BIPUSH, operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE.
When opcode is SIPUSH, operand value should be between Short.MIN_VALUE and Short.MAX_VALUE.
When opcode is NEWARRAY, operand value should be one ofOpcodes.T_BOOLEAN,Opcodes.T_CHAR,Opcodes.T_FLOAT,Opcodes.T_DOUBLE,Opcodes.T_BYTE,Opcodes.T_SHORT,Opcodes.T_INTorOpcodes.T_LONG.
-
visitVarInsn
public void visitVarInsn(int opcode, int var) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitVarInsn(int, int).- 指定者:
visitVarInsn在类中Printer- 参数:
opcode- the opcode of the local variable instruction to be visited. This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.var- the operand of the instruction to be visited. This operand is the index of a local variable.
-
visitTypeInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitTypeInsn(int, java.lang.String).- 指定者:
visitTypeInsn在类中Printer- 参数:
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 (seeType.getInternalName()).
-
visitFieldInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitFieldInsn(int, java.lang.String, java.lang.String, java.lang.String).- 指定者:
visitFieldInsn在类中Printer- 参数:
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 (seeType.getInternalName()).name- the field's name.descriptor- the field's descriptor (seeType).
-
visitMethodInsn
public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitMethodInsn(int, java.lang.String, java.lang.String, java.lang.String).- 覆盖:
visitMethodInsn在类中Printer- 参数:
opcode- the opcode of the type instruction to be visited. This opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.owner- the internal name of the method's owner class (seeType.getInternalName()).name- the method's name.descriptor- the method's descriptor (seeType).isInterface- if the method's owner class is an interface.
-
visitInvokeDynamicInsn
public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitInvokeDynamicInsn(java.lang.String, java.lang.String, cn.taketoday.bytecode.Handle, java.lang.Object...).- 指定者:
visitInvokeDynamicInsn在类中Printer- 参数:
name- the method's name.descriptor- the method's descriptor (seeType).bootstrapMethodHandle- the bootstrap method.bootstrapMethodArguments- the bootstrap method constant arguments. Each argument must be anInteger,Float,Long,Double,String,TypeorHandlevalue. This method is allowed to modify the content of the array so a caller should expect that this array may change.
-
visitJumpInsn
从类复制的说明:PrinterMethod jump instruction. SeeMethodVisitor.visitJumpInsn(int, cn.taketoday.bytecode.Label).- 指定者:
visitJumpInsn在类中Printer- 参数:
opcode- the opcode of the type instruction to be visited. This opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.label- the operand of the instruction to be visited. This operand is a label that designates the instruction to which the jump instruction may jump.
-
visitLabel
从类复制的说明:PrinterMethod label. SeeMethodVisitor.visitLabel(cn.taketoday.bytecode.Label).- 指定者:
visitLabel在类中Printer- 参数:
label- aLabelobject.
-
visitLdcInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitLdcInsn(java.lang.Object).- 指定者:
visitLdcInsn在类中Printer- 参数:
value- the constant to be loaded on the stack. This parameter must be a non nullInteger, aFloat, aLong, aDouble, aString, aTypeof OBJECT or ARRAY sort for.classconstants, for classes whose version is 49, aTypeof METHOD sort for MethodType, aHandlefor MethodHandle constants, for classes whose version is 51 or aConstantDynamicfor a constant dynamic for classes whose version is 55.
-
visitIincInsn
public void visitIincInsn(int var, int increment) 从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitIincInsn(int, int).- 指定者:
visitIincInsn在类中Printer- 参数:
var- index of the local variable to be incremented.increment- amount to increment the local variable by.
-
visitTableSwitchInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitTableSwitchInsn(int, int, cn.taketoday.bytecode.Label, cn.taketoday.bytecode.Label...).- 指定者:
visitTableSwitchInsn在类中Printer- 参数:
min- the minimum key value.max- the maximum key value.dflt- beginning of the default handler block.labels- beginnings of the handler blocks.labels[i]is the beginning of the handler block for themin + ikey.
-
visitLookupSwitchInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitLookupSwitchInsn(cn.taketoday.bytecode.Label, int[], cn.taketoday.bytecode.Label[]).- 指定者:
visitLookupSwitchInsn在类中Printer- 参数:
dflt- beginning of the default handler block.keys- the values of the keys.labels- beginnings of the handler blocks.labels[i]is the beginning of the handler block for thekeys[i]key.
-
visitMultiANewArrayInsn
从类复制的说明:PrinterMethod instruction. SeeMethodVisitor.visitMultiANewArrayInsn(java.lang.String, int).- 指定者:
visitMultiANewArrayInsn在类中Printer- 参数:
descriptor- an array type descriptor (seeType).numDimensions- the number of dimensions of the array to allocate.
-
visitInsnAnnotation
public ASMifier visitInsnAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) 从类复制的说明:PrinterInstruction type annotation. SeeMethodVisitor.visitInsnAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitInsnAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.INSTANCEOF,TypeReference.NEW,TypeReference.CONSTRUCTOR_REFERENCE,TypeReference.METHOD_REFERENCE,TypeReference.CAST,TypeReference.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,TypeReference.METHOD_INVOCATION_TYPE_ARGUMENT,TypeReference.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, orTypeReference.METHOD_REFERENCE_TYPE_ARGUMENT. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitTryCatchBlock
从类复制的说明:PrinterMethod exception handler. SeeMethodVisitor.visitTryCatchBlock(cn.taketoday.bytecode.Label, cn.taketoday.bytecode.Label, cn.taketoday.bytecode.Label, java.lang.String).- 指定者:
visitTryCatchBlock在类中Printer- 参数:
start- the beginning of the exception handler's scope (inclusive).end- the end of the exception handler's scope (exclusive).handler- the beginning of the exception handler's code.type- the internal name of the type of exceptions handled by the handler, or null to catch any exceptions (for "finally" blocks).
-
visitTryCatchAnnotation
public ASMifier visitTryCatchAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) 从类复制的说明:PrinterTry catch block type annotation. SeeMethodVisitor.visitTryCatchAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitTryCatchAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.EXCEPTION_PARAMETER. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitLocalVariable
public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) 从类复制的说明:PrinterMethod debug info. SeeMethodVisitor.visitLocalVariable(java.lang.String, java.lang.String, java.lang.String, cn.taketoday.bytecode.Label, cn.taketoday.bytecode.Label, int).- 指定者:
visitLocalVariable在类中Printer- 参数:
name- the name of a local variable.descriptor- 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.
-
visitLocalVariableAnnotation
public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String descriptor, boolean visible) 从类复制的说明:PrinterLocal variable type annotation. SeeMethodVisitor.visitTryCatchAnnotation(int, cn.taketoday.bytecode.TypePath, java.lang.String, boolean).- 覆盖:
visitLocalVariableAnnotation在类中Printer- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.LOCAL_VARIABLEorTypeReference.RESOURCE_VARIABLE. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.start- the fist instructions corresponding to the continuous ranges that make the scope of this local variable (inclusive).end- the last instructions corresponding to the continuous ranges that make the scope of this local variable (exclusive). This array must have the same size as the 'start' array.index- the local variable's index in each range. This array must have the same size as the 'start' array.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- the printer.
-
visitLineNumber
从类复制的说明:PrinterMethod debug info. SeeMethodVisitor.visitLineNumber(int, cn.taketoday.bytecode.Label).- 指定者:
visitLineNumber在类中Printer- 参数:
line- a line number. This number refers to the source file from which the class was compiled.start- the first instruction corresponding to this line number.
-
visitMaxs
public void visitMaxs(int maxStack, int maxLocals) 从类复制的说明:PrinterMethod max stack and max locals. SeeMethodVisitor.visitMaxs(int, int). -
visitMethodEnd
public void visitMethodEnd()从类复制的说明:PrinterMethod end. SeeMethodVisitor.visitEnd().- 指定者:
visitMethodEnd在类中Printer
-
visitAnnotation
Visits a class, field or method annotation.- 参数:
descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- a new
ASMifierto visit the annotation values.
-
visitTypeAnnotation
public ASMifier visitTypeAnnotation(int typeRef, TypePath typePath, String descriptor, boolean visible) Visits a class, field or method type annotation.- 参数:
typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.FIELD. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- a new
ASMifierto visit the annotation values.
-
visitTypeAnnotation
public ASMifier visitTypeAnnotation(String method, int typeRef, TypePath typePath, String descriptor, boolean visible) Visits a class, field, method, instruction or try catch block type annotation.- 参数:
method- the name of the visit method for this type of annotation.typeRef- a reference to the annotated type. The sort of this type reference must beTypeReference.FIELD. SeeTypeReference.typePath- the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.descriptor- the class descriptor of the annotation class.visible- true if the annotation is visible at runtime.- 返回:
- a new
ASMifierto visit the annotation values.
-
visitAttribute
Visit a class, field or method attribute.- 参数:
attribute- an attribute.
-
visitMemberEnd
private void visitMemberEnd()Visits the end of a field, record component or method. -
createASMifier
Constructs a newASMifier.- 参数:
visitorVariableName- the name of the visitor variable in the produced code.annotationVisitorId- identifier of the annotation visitor variable in the produced code.- 返回:
- a new
ASMifier.
-
appendAccessFlags
private void appendAccessFlags(int accessFlags) Appends a string representation of the given access flags toPrinter.stringBuilder.- 参数:
accessFlags- some access flags.
-
appendConstant
Appends a string representation of the given constant toPrinter.stringBuilder. -
declareFrameTypes
CallsdeclareLabel(cn.taketoday.bytecode.Label)for each label in the given stack map frame types.- 参数:
numTypes- the number of stack map frame types in 'frameTypes'.frameTypes- an array of stack map frame types, in the format described inMethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[]).
-
appendFrameTypes
Appends the given stack map frame types toPrinter.stringBuilder.- 参数:
numTypes- the number of stack map frame types in 'frameTypes'.frameTypes- an array of stack map frame types, in the format described inMethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[]).
-
declareLabel
Appends a declaration of the given label toPrinter.stringBuilder. This declaration is of the form "Label labelXXX = new Label();". Does nothing if the given label has already been declared.- 参数:
label- a label.
-
appendLabel
Appends the name of the given label toPrinter.stringBuilder. The given label must already have a name. One way to ensure this is to always calldeclareLabel(cn.taketoday.bytecode.Label)before calling this method.- 参数:
label- a label.
-