Package org.objectweb.asm.tree
Class AbstractInsnNode
- java.lang.Object
-
- org.objectweb.asm.tree.AbstractInsnNode
-
- Direct Known Subclasses:
FieldInsnNode,FrameNode,IincInsnNode,InsnNode,IntInsnNode,InvokeDynamicInsnNode,JumpInsnNode,LabelNode,LdcInsnNode,LineNumberNode,LookupSwitchInsnNode,MethodInsnNode,MultiANewArrayInsnNode,TableSwitchInsnNode,TypeInsnNode,VarInsnNode
public abstract class AbstractInsnNode extends java.lang.ObjectA node that represents a bytecode instruction. An instruction can appear at most once in at most oneInsnListat a time.
-
-
Field Summary
Fields Modifier and Type Field Description static intFIELD_INSNThe type ofFieldInsnNodeinstructions.static intFRAMEThe type ofFrameNode"instructions".static intIINC_INSNThe type ofIincInsnNodeinstructions.static intINSNThe type ofInsnNodeinstructions.static intINT_INSNThe type ofIntInsnNodeinstructions.java.util.List<TypeAnnotationNode>invisibleTypeAnnotationsThe runtime invisible type annotations of this instruction.static intINVOKE_DYNAMIC_INSNThe type ofInvokeDynamicInsnNodeinstructions.static intJUMP_INSNThe type ofJumpInsnNodeinstructions.static intLABELThe type ofLabelNode"instructions".static intLDC_INSNThe type ofLdcInsnNodeinstructions.static intLINEThe type ofLineNumberNode"instructions".static intLOOKUPSWITCH_INSNThe type ofLookupSwitchInsnNodeinstructions.static intMETHOD_INSNThe type ofMethodInsnNodeinstructions.static intMULTIANEWARRAY_INSNThe type ofMultiANewArrayInsnNodeinstructions.protected intopcodeThe opcode of this instruction.static intTABLESWITCH_INSNThe type ofTableSwitchInsnNodeinstructions.static intTYPE_INSNThe type ofTypeInsnNodeinstructions.static intVAR_INSNThe type ofVarInsnNodeinstructions.java.util.List<TypeAnnotationNode>visibleTypeAnnotationsThe runtime visible type annotations of this instruction.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractInsnNode(int opcode)Constructs a newAbstractInsnNode.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaccept(org.objectweb.asm.MethodVisitor methodVisitor)Makes the given method visitor visit this instruction.protected voidacceptAnnotations(org.objectweb.asm.MethodVisitor methodVisitor)Makes the given visitor visit the annotations of this instruction.abstract AbstractInsnNodeclone(java.util.Map<LabelNode,LabelNode> clonedLabels)Returns a copy of this instruction.protected AbstractInsnNodecloneAnnotations(AbstractInsnNode insnNode)Clones the annotations of the given instruction into 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
-
INSN
public static final int INSN
The type ofInsnNodeinstructions.- See Also:
- Constant Field Values
-
INT_INSN
public static final int INT_INSN
The type ofIntInsnNodeinstructions.- See Also:
- Constant Field Values
-
VAR_INSN
public static final int VAR_INSN
The type ofVarInsnNodeinstructions.- See Also:
- Constant Field Values
-
TYPE_INSN
public static final int TYPE_INSN
The type ofTypeInsnNodeinstructions.- See Also:
- Constant Field Values
-
FIELD_INSN
public static final int FIELD_INSN
The type ofFieldInsnNodeinstructions.- See Also:
- Constant Field Values
-
METHOD_INSN
public static final int METHOD_INSN
The type ofMethodInsnNodeinstructions.- See Also:
- Constant Field Values
-
INVOKE_DYNAMIC_INSN
public static final int INVOKE_DYNAMIC_INSN
The type ofInvokeDynamicInsnNodeinstructions.- See Also:
- Constant Field Values
-
JUMP_INSN
public static final int JUMP_INSN
The type ofJumpInsnNodeinstructions.- See Also:
- Constant Field Values
-
LABEL
public static final int LABEL
The type ofLabelNode"instructions".- See Also:
- Constant Field Values
-
LDC_INSN
public static final int LDC_INSN
The type ofLdcInsnNodeinstructions.- See Also:
- Constant Field Values
-
IINC_INSN
public static final int IINC_INSN
The type ofIincInsnNodeinstructions.- See Also:
- Constant Field Values
-
TABLESWITCH_INSN
public static final int TABLESWITCH_INSN
The type ofTableSwitchInsnNodeinstructions.- See Also:
- Constant Field Values
-
LOOKUPSWITCH_INSN
public static final int LOOKUPSWITCH_INSN
The type ofLookupSwitchInsnNodeinstructions.- See Also:
- Constant Field Values
-
MULTIANEWARRAY_INSN
public static final int MULTIANEWARRAY_INSN
The type ofMultiANewArrayInsnNodeinstructions.- See Also:
- Constant Field Values
-
FRAME
public static final int FRAME
The type ofFrameNode"instructions".- See Also:
- Constant Field Values
-
LINE
public static final int LINE
The type ofLineNumberNode"instructions".- See Also:
- Constant Field Values
-
opcode
protected int opcode
The opcode of this instruction.
-
visibleTypeAnnotations
public java.util.List<TypeAnnotationNode> visibleTypeAnnotations
The runtime visible type annotations of this instruction. This field is only used for real instructions (i.e. not for labels, frames, or line number nodes). This list is a list ofTypeAnnotationNodeobjects. May be null.
-
invisibleTypeAnnotations
public java.util.List<TypeAnnotationNode> invisibleTypeAnnotations
The runtime invisible type annotations of this instruction. This field is only used for real instructions (i.e. not for labels, frames, or line number nodes). This list is a list ofTypeAnnotationNodeobjects. May be null.
-
-
Constructor Detail
-
AbstractInsnNode
protected AbstractInsnNode(int opcode)
Constructs a newAbstractInsnNode.- Parameters:
opcode- the opcode of the instruction to be constructed.
-
-
Method Detail
-
getOpcode
public int getOpcode()
Returns the opcode of this instruction.- Returns:
- the opcode of this instruction.
-
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.
-
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.
-
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.
-
accept
public abstract void accept(org.objectweb.asm.MethodVisitor methodVisitor)
Makes the given method visitor visit this instruction.- Parameters:
methodVisitor- a method visitor.
-
acceptAnnotations
protected final void acceptAnnotations(org.objectweb.asm.MethodVisitor methodVisitor)
Makes the given visitor visit the annotations of this instruction.- Parameters:
methodVisitor- a method visitor.
-
clone
public abstract AbstractInsnNode clone(java.util.Map<LabelNode,LabelNode> clonedLabels)
Returns a copy of this instruction.- Parameters:
clonedLabels- a map from LabelNodes to cloned LabelNodes.- Returns:
- a copy of this instruction. The returned instruction does not belong to any
InsnList.
-
cloneAnnotations
protected final AbstractInsnNode cloneAnnotations(AbstractInsnNode insnNode)
Clones the annotations of the given instruction into this instruction.- Parameters:
insnNode- the source instruction.- Returns:
- this instruction.
-
-