Class AbstractAnalysisEngine<I extends InstanceKey,X extends CallGraphBuilder<I>,Y>
java.lang.Object
com.ibm.wala.client.AbstractAnalysisEngine<I,X,Y>
- All Implemented Interfaces:
AnalysisEngine
- Direct Known Subclasses:
EclipseProjectAnalysisEngine
,JavaScriptAnalysisEngine
,JavaSourceAnalysisEngine
public abstract class AbstractAnalysisEngine<I extends InstanceKey,X extends CallGraphBuilder<I>,Y>
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
-
Field Summary
Modifier and TypeFieldDescriptionprotected CallGraph
Governing call graphprotected static final int
DEBUG_LEVEL: 0 No output 1 Print some simple stats and warning information 2 Detailed debuggingprotected Module[]
The standard J2SE libraries to analyzeprotected Collection
<? extends Module> The modules to analyzeprotected PointerAnalysis
<I> Results of pointer analysisprotected AnalysisScope
A representation of the analysis scopestatic final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add the application modules to the analysis scope.void
Set up the AnalysisScope objectprotected X
buildCallGraph
(IClassHierarchy cha, AnalysisOptions options, boolean savePointerAnalysis, MonitorUtil.IProgressMonitor monitor) Builds the call graph for the analysis scope in effect, using all of the given entry points.getCache()
protected CallGraph
protected abstract X
getCallGraphBuilder
(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache2) getDefaultOptions
(Iterable<Entrypoint> entrypoints) Get the default analysis options appropriate for this engineHeapGraph
<?> PointerAnalysis
<? super I> protected AnalysisScope
getScope()
boolean
protected ClassLoaderFactory
makeClassLoaderFactory
(SetOfClasses exclusions) protected Iterable
<Entrypoint> protected IClassHierarchy
void
setClosedWorld
(boolean b) Specify whether the engine should or should not employ "closed-world" analysis.void
void
setExclusionsFile
(String exclusionsFile) void
setJ2SELibraries
(Module[] libs) Specify the mdoules that represent the standard J2SE librariesvoid
setJ2SELibraries
(JarFile[] libs) Specify the jar files that represent the standard J2SE librariesvoid
setModuleFiles
(Collection<? extends Module> moduleFiles) Specify the list of modules that should be analyzed.
-
Field Details
-
SYNTHETIC_J2SE_MODEL
- See Also:
-
DEBUG_LEVEL
protected static final int DEBUG_LEVELDEBUG_LEVEL:- 0 No output
- 1 Print some simple stats and warning information
- 2 Detailed debugging
- See Also:
-
moduleFiles
The modules to analyze -
scope
A representation of the analysis scope -
j2seLibs
The standard J2SE libraries to analyze -
cg
Governing call graph -
pointerAnalysis
Results of pointer analysis
-
-
Constructor Details
-
AbstractAnalysisEngine
public AbstractAnalysisEngine()
-
-
Method Details
-
getCallGraphBuilder
protected abstract X getCallGraphBuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache2) -
buildCallGraph
protected X buildCallGraph(IClassHierarchy cha, AnalysisOptions options, boolean savePointerAnalysis, MonitorUtil.IProgressMonitor monitor) throws IllegalArgumentException, CancelException -
setModuleFiles
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
Set up the AnalysisScope object- Throws:
IOException
-
buildClassHierarchy
- Returns:
- a IClassHierarchy object for this analysis scope
-
makeClassLoaderFactory
-
getClassHierarchy
-
setClassHierarchy
-
getCallGraph
- Returns:
- Returns the call graph
-
addApplicationModulesToScope
protected void addApplicationModulesToScope()Add the application modules to the analysis scope. -
setJ2SELibraries
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
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
-
getPointerAnalysis
-
getHeapGraph
-
getSDG
public SDG<? super I> getSDG(Slicer.DataDependenceOptions data, Slicer.ControlDependenceOptions ctrl) -
getExclusionsFile
-
setExclusionsFile
-
getDefaultOptions
Description copied from interface:AnalysisEngine
Get the default analysis options appropriate for this engine- Specified by:
getDefaultOptions
in interfaceAnalysisEngine
-
makeDefaultCache
-
makeDefaultEntrypoints
-
setEntrypointBuilder
-
defaultCallGraphBuilder
Builds the call graph for the analysis scope in effect, using all of the given entry points.- Throws:
IllegalArgumentException
IOException
-
buildDefaultCallGraph
public CallGraph buildDefaultCallGraph() throws IllegalArgumentException, CancelException, IOException -
getCache
-
getOptions
-
performAnalysis
- Throws:
CancelException
-