Interface IClassLoader
- All Known Implementing Classes:
BypassSyntheticClassLoader
,CAstAbstractLoader
,CAstAbstractModuleLoader
,ClassLoaderImpl
,ECJSourceLoaderImpl
,JavaScriptLoader
,JavaSourceLoaderImpl
,JDTSourceLoaderImpl
,WDexClassLoaderImpl
public interface IClassLoader
Base class for an object that represents a single Java classloader for analysis purposes.
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
int
int
Return the ClassLoaderReference for this class loader.getSourceFileName
(IClass klass) getSourceFileName
(IMethod method, int offset) void
Initialize internal data structures.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
-
Method Details
-
lookupClass
-
getReference
ClassLoaderReference getReference()Return the ClassLoaderReference for this class loader.- Returns:
- ClassLoaderReference
-
iterateAllClasses
-
getNumberOfClasses
int getNumberOfClasses()- Returns:
- the number of classes in scope to be loaded by this loader
-
getName
Atom getName()- Returns:
- the unique name that identifies this class loader.
-
getLanguage
Language getLanguage()- Returns:
- the unique name that identifies the programming language from which this class loader loads code.
-
getInstructionFactory
SSAInstructionFactory getInstructionFactory() -
getNumberOfMethods
int getNumberOfMethods() -
getSourceFileName
- Parameters:
method
- The method for which information is desiredoffset
- an offset into the bytecode of the given method.- Returns:
- name of the source file corresponding to the given offset in the given method. Note that this api allows a single method to arise from multiple source files, which is deliberate as it can happen in some languages.
-
getSource
-
getSourceFileName
- Parameters:
klass
- the class for which information is desired.- Returns:
- name of source file corresponding to the class, or null if not available
- Throws:
NoSuchElementException
- if this class was generated from more than one source file The assumption that a class is generated from a single source file is java specific, and will change in the future. In place of this API, use the version that takes a method and an offset, since that is now the granularity at which source file information will be recorded. SJF .. we should think about this deprecation. postponing deprecation for now.
-
getSource
- Returns:
- input stream representing the source file for a class, or null if not available
- Throws:
NoSuchElementException
- if this class was generated from more than one source file The assumption that a class is generated from a single source file is java specific, and will change in the future. In place of this API, use the version that takes a method and an offset, since that is now the granularity at which source file information will be recorded. SJF .. we should think about this deprecation. postponing deprecation for now.
-
getParent
IClassLoader getParent()- Returns:
- the parent IClassLoader, if any, or null
-
init
Initialize internal data structures.- Throws:
IllegalArgumentException
- if modules is nullIOException
-
removeAll
blow away references to any classes in the set- Parameters:
toRemove
- Collection<IClass>
-