public class ClassLoaderImpl extends java.lang.Object implements IClassLoader
| Modifier and Type | Field and Description |
|---|---|
protected IClassHierarchy |
cha
Governing class hierarchy
|
static int |
DEBUG_LEVEL |
protected java.util.Map<TypeName,IClass> |
loadedClasses
A mapping from class name (TypeName) to IClass
|
| Constructor and Description |
|---|
ClassLoaderImpl(ClassLoaderReference loader,
ArrayClassLoader arrayClassLoader,
IClassLoader parent,
com.ibm.wala.util.config.SetOfClasses exclusions,
IClassHierarchy cha) |
| Modifier and Type | Method and Description |
|---|---|
SSAInstructionFactory |
getInstructionFactory() |
Language |
getLanguage() |
Atom |
getName() |
int |
getNumberOfClasses() |
int |
getNumberOfMethods() |
IClassLoader |
getParent()
Method getParent.
|
ClassLoaderReference |
getReference()
Return the ClassLoaderReference for this class loader.
|
java.io.Reader |
getSource(IClass klass) |
java.io.Reader |
getSource(IMethod method,
int offset) |
java.lang.String |
getSourceFileName(IClass klass) |
java.lang.String |
getSourceFileName(IMethod method,
int offset) |
void |
init(java.util.List<Module> modules)
Initialize internal data structures
|
java.util.Iterator<IClass> |
iterateAllClasses() |
protected void |
loadAllSources(java.util.Set<ModuleEntry> sourceModules)
Set up mapping from type name to Module Entry
|
IClass |
lookupClass(TypeName className)
Find and return the IClass defined by this class loader that corresponds to the given class
name.
|
void |
removeAll(java.util.Collection<IClass> toRemove)
blow away references to any classes in the set
|
java.lang.String |
toString() |
public static final int DEBUG_LEVEL
protected final java.util.Map<TypeName,IClass> loadedClasses
protected final IClassHierarchy cha
public ClassLoaderImpl(ClassLoaderReference loader, ArrayClassLoader arrayClassLoader, IClassLoader parent, com.ibm.wala.util.config.SetOfClasses exclusions, IClassHierarchy cha)
loader - class loader reference identifying this loaderparent - parent loader for delegationexclusions - set of classes to exclude from loadingprotected void loadAllSources(java.util.Set<ModuleEntry> sourceModules)
public void init(java.util.List<Module> modules) throws java.io.IOException
init in interface IClassLoaderjava.lang.IllegalArgumentException - if modules is nulljava.io.IOExceptionpublic ClassLoaderReference getReference()
IClassLoadergetReference in interface IClassLoaderpublic java.util.Iterator<IClass> iterateAllClasses()
iterateAllClasses in interface IClassLoaderpublic IClass lookupClass(TypeName className)
IClassLoaderlookupClass in interface IClassLoaderclassName - name of the classpublic IClassLoader getParent()
getParent in interface IClassLoaderpublic Atom getName()
getName in interface IClassLoaderpublic Language getLanguage()
getLanguage in interface IClassLoaderpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getNumberOfClasses()
getNumberOfClasses in interface IClassLoaderpublic int getNumberOfMethods()
getNumberOfMethods in interface IClassLoaderpublic java.lang.String getSourceFileName(IClass klass)
getSourceFileName in interface IClassLoaderklass - the class for which information is desired.public java.io.Reader getSource(IMethod method, int offset)
getSource in interface IClassLoadermethod - The method for which information is desiredoffset - an offset into the bytecode of the given method.public java.lang.String getSourceFileName(IMethod method, int offset)
getSourceFileName in interface IClassLoadermethod - The method for which information is desiredoffset - an offset into the bytecode of the given method.public java.io.Reader getSource(IClass klass)
getSource in interface IClassLoaderpublic void removeAll(java.util.Collection<IClass> toRemove)
IClassLoaderremoveAll in interface IClassLoadertoRemove - Collection<IClass>public SSAInstructionFactory getInstructionFactory()
getInstructionFactory in interface IClassLoader