Package com.ibm.wala.client
Class AbstractAnalysisEngine
- java.lang.Object
-
- com.ibm.wala.client.AbstractAnalysisEngine
-
- All Implemented Interfaces:
AnalysisEngine
public abstract class AbstractAnalysisEngine extends Object implements AnalysisEngine
Abstract base class for analysis engine implementations Some clients choose to build on this, but many don't. I usually don't in new code; I usually don't find the re-use enabled by this class compelling. I would probably nuke this except for some legacy code that uses it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractAnalysisEngine.EntrypointBuilder
-
Field Summary
Fields Modifier and Type Field Description protected CallGraph
cg
Governing call graphprotected static int
DEBUG_LEVEL
DEBUG_LEVEL: 0 No output 1 Print some simple stats and warning information 2 Detailed debuggingprotected Module[]
j2seLibs
The standard J2SE libraries to analyzeprotected Collection<Module>
moduleFiles
The modules to analyzeprotected PointerAnalysis<InstanceKey>
pointerAnalysis
Results of pointer analysisprotected AnalysisScope
scope
A representation of the analysis scopestatic String
SYNTHETIC_J2SE_MODEL
-
Constructor Summary
Constructors Constructor Description AbstractAnalysisEngine()
-
Method Summary
-
-
-
Field Detail
-
SYNTHETIC_J2SE_MODEL
public static final String SYNTHETIC_J2SE_MODEL
- See Also:
- Constant Field Values
-
DEBUG_LEVEL
protected static final int DEBUG_LEVEL
DEBUG_LEVEL:- 0 No output
- 1 Print some simple stats and warning information
- 2 Detailed debugging
- See Also:
- Constant Field Values
-
moduleFiles
protected Collection<Module> moduleFiles
The modules to analyze
-
scope
protected AnalysisScope scope
A representation of the analysis scope
-
j2seLibs
protected Module[] j2seLibs
The standard J2SE libraries to analyze
-
cg
protected CallGraph cg
Governing call graph
-
pointerAnalysis
protected PointerAnalysis<InstanceKey> pointerAnalysis
Results of pointer analysis
-
-
Method Detail
-
getCallGraphBuilder
protected abstract CallGraphBuilder getCallGraphBuilder(IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache)
-
buildCallGraph
protected CallGraphBuilder buildCallGraph(IClassHierarchy cha, AnalysisOptions options, boolean savePointerAnalysis, MonitorUtil.IProgressMonitor monitor) throws IllegalArgumentException, CancelException
-
setModuleFiles
public void setModuleFiles(Collection moduleFiles)
Description copied from interface:AnalysisEngine
Specify the list of modules that should be analyzed. If an EARFile is included in the list, all of its contained modules should be examined. Multiple ear files can be specified for cross-app invocations, which will become increasingly common in the 5.1 release.- Specified by:
setModuleFiles
in interfaceAnalysisEngine
- Parameters:
moduleFiles
- A non-null Collection of module files: (EARFile, WARFile, ApplicationClientFile, EJBJarFile).
-
buildAnalysisScope
public void buildAnalysisScope() throws IOException
Set up the AnalysisScope object- Throws:
IOException
-
buildClassHierarchy
public IClassHierarchy buildClassHierarchy()
- Returns:
- a IClassHierarchy object for this analysis scope
-
makeClassLoaderFactory
protected ClassLoaderFactory makeClassLoaderFactory(SetOfClasses exclusions)
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
-
setClassHierarchy
protected void setClassHierarchy(IClassHierarchy cha)
-
getCallGraph
protected CallGraph getCallGraph()
- Returns:
- Returns the call graph
-
addApplicationModulesToScope
protected void addApplicationModulesToScope()
Add the application modules to the analysis scope.
-
setJ2SELibraries
public void setJ2SELibraries(JarFile[] libs)
Description copied from interface:AnalysisEngine
Specify the jar files that represent the standard J2SE libraries- Specified by:
setJ2SELibraries
in interfaceAnalysisEngine
- Parameters:
libs
- an array of jar files; usually rt.jar for vanilla JDK core.jar, server.jar, and xml.jar for some WAS runtimes
-
setJ2SELibraries
public void setJ2SELibraries(Module[] libs)
Description copied from interface:AnalysisEngine
Specify the mdoules that represent the standard J2SE libraries- Specified by:
setJ2SELibraries
in interfaceAnalysisEngine
- Parameters:
libs
- an array of Modules; usually rt.jar for vanilla JDK core.jar, server.jar, and xml.jar for some WAS runtimes
-
setClosedWorld
public void setClosedWorld(boolean b)
Description copied from interface:AnalysisEngine
Specify whether the engine should or should not employ "closed-world" analysis. In a closed-world analysis, the engine considers only application client main methods and servlet entrypoints to the application. In an open-world analysis, the engine additionally considers all EJB local and remote interface methods as entrypoints. By default, this property is false; the default analysis is open-world- Specified by:
setClosedWorld
in interfaceAnalysisEngine
- Parameters:
b
- whether to use closed-world analysis
-
isClosedWorld
public boolean isClosedWorld()
-
getScope
protected AnalysisScope getScope()
-
getPointerAnalysis
public PointerAnalysis<InstanceKey> getPointerAnalysis()
-
getHeapGraph
public HeapGraph getHeapGraph()
-
getExclusionsFile
public String getExclusionsFile()
-
setExclusionsFile
public void setExclusionsFile(String exclusionsFile)
-
getDefaultOptions
public AnalysisOptions getDefaultOptions(Iterable<Entrypoint> entrypoints)
Description copied from interface:AnalysisEngine
Get the default analysis options appropriate for this engine- Specified by:
getDefaultOptions
in interfaceAnalysisEngine
-
makeDefaultCache
public AnalysisCache makeDefaultCache()
-
makeDefaultEntrypoints
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha)
-
setEntrypointBuilder
public void setEntrypointBuilder(AbstractAnalysisEngine.EntrypointBuilder builder)
-
defaultCallGraphBuilder
public CallGraphBuilder defaultCallGraphBuilder() throws IllegalArgumentException, CancelException, IOException
Builds the call graph for the analysis scope in effect, using all of the given entry points.
-
buildDefaultCallGraph
public CallGraph buildDefaultCallGraph() throws IllegalArgumentException, CancelException, IOException
-
getCache
public AnalysisCache getCache()
-
getOptions
public AnalysisOptions getOptions()
-
-