edu.umd.cs.findbugs.ba

Class SourceInfoMap

public class SourceInfoMap extends Object

Global information about the source code for an application. Currently, this object contains a map of source line information for fields and classes (items we don't get line number information for directly in classfiles), and also source line information for methods that don't appear directly in classfiles, such as abstract and native methods.

Author: David Hovemeyer

Nested Class Summary
static classSourceInfoMap.SourceLineRange
A range of source lines.
Constructor Summary
SourceInfoMap()
Constructor.
Method Summary
voidaddClassLine(String className, SourceInfoMap.SourceLineRange range)
Add line number entry for a class.
voidaddFieldLine(String className, String fieldName, SourceInfoMap.SourceLineRange range)
Add a line number entry for a field.
voidaddMethodLine(String className, String methodName, String methodSignature, SourceInfoMap.SourceLineRange range)
Add a line number entry for a method.
booleanfallBackToClassfile()
booleanisEmpty()
voidread(InputStream inputStream)
Read source info from given InputStream.

Constructor Detail

SourceInfoMap

public SourceInfoMap()
Constructor. Creates an empty object.

Method Detail

addClassLine

public void addClassLine(String className, SourceInfoMap.SourceLineRange range)
Add line number entry for a class.

Parameters: className name of class range the line numbers of the class

addFieldLine

public void addFieldLine(String className, String fieldName, SourceInfoMap.SourceLineRange range)
Add a line number entry for a field.

Parameters: className name of class containing the field fieldName name of field range the line number(s) of the field

addMethodLine

public void addMethodLine(String className, String methodName, String methodSignature, SourceInfoMap.SourceLineRange range)
Add a line number entry for a method.

Parameters: className name of class containing the method methodName name of method methodSignature signature of method range the line number of the method

fallBackToClassfile

public boolean fallBackToClassfile()

isEmpty

public boolean isEmpty()

read

public void read(InputStream inputStream)
Read source info from given InputStream. The stream is guaranteed to be closed.

Parameters: inputStream the InputStream

Throws: IOException if an I/O error occurs, or if the format is invalid

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.