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