72 73 /** 74 * The internal name of the field's owner class (see 75 * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}). 76 */ 77 public String owner; 78 79 /** 80 * The field's name. 81 */ 82 public String name; 83 84 /** 85 * The field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}). 86 */ 87 public String desc; 88 89 /** 90 * Constructs a new {@link FieldInsnNode}. 91 * 92 * @param opcode the opcode of the type instruction to be constructed. This 93 * opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. 94 * @param owner the internal name of the field's owner class (see 95 * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}). 96 * @param name the field's name. 97 * @param desc the field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}). 98 */ 99 public FieldInsnNode( 100 final int opcode, 101 final String owner, 102 final String name, 103 final String desc) 104 { 105 super(opcode); 106 this.owner = owner; 107 this.name = name; 108 this.desc = desc; 109 } 110 111 /** 112 * Sets the opcode of this instruction. 113 * 114 * @param opcode the new instruction opcode. This opcode must be GETSTATIC, 115 * PUTSTATIC, GETFIELD or PUTFIELD. 116 */ 117 public void setOpcode(final int opcode) { 118 this.opcode = opcode; 119 } 120 121 @Override 122 public int getType() { 123 return FIELD_INSN; 124 } 125 126 @Override 127 public void accept(final MethodVisitor cv) { 128 cv.visitFieldInsn(opcode, owner, name, desc); 129 } 130 131 @Override 132 public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { 133 return new FieldInsnNode(opcode, owner, name, desc); 134 } 135 } | 72 73 /** 74 * The internal name of the field's owner class (see 75 * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() getInternalName}). 76 */ 77 public String owner; 78 79 /** 80 * The field's name. 81 */ 82 public String name; 83 84 /** 85 * The field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}). 86 */ 87 public String desc; 88 89 /** 90 * Constructs a new {@link FieldInsnNode}. 91 * 92 * @param opcode 93 * the opcode of the type instruction to be constructed. This 94 * opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. 95 * @param owner 96 * the internal name of the field's owner class (see 97 * {@link jdk.internal.org.objectweb.asm.Type#getInternalName() 98 * getInternalName}). 99 * @param name 100 * the field's name. 101 * @param desc 102 * the field's descriptor (see {@link jdk.internal.org.objectweb.asm.Type}). 103 */ 104 public FieldInsnNode(final int opcode, final String owner, 105 final String name, final String desc) { 106 super(opcode); 107 this.owner = owner; 108 this.name = name; 109 this.desc = desc; 110 } 111 112 /** 113 * Sets the opcode of this instruction. 114 * 115 * @param opcode 116 * the new instruction opcode. This opcode must be GETSTATIC, 117 * PUTSTATIC, GETFIELD or PUTFIELD. 118 */ 119 public void setOpcode(final int opcode) { 120 this.opcode = opcode; 121 } 122 123 @Override 124 public int getType() { 125 return FIELD_INSN; 126 } 127 128 @Override 129 public void accept(final MethodVisitor mv) { 130 mv.visitFieldInsn(opcode, owner, name, desc); 131 acceptAnnotations(mv); 132 } 133 134 @Override 135 public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { 136 return new FieldInsnNode(opcode, owner, name, desc) 137 .cloneAnnotations(this); 138 } 139 } |