void visit(int version, int access, String name, String signature, String superName, String[] interfaces); // sourceFile, sourceDebug void visitSource(String source, String debug); // EnclosingMethod attribute: enclosingOwner, enclosingName, enclosingDesc. // Note: only when the class has EnclosingMethod attribute, meaning the class is a local class or an anonymous class void visitOuterClass(String owner, String name, String desc);
AnnotationVisitor visitAnnotation(String desc, boolean visible);
public interface AnnotationVisitor {
// 对基本类型的数组,依然采用该方法,visitArray只是在非基本类型时调用。
void visit(String name, Object value);
void visitEnum(String name, String desc, String value);
AnnotationVisitor visitAnnotation(String name, String desc);
AnnotationVisitor visitArray(String name);
void visitEnd();
}
void visitAttribute(Attribute attr);
public class Attribute {
public final String type;
byte[] value;
Attribute next;
}
void visitInnerClass(String name, String outerName, String innerName, int access);
// 其中value为静态字段的初始化值(对非静态字段,它的初始化必须由构造函数实现),如果没有初始化值,该值为null。 FieldVisitor visitField(int access, String name, String desc, String signature, Object value);
public interface FieldVisitor {
AnnotationVisitor visitAnnotation(String desc, boolean visible);
void visitAttribute(Attribute attr);
void visitEnd();
}
MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions);
public interface MethodVisitor {
AnnotationVisitor visitAnnotationDefault();
AnnotationVisitor visitAnnotation(String desc, boolean visible);
AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible);
void visitAttribute(Attribute attr);
}
void visitTryCatchBlock(Label start, Label end, Label handler, String type);
/**
* A label represents a position in the bytecode of a method. Labels are used
* for jump, goto, and switch instructions, and for try catch blocks.
*
* @author Eric Bruneton
*/
public class Label {
public Object info;
int status;
int line;
int position;
private int referenceCount;
private int[] srcAndRefPositions;
int inputStackTop;
int outputStackMax;
Frame frame;
Label successor;
Edge successors;
Label next;
}
void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack); // Visits a zero operand instruction. void visitInsn(int opcode); // Visits an instruction with a single int operand. void visitIntInsn(int opcode, int operand); // Visits a local variable instruction. A local variable instruction is an instruction that loads or stores the value of a local variable. void visitVarInsn(int opcode, int var); // Visits a type instruction. A type instruction is an instruction that takes the internal name of a class as parameter. void visitTypeInsn(int opcode, String type); // Visits a field instruction. A field instruction is an instruction that loads or stores the value of a field of an object. void visitFieldInsn(int opcode, String owner, String name, String desc); // Visits a method instruction. A method instruction is an instruction that invokes a method. void visitMethodInsn(int opcode, String owner, String name, String desc); // Visits a jump instruction. A jump instruction is an instruction that may jump to another instruction. void visitJumpInsn(int opcode, Label label); // Visits a label. A label designates the instruction that will be visited just after it. void visitLabel(Label label); // Visits a LDC instruction. void visitLdcInsn(Object cst); // Visits an IINC instruction. void visitIincInsn(int var, int increment); // Visits a TABLESWITCH instruction. void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels); // Visits a LOOKUPSWITCH instruction. void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels); // Visits a MULTIANEWARRAY instruction. void visitMultiANewArrayInsn(String desc, int dims); // Visits a try catch block. void visitTryCatchBlock(Label start, Label end, Label handler, String type); void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index); // Visits a line number declaration. void visitLineNumber(int line, Label start); // Visits the maximum stack size and the maximum number of local variables of the method. void visitMaxs(int maxStack, int maxLocals);
void visitEnd();
public class ClassWriter implements ClassVisitor {
//The class reader from which this class writer was constructed, if any.
ClassReader cr;
//Minor and major version numbers of the class to be generated.
int version;
//Index of the next item to be added in the constant pool.
int index;
//The constant pool of this class.
final ByteVector pool;
//The constant pool's hash table data.
Item[] items;
//The threshold of the constant pool's hash table.
int threshold;
//A reusable key used to look for items in the {@link #items} hash table.
final Item key;
//A reusable key used to look for items in the {@link #items} hash table.
final Item key2;
//A reusable key used to look for items in the {@link #items} hash table.
final Item key3;
//A type table used to temporarily store internal names that will not necessarily be stored in the constant pool.
Item[] typeTable;
//Number of elements in the {@link #typeTable} array.
private short typeCount;
//The access flags of this class.
private int access;
//The constant pool item that contains the internal name of this class.
private int name;
//The internal name of this class.
String thisName;
//The constant pool item that contains the signature of this class.
private int signature;
//The constant pool item that contains the internal name of the super class of this class.
private int superName;
// Number of interfaces implemented or extended by this class or interface.
private int interfaceCount;
//The interfaces implemented or extended by this class or interface.
private int[] interfaces;
//The index of the constant pool item that contains the name of the source file from which this class was compiled.
private int sourceFile;
//The SourceDebug attribute of this class.
private ByteVector sourceDebug;
//The constant pool item that contains the name of the enclosing class of this class.
private int enclosingMethodOwner;
//The constant pool item that contains the name and descriptor of the enclosing method of this class.
private int enclosingMethod;
//The runtime visible annotations of this class.
private AnnotationWriter anns;
//The runtime invisible annotations of this class.
private AnnotationWriter ianns;
//The non standard attributes of this class.
private Attribute attrs;
//The number of entries in the InnerClasses attribute.
private int innerClassesCount;
//The InnerClasses attribute.
private ByteVector innerClasses;
//The fields of this class. These fields are stored in a linked list of {@link FieldWriter} objects, linked to each other by their {@link FieldWriter#next} field. This field stores the first element of this list.
FieldWriter firstField;
//This field stores the last element of this list.
FieldWriter lastField;
//The methods of this class. These methods are stored in a linked list of {@link MethodWriter} objects, linked to each other by their {@link MethodWriter#next} field. This field stores the first element of this list.
MethodWriter firstMethod;
//This field stores the last element of this list.
MethodWriter lastMethod;
//true if the maximum stack size and number of local variables must be automatically computed.
private final boolean computeMaxs;
//true if the stack map frames must be recomputed from scratch.
private final boolean computeFrames;
//true if the stack map tables of this class are invalid.
boolean invalidFrames;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有