Package org.apache.bcel.generic
Class LineNumberGen
- java.lang.Object
-
- org.apache.bcel.generic.LineNumberGen
-
- All Implemented Interfaces:
java.lang.Cloneable,InstructionTargeter
public class LineNumberGen extends java.lang.Object implements InstructionTargeter, java.lang.Cloneable
This class represents a line number within a method, i.e., give an instruction a line number corresponding to the source code line.- See Also:
LineNumber,MethodGen
-
-
Constructor Summary
Constructors Constructor Description LineNumberGen(InstructionHandle ih, int src_line)Create a line number.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()booleancontainsTarget(InstructionHandle ih)Checks whether this targeter targets the specified instruction handle.InstructionHandlegetInstruction()LineNumbergetLineNumber()Get LineNumber attribute .intgetSourceLine()voidsetInstruction(InstructionHandle instructionHandle)voidsetSourceLine(int src_line)voidupdateTarget(InstructionHandle old_ih, InstructionHandle new_ih)Replaces the target of this targeter from this old handle to the new handle.
-
-
-
Constructor Detail
-
LineNumberGen
public LineNumberGen(InstructionHandle ih, int src_line)
Create a line number.- Parameters:
ih- instruction handle to reference
-
-
Method Detail
-
containsTarget
public boolean containsTarget(InstructionHandle ih)
Description copied from interface:InstructionTargeterChecks whether this targeter targets the specified instruction handle.- Specified by:
containsTargetin interfaceInstructionTargeter- Returns:
- true, if ih is target of this line number
-
updateTarget
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
Description copied from interface:InstructionTargeterReplaces the target of this targeter from this old handle to the new handle.- Specified by:
updateTargetin interfaceInstructionTargeter- Parameters:
old_ih- old targetnew_ih- new target
-
getLineNumber
public LineNumber getLineNumber()
Get LineNumber attribute . This relies on that the instruction list has already been dumped to byte code or or that the `setPositions' methods has been called for the instruction list.
-
setInstruction
public void setInstruction(InstructionHandle instructionHandle)
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
getInstruction
public InstructionHandle getInstruction()
-
setSourceLine
public void setSourceLine(int src_line)
-
getSourceLine
public int getSourceLine()
-
-