|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.AnalysisContext
public class AnalysisContext
A context for analysis of a complete project. This serves as the repository for whole-program information and data structures.
Field Summary | |
---|---|
java.util.Map<java.lang.Object,java.lang.Object> |
analysisLocals
|
static java.lang.String |
DEFAULT_CHECK_FOR_NULL_PARAM_DATABASE_FILENAME
|
static java.lang.String |
DEFAULT_NONNULL_PARAM_DATABASE_FILENAME
|
static java.lang.String |
DEFAULT_NULL_RETURN_VALUE_ANNOTATION_DATABASE
|
static java.lang.String |
DEFAULT_NULL_RETURN_VALUE_DB_FILENAME
|
static java.lang.String |
UNCONDITIONAL_DEREF_DB_FILENAME
|
Constructor Summary | |
---|---|
AnalysisContext(RepositoryLookupFailureCallback lookupFailureCallback)
Constructor. |
Method Summary | ||
---|---|---|
void |
addApplicationClassToRepository(org.apache.bcel.classfile.JavaClass appClass)
Add an application class to the repository. |
|
void |
addClasspathEntry(java.lang.String url)
Add an entry to the Repository's classpath. |
|
void |
clearClassContextCache()
Clear the ClassContext cache. |
|
void |
clearRepository()
Clear the BCEL Repository in preparation for analysis. |
|
static AnalysisContext |
currentAnalysisContext()
Get the AnalysisContext associated with this thread |
|
boolean |
getBoolProperty(int prop)
Get a boolean property. |
|
CheckReturnAnnotationDatabase |
getCheckReturnAnnotationDatabase()
|
|
ClassContext |
getClassContext(org.apache.bcel.classfile.JavaClass javaClass)
Get the ClassContext for a class. |
|
java.lang.String |
getDatabaseInputDir()
Get the interprocedural database input directory. |
|
java.lang.String |
getDatabaseOutputDir()
Get the interprocedural database output directory. |
|
FieldStoreTypeDatabase |
getFieldStoreTypeDatabase()
Get the property database recording the types of values stored into fields. |
|
RepositoryLookupFailureCallback |
getLookupFailureCallback()
Get the lookup failure callback. |
|
NullnessAnnotationDatabase |
getNullnessAnnotationDatabase()
|
|
SourceFinder |
getSourceFinder()
Get the SourceFinder, for finding source files. |
|
SourceInfoMap |
getSourceInfoMap()
Get the SourceInfoMap. |
|
Subtypes |
getSubtypes()
Get the Subtypes database. |
|
ParameterNullnessPropertyDatabase |
getUnconditionalDerefParamDatabase()
|
|
void |
initDatabases()
Instantiate the CheckReturnAnnotationDatabase. |
|
boolean |
isApplicationClass(org.apache.bcel.classfile.JavaClass cls)
Return whether or not the given class is an application class. |
|
boolean |
isApplicationClass(java.lang.String className)
Return whether or not the given class is an application class. |
|
void |
loadInterproceduralDatabases()
If possible, load interprocedural property databases. |
|
|
loadPropertyDatabase(DatabaseType database,
java.lang.String fileName,
java.lang.String description)
Load an interprocedural property database. |
|
org.apache.bcel.classfile.JavaClass |
lookupClass(java.lang.String className)
Lookup a class. |
|
java.lang.String |
lookupSourceFile(java.lang.String className)
Lookup a class's sourfe file |
|
static void |
reportMissingClass(java.lang.ClassNotFoundException e)
|
|
void |
setBoolProperty(int prop,
boolean value)
Set a boolean property. |
|
void |
setDatabaseInputDir(java.lang.String databaseInputDir)
Set the interprocedural database input directory. |
|
void |
setDatabaseOutputDir(java.lang.String databaseOutputDir)
Set the interprocedural database output directory. |
|
void |
setSourcePath(java.util.List<java.lang.String> sourcePath)
Set the source path. |
|
void |
setUnconditionalDerefParamDatabase(ParameterNullnessPropertyDatabase unconditionalDerefParamDatabase)
|
|
|
storePropertyDatabase(DatabaseType database,
java.lang.String fileName,
java.lang.String description)
Write an interprocedural property database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_NONNULL_PARAM_DATABASE_FILENAME
public static final java.lang.String DEFAULT_CHECK_FOR_NULL_PARAM_DATABASE_FILENAME
public static final java.lang.String DEFAULT_NULL_RETURN_VALUE_ANNOTATION_DATABASE
public static final java.lang.String UNCONDITIONAL_DEREF_DB_FILENAME
public static final java.lang.String DEFAULT_NULL_RETURN_VALUE_DB_FILENAME
public java.util.Map<java.lang.Object,java.lang.Object> analysisLocals
Constructor Detail |
---|
public AnalysisContext(RepositoryLookupFailureCallback lookupFailureCallback)
Method Detail |
---|
public NullnessAnnotationDatabase getNullnessAnnotationDatabase()
public CheckReturnAnnotationDatabase getCheckReturnAnnotationDatabase()
public void initDatabases()
public static AnalysisContext currentAnalysisContext()
public static void reportMissingClass(java.lang.ClassNotFoundException e)
public RepositoryLookupFailureCallback getLookupFailureCallback()
public void setSourcePath(java.util.List<java.lang.String> sourcePath)
public SourceFinder getSourceFinder()
public Subtypes getSubtypes()
public void clearRepository()
public void clearClassContextCache()
public void addClasspathEntry(java.lang.String url) throws java.io.IOException
url
- the classpath entry URL
java.io.IOException
public void addApplicationClassToRepository(org.apache.bcel.classfile.JavaClass appClass)
appClass
- the application classpublic boolean isApplicationClass(org.apache.bcel.classfile.JavaClass cls)
cls
- the class to lookup
public boolean isApplicationClass(java.lang.String className)
className
- name of a class
public org.apache.bcel.classfile.JavaClass lookupClass(@NonNull java.lang.String className) throws java.lang.ClassNotFoundException
className
- the name of the class
java.lang.ClassNotFoundException
public java.lang.String lookupSourceFile(@NonNull java.lang.String className)
className
- the name of the class
public ClassContext getClassContext(org.apache.bcel.classfile.JavaClass javaClass)
javaClass
- the class
public void loadInterproceduralDatabases()
public void setBoolProperty(int prop, boolean value)
prop
- the property to setvalue
- the value of the propertypublic boolean getBoolProperty(int prop)
prop
- the property
public SourceInfoMap getSourceInfoMap()
public void setDatabaseInputDir(java.lang.String databaseInputDir)
databaseInputDir
- the interprocedural database input directorypublic java.lang.String getDatabaseInputDir()
public void setDatabaseOutputDir(java.lang.String databaseOutputDir)
databaseOutputDir
- the interprocedural database output directorypublic java.lang.String getDatabaseOutputDir()
public FieldStoreTypeDatabase getFieldStoreTypeDatabase()
public void setUnconditionalDerefParamDatabase(ParameterNullnessPropertyDatabase unconditionalDerefParamDatabase)
public ParameterNullnessPropertyDatabase getUnconditionalDerefParamDatabase()
public <DatabaseType extends PropertyDatabase<KeyType,Property>,KeyType,Property> DatabaseType loadPropertyDatabase(DatabaseType database, java.lang.String fileName, java.lang.String description)
DatabaseType
- actual type of the databaseKeyType
- type of key (e.g., method or field)Property
- type of properties stored in the databasedatabase
- the empty database objectfileName
- file to load database fromdescription
- description of the database (for diagnostics)
public <DatabaseType extends PropertyDatabase<KeyType,Property>,KeyType,Property> void storePropertyDatabase(DatabaseType database, java.lang.String fileName, java.lang.String description)
DatabaseType
- actual type of the databaseKeyType
- type of key (e.g., method or field)Property
- type of properties stored in the databasedatabase
- the databasefileName
- name of database filedescription
- description of the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |