org.objectweb.asm.tree

Class AbstractInsnNode

public abstract class AbstractInsnNode extends Object

A node that represents a bytecode instruction. An instruction can appear at most once in at most one {@link InsnList} at a time.

Author: Eric Bruneton

Field Summary
static intFIELD_INSN
The type of {@link FieldInsnNode} instructions.
static intFRAME
The type of {@link FrameNode} "instructions".
static intIINC_INSN
The type of {@link IincInsnNode} instructions.
static intINSN
The type of {@link InsnNode} instructions.
static intINT_INSN
The type of {@link IntInsnNode} instructions.
static intJUMP_INSN
The type of {@link JumpInsnNode} instructions.
static intLABEL
The type of {@link LabelNode} "instructions".
static intLDC_INSN
The type of {@link LdcInsnNode} instructions.
static intLINE
The type of {@link LineNumberNode} "instructions".
static intLOOKUPSWITCH_INSN
The type of {@link LookupSwitchInsnNode} instructions.
static intMETHOD_INSN
The type of {@link MethodInsnNode} instructions.
static intMULTIANEWARRAY_INSN
The type of {@link MultiANewArrayInsnNode} instructions.
protected intopcode
The opcode of this instruction.
static intTABLESWITCH_INSN
The type of {@link TableSwitchInsnNode} instructions.
static intTYPE_INSN
The type of {@link TypeInsnNode} instructions.
static intVAR_INSN
The type of {@link VarInsnNode} instructions.
Constructor Summary
protected AbstractInsnNode(int opcode)
Constructs a new {@link AbstractInsnNode}.
Method Summary
abstract voidaccept(MethodVisitor cv)
Makes the given code visitor visit this instruction.
abstract AbstractInsnNodeclone(Map labels)
Returns a copy of this instruction.
AbstractInsnNodegetNext()
Returns the next instruction in the list to which this instruction belongs, if any.
intgetOpcode()
Returns the opcode of this instruction.
AbstractInsnNodegetPrevious()
Returns the previous instruction in the list to which this instruction belongs, if any.
abstract intgetType()
Returns the type of this instruction.

Field Detail

FIELD_INSN

public static final int FIELD_INSN
The type of {@link FieldInsnNode} instructions.

FRAME

public static final int FRAME
The type of {@link FrameNode} "instructions".

IINC_INSN

public static final int IINC_INSN
The type of {@link IincInsnNode} instructions.

INSN

public static final int INSN
The type of {@link InsnNode} instructions.

INT_INSN

public static final int INT_INSN
The type of {@link IntInsnNode} instructions.

JUMP_INSN

public static final int JUMP_INSN
The type of {@link JumpInsnNode} instructions.

LABEL

public static final int LABEL
The type of {@link LabelNode} "instructions".

LDC_INSN

public static final int LDC_INSN
The type of {@link LdcInsnNode} instructions.

LINE

public static final int LINE
The type of {@link LineNumberNode} "instructions".

LOOKUPSWITCH_INSN

public static final int LOOKUPSWITCH_INSN
The type of {@link LookupSwitchInsnNode} instructions.

METHOD_INSN

public static final int METHOD_INSN
The type of {@link MethodInsnNode} instructions.

MULTIANEWARRAY_INSN

public static final int MULTIANEWARRAY_INSN
The type of {@link MultiANewArrayInsnNode} instructions.

opcode

protected int opcode
The opcode of this instruction.

TABLESWITCH_INSN

public static final int TABLESWITCH_INSN
The type of {@link TableSwitchInsnNode} instructions.

TYPE_INSN

public static final int TYPE_INSN
The type of {@link TypeInsnNode} instructions.

VAR_INSN

public static final int VAR_INSN
The type of {@link VarInsnNode} instructions.

Constructor Detail

AbstractInsnNode

protected AbstractInsnNode(int opcode)
Constructs a new {@link AbstractInsnNode}.

Parameters: opcode the opcode of the instruction to be constructed.

Method Detail

accept

public abstract void accept(MethodVisitor cv)
Makes the given code visitor visit this instruction.

Parameters: cv a code visitor.

clone

public abstract AbstractInsnNode clone(Map labels)
Returns a copy of this instruction.

Parameters: labels a map from LabelNodes to cloned LabelNodes.

Returns: a copy of this instruction. The returned instruction does not belong to any {@link InsnList}.

getNext

public AbstractInsnNode getNext()
Returns the next instruction in the list to which this instruction belongs, if any.

Returns: the next instruction in the list to which this instruction belongs, if any. May be null.

getOpcode

public int getOpcode()
Returns the opcode of this instruction.

Returns: the opcode of this instruction.

getPrevious

public AbstractInsnNode getPrevious()
Returns the previous instruction in the list to which this instruction belongs, if any.

Returns: the previous instruction in the list to which this instruction belongs, if any. May be null.

getType

public abstract int getType()
Returns the type of this instruction.

Returns: the type of this instruction, i.e. one the constants defined in this class.