public class AnalysisScope extends Object
rt.jar
, the core classes)
Module
.Modifier and Type | Field and Description |
---|---|
static Atom |
APPLICATION |
static Atom |
EXTENSION |
protected LinkedHashMap<Atom,ClassLoaderReference> |
loadersByName |
static Atom |
PRIMORDIAL |
static Atom |
SYNTHETIC |
Modifier | Constructor and Description |
---|---|
protected |
AnalysisScope(Collection<? extends Language> languages) |
Modifier and Type | Method and Description |
---|---|
void |
addClassFileToScope(ClassLoaderReference loader,
File file)
Add a class file to the scope for a loader
|
void |
addSourceFileToScope(ClassLoaderReference loader,
File file,
String fileName)
Add a class file to the scope for a loader
|
void |
addToScope(AnalysisScope other)
Add all modules from another scope
|
void |
addToScope(ClassLoaderReference loader,
JarFile file)
Add a jar file to the scope for a loader
|
void |
addToScope(ClassLoaderReference loader,
Module m)
Add a module to the scope for a loader
|
void |
addToScopeHead(ClassLoaderReference loader,
Module m)
Add a module file to the scope for a loader.
|
protected ClassLoaderReference |
classLoaderName2Ref(String clName) |
static AnalysisScope |
createJavaAnalysisScope()
Create an analysis scope initialized for analysis of Java
|
MethodReference |
findMethod(Atom loader,
String klass,
Atom name,
ImmutableByteArray desc)
Utility function.
|
ClassLoaderReference |
getApplicationLoader()
Return the information regarding the application loader.
|
ArrayClassLoader |
getArrayClassLoader() |
Set<Language> |
getBaseLanguages() |
SetOfClasses |
getExclusions() |
protected Object |
getExclusionString() |
ClassLoaderReference |
getExtensionLoader()
Return the information regarding the extension loader.
|
String |
getJavaLibraryVersion() |
Language |
getLanguage(Atom name) |
Collection<Language> |
getLanguages() |
ClassLoaderReference |
getLoader(Atom name) |
String |
getLoaderImpl(ClassLoaderReference ref) |
Collection<ClassLoaderReference> |
getLoaders() |
List<Module> |
getModules(ClassLoaderReference loader) |
int |
getNumberOfLoaders() |
ClassLoaderReference |
getPrimordialLoader()
Return the information regarding the primordial loader.
|
ClassLoaderReference |
getSyntheticLoader()
Return the information regarding the application loader.
|
protected void |
initCoreForJava()
Initialize the standard 3 class loaders for java analysis
|
protected void |
initForJava()
Initialize a scope for java analysis
|
protected void |
initSynthetic(ClassLoaderReference parent)
Create the class loader for synthetic classes.
|
boolean |
isApplicationLoader(IClassLoader loader) |
boolean |
isJava14Libraries() |
boolean |
isJava15Libraries() |
boolean |
isJava16Libraries() |
boolean |
isJava17Libraries() |
boolean |
isJava18Libraries() |
void |
setExclusions(SetOfClasses classes) |
void |
setLoaderImpl(ClassLoaderReference ref,
String implClass) |
ShallowAnalysisScope |
toShallowAnalysisScope()
Creates a "serializable" version of the analysis scope.
|
String |
toString() |
public static final Atom PRIMORDIAL
public static final Atom EXTENSION
public static final Atom APPLICATION
public static final Atom SYNTHETIC
protected final LinkedHashMap<Atom,ClassLoaderReference> loadersByName
protected AnalysisScope(Collection<? extends Language> languages)
public static AnalysisScope createJavaAnalysisScope()
protected void initForJava()
protected void initCoreForJava()
protected void initSynthetic(ClassLoaderReference parent)
public boolean isApplicationLoader(IClassLoader loader)
public ClassLoaderReference getPrimordialLoader()
public ClassLoaderReference getExtensionLoader()
public ClassLoaderReference getApplicationLoader()
public ClassLoaderReference getSyntheticLoader()
public Collection<Language> getLanguages()
public Set<Language> getBaseLanguages()
public void addSourceFileToScope(ClassLoaderReference loader, File file, String fileName) throws IllegalArgumentException
IllegalArgumentException
public void addClassFileToScope(ClassLoaderReference loader, File file) throws IllegalArgumentException, InvalidClassFileException
public void addToScope(ClassLoaderReference loader, JarFile file)
public void addToScope(ClassLoaderReference loader, Module m)
public void addToScope(AnalysisScope other)
public void addToScopeHead(ClassLoaderReference loader, Module m)
public ClassLoaderReference getLoader(Atom name) throws IllegalArgumentException
name
.IllegalArgumentException
- if name is nullprotected ClassLoaderReference classLoaderName2Ref(String clName)
public String getLoaderImpl(ClassLoaderReference ref)
public void setLoaderImpl(ClassLoaderReference ref, String implClass)
public Collection<ClassLoaderReference> getLoaders()
public int getNumberOfLoaders()
public SetOfClasses getExclusions()
public void setExclusions(SetOfClasses classes)
protected Object getExclusionString()
public MethodReference findMethod(Atom loader, String klass, Atom name, ImmutableByteArray desc)
public List<Module> getModules(ClassLoaderReference loader)
public ArrayClassLoader getArrayClassLoader()
public String getJavaLibraryVersion() throws IllegalStateException
IllegalStateException
public boolean isJava18Libraries() throws IllegalStateException
IllegalStateException
public boolean isJava17Libraries() throws IllegalStateException
IllegalStateException
public boolean isJava16Libraries() throws IllegalStateException
IllegalStateException
public boolean isJava15Libraries() throws IllegalStateException
IllegalStateException
public boolean isJava14Libraries() throws IllegalStateException
IllegalStateException
public ShallowAnalysisScope toShallowAnalysisScope() throws NotSerializableException
NotSerializableException