edu.umd.cs.findbugs
public class SourceLineAnnotation extends Object implements BugAnnotation
See Also: BugAnnotation
Field Summary | |
---|---|
static String | DEFAULT_ROLE |
static String | DEFAULT_ROLE_UNKNOWN_LINE |
static String | ROLE_ANOTHER_INSTANCE |
static String | UNKNOWN_SOURCE_FILE
String returned if the source file is unknown.
|
Constructor Summary | |
---|---|
SourceLineAnnotation(String className, String sourceFile, int startLine, int endLine, int startBytecode, int endBytecode)
Constructor.
|
Method Summary | |
---|---|
void | accept(BugAnnotationVisitor visitor) |
int | compareTo(BugAnnotation o) |
static SourceLineAnnotation | createReallyUnknown(String className)
Factory method to create an unknown source line annotation.
|
static SourceLineAnnotation | createUnknown(String className, String sourceFile)
Factory method to create an unknown source line annotation.
|
static SourceLineAnnotation | createUnknown(String className)
Factory method to create an unknown source line annotation.
|
static SourceLineAnnotation | createUnknown(String className, String sourceFile, int startBytecode, int endBytecode)
Factory method to create an unknown source line annotation.
|
static SourceLineAnnotation | forEntireMethod(String className, String sourceFile, LineNumberTable lineNumberTable, int codeSize)
Create a SourceLineAnnotation covering an entire method.
|
static SourceLineAnnotation | forEntireMethod(JavaClass javaClass, Method method)
Create a SourceLineAnnotation covering an entire method.
|
static SourceLineAnnotation | forEntireMethod(JavaClass javaClass, XMethod xmethod)
Create a SourceLineAnnotation covering an entire method.
|
String | format(String key, ClassAnnotation primaryClass) |
static SourceLineAnnotation | fromRawData(String className, String sourceFile, int startLine, int endLine, int startPC, int endPC) |
static SourceLineAnnotation | fromVisitedInstruction(BytecodeScanningDetector visitor, int pc)
Factory method for creating a source line annotation describing the
source line number for the instruction being visited by given visitor.
|
static SourceLineAnnotation | fromVisitedInstruction(ClassContext classContext, PreorderVisitor visitor, int pc)
Factory method for creating a source line annotation describing the
source line number for the instruction being visited by given visitor.
|
static SourceLineAnnotation | fromVisitedInstruction(ClassContext classContext, Method method, Location loc)
Create from Method and Location in a visited class.
|
static SourceLineAnnotation | fromVisitedInstruction(ClassContext classContext, Method method, InstructionHandle handle)
Create from Method and InstructionHandle in a visited class.
|
static SourceLineAnnotation | fromVisitedInstruction(ClassContext classContext, Method method, int pc)
Create from Method and bytecode offset in a visited class.
|
static SourceLineAnnotation | fromVisitedInstruction(BytecodeScanningDetector visitor)
Factory method for creating a source line annotation describing the
source line number for the instruction being visited by given visitor.
|
static SourceLineAnnotation | fromVisitedInstruction(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle handle)
Factory method for creating a source line annotation describing the
source line number for a visited instruction.
|
static SourceLineAnnotation | fromVisitedInstructionRange(BytecodeScanningDetector visitor, int startPC, int endPC)
Factory method for creating a source line annotation describing the
source line numbers for a range of instructions in the method being
visited by the given visitor.
|
static SourceLineAnnotation | fromVisitedInstructionRange(ClassContext classContext, PreorderVisitor visitor, int startPC, int endPC)
Factory method for creating a source line annotation describing the
source line numbers for a range of instructions in the method being
visited by the given visitor.
|
static SourceLineAnnotation | fromVisitedInstructionRange(ClassContext classContext, MethodGen methodGen, String sourceFile, InstructionHandle start, InstructionHandle end)
Factory method for creating a source line annotation describing
the source line numbers for a range of instruction in a method.
|
static SourceLineAnnotation | fromVisitedMethod(PreorderVisitor visitor)
Factory method for creating a source line annotation describing
an entire method.
|
static SourceLineAnnotation | fromVisitedMethod(MethodGen methodGen, String sourceFile)
Factory method for creating a source line annotation describing an entire
method.
|
String | getClassName()
Get the class name. |
String | getDescription() |
int | getEndBytecode()
Get end bytecode (inclusive). |
int | getEndLine()
Get the ending line (inclusive). |
String | getPackageName()
Get the package name. |
String | getSimpleClassName()
Get the simple class name (the part of the name after the dot) |
String | getSourceFile()
Get the source file name. |
int | getStartBytecode()
Get start bytecode (inclusive). |
int | getStartLine()
Get the start line (inclusive). |
boolean | isSignificant() |
boolean | isSourceFileKnown()
Is the source file known? |
boolean | isSynthetic() |
boolean | isUnknown()
Is this an unknown source line annotation? |
void | setDescription(String description) |
void | setSourceFile(String sourceFile)
Set the source file name.
|
void | setSynthetic(boolean synthetic) |
void | writeXML(XMLOutput xmlOutput) |
void | writeXML(XMLOutput xmlOutput, boolean addMessages) |
Parameters: className the class to which the line number(s) refer sourceFile the name of the source file startLine the first line (inclusive) endLine the ending line (inclusive) startBytecode the first bytecode offset (inclusive) endBytecode the end bytecode offset (inclusive)
Parameters: className the class name
Returns: the SourceLineAnnotation
Parameters: className the class name sourceFile the source file name
Returns: the SourceLineAnnotation
Parameters: className the class name
Returns: the SourceLineAnnotation
Parameters: className the class name sourceFile the source file name
Returns: the SourceLineAnnotation
Parameters: className name of the class the method is in sourceFile source file containing the method lineNumberTable the method's LineNumberTable codeSize size in bytes of the method's code
Returns: a SourceLineAnnotation covering the entire method
Parameters: javaClass JavaClass containing the method method the method
Returns: a SourceLineAnnotation for the entire method
Parameters: javaClass JavaClass containing the method xmethod the method
Returns: a SourceLineAnnotation for the entire method
Parameters: visitor a BetterVisitor which is visiting the method pc the bytecode offset of the instruction in the method
Returns: the SourceLineAnnotation, or null if we do not have line number information for the instruction
Parameters: classContext the ClassContext visitor a BetterVisitor which is visiting the method pc the bytecode offset of the instruction in the method
Returns: the SourceLineAnnotation, or null if we do not have line number information for the instruction
Parameters: classContext ClassContext of visited class method Method in visited class loc Location in visited class
Returns: SourceLineAnnotation describing visited Location
Parameters: classContext ClassContext of visited class method Method in visited class handle InstructionHandle in visited class
Returns: SourceLineAnnotation describing visited instruction
Parameters: classContext ClassContext of visited class method Method in visited class pc bytecode offset in visited method
Returns: SourceLineAnnotation describing visited instruction
Parameters: visitor a DismantleBytecode visitor which is visiting the method
Returns: the SourceLineAnnotation, or null if we do not have line number information for the instruction
Parameters: classContext the ClassContext methodGen the MethodGen object representing the method handle the InstructionHandle containing the visited instruction
Returns: the SourceLineAnnotation, or null if we do not have line number information for the instruction
Parameters: visitor a BetterVisitor which is visiting the method startPC the bytecode offset of the start instruction in the range endPC the bytecode offset of the end instruction in the range
Returns: the SourceLineAnnotation, or null if we do not have line number information for the instruction
Parameters: classContext the ClassContext visitor a BetterVisitor which is visiting the method startPC the bytecode offset of the start instruction in the range endPC the bytecode offset of the end instruction in the range
Returns: the SourceLineAnnotation, or null if we do not have line number information for the instruction
Parameters: classContext theClassContext methodGen the method start the start instruction end the end instruction (inclusive)
Parameters: visitor a BetterVisitor which is visiting the method
Returns: the SourceLineAnnotation
Parameters: methodGen the method being visited
Returns: the SourceLineAnnotation, or null if we do not have line number information for the method
Returns: Returns the synthetic.
Parameters: sourceFile the source file name
Parameters: synthetic The synthetic to set.