public class ClassLoaderImpl extends Object implements IClassLoader
Modifier and Type | Field and Description |
---|---|
protected IClassHierarchy |
cha
Governing class hierarchy
|
static int |
DEBUG_LEVEL |
protected Map<TypeName,IClass> |
loadedClasses
A mapping from class name (TypeName) to IClass
|
Constructor and Description |
---|
ClassLoaderImpl(ClassLoaderReference loader,
ArrayClassLoader arrayClassLoader,
IClassLoader parent,
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.
|
Reader |
getSource(IClass klass) |
Reader |
getSource(IMethod method,
int offset) |
String |
getSourceFileName(IClass klass) |
String |
getSourceFileName(IMethod method,
int offset) |
void |
init(List<Module> modules)
Initialize internal data structures
|
Iterator<IClass> |
iterateAllClasses() |
protected void |
loadAllSources(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(Collection<IClass> toRemove)
blow away references to any classes in the set
|
String |
toString() |
public static final int DEBUG_LEVEL
protected final Map<TypeName,IClass> loadedClasses
protected final IClassHierarchy cha
public ClassLoaderImpl(ClassLoaderReference loader, ArrayClassLoader arrayClassLoader, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha)
loader
- class loader reference identifying this loaderparent
- parent loader for delegationexclusions
- set of classes to exclude from loadingprotected void loadAllSources(Set<ModuleEntry> sourceModules)
public void init(List<Module> modules) throws IOException
init
in interface IClassLoader
IllegalArgumentException
- if modules is nullIOException
public ClassLoaderReference getReference()
IClassLoader
getReference
in interface IClassLoader
public Iterator<IClass> iterateAllClasses()
iterateAllClasses
in interface IClassLoader
public IClass lookupClass(TypeName className)
IClassLoader
lookupClass
in interface IClassLoader
className
- name of the classpublic IClassLoader getParent()
getParent
in interface IClassLoader
public Atom getName()
getName
in interface IClassLoader
public Language getLanguage()
getLanguage
in interface IClassLoader
public int getNumberOfClasses()
getNumberOfClasses
in interface IClassLoader
public int getNumberOfMethods()
getNumberOfMethods
in interface IClassLoader
public String getSourceFileName(IClass klass)
getSourceFileName
in interface IClassLoader
klass
- the class for which information is desired.public Reader getSource(IMethod method, int offset)
getSource
in interface IClassLoader
method
- The method for which information is desiredoffset
- an offset into the bytecode of the given method.public String getSourceFileName(IMethod method, int offset)
getSourceFileName
in interface IClassLoader
method
- The method for which information is desiredoffset
- an offset into the bytecode of the given method.public Reader getSource(IClass klass)
getSource
in interface IClassLoader
public void removeAll(Collection<IClass> toRemove)
IClassLoader
removeAll
in interface IClassLoader
toRemove
- Collectionpublic SSAInstructionFactory getInstructionFactory()
getInstructionFactory
in interface IClassLoader