soot
Class SourceLocator

java.lang.Object
  extended by soot.SourceLocator

public class SourceLocator
extends Object

Provides utility methods to retrieve an input stream for a class name, given a classfile, or jimple or baf output files.


Nested Class Summary
static class SourceLocator.FoundFile
           
 
Field Summary
protected  Set<ClassLoader> additionalClassLoaders
           
protected  Set<String> classesToLoad
           
 
Constructor Summary
SourceLocator(Singletons.Global g)
           
 
Method Summary
 void additionalClassLoader(ClassLoader c)
           
 void addToSourceToClassMap(String key, String val)
           
 Set<String> classesInDynamicPackage(String str)
           
 List<String> classPath()
           
protected  List<String> explodeClassPath(String classPath)
          Explodes a class path into a list of individual class path entries.
 List<String> getClassesUnder(String aPath)
           
 ClassSource getClassSource(String className)
          Given a class name, uses the soot-class-path to return a ClassSource for the given class.
 String getExtensionFor(int rep)
           
 String getFileNameFor(SootClass c, int rep)
           
 String getOutputDir()
           
 String getSourceForClass(String className)
          Returns the name of the class in which the (possibly inner) class className appears.
 HashMap<String,String> getSourceToClassMap()
           
 void invalidateClassPath()
           
 SourceLocator.FoundFile lookupInClassPath(String fileName)
          Searches for a file with the given name in the exploded classPath.
 void setClassProviders(List<ClassProvider> classProviders)
           
 void setSourceToClassMap(HashMap<String,String> map)
           
 List<String> sourcePath()
           
static SourceLocator v()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

additionalClassLoaders

protected Set<ClassLoader> additionalClassLoaders

classesToLoad

protected Set<String> classesToLoad
Constructor Detail

SourceLocator

public SourceLocator(Singletons.Global g)
Method Detail

v

public static SourceLocator v()

getClassSource

public ClassSource getClassSource(String className)
Given a class name, uses the soot-class-path to return a ClassSource for the given class.


additionalClassLoader

public void additionalClassLoader(ClassLoader c)

setClassProviders

public void setClassProviders(List<ClassProvider> classProviders)

classPath

public List<String> classPath()

invalidateClassPath

public void invalidateClassPath()

sourcePath

public List<String> sourcePath()

getClassesUnder

public List<String> getClassesUnder(String aPath)

getFileNameFor

public String getFileNameFor(SootClass c,
                             int rep)

classesInDynamicPackage

public Set<String> classesInDynamicPackage(String str)

getExtensionFor

public String getExtensionFor(int rep)

getOutputDir

public String getOutputDir()

explodeClassPath

protected List<String> explodeClassPath(String classPath)
Explodes a class path into a list of individual class path entries.


lookupInClassPath

public SourceLocator.FoundFile lookupInClassPath(String fileName)
Searches for a file with the given name in the exploded classPath.


getSourceToClassMap

public HashMap<String,String> getSourceToClassMap()

setSourceToClassMap

public void setSourceToClassMap(HashMap<String,String> map)

addToSourceToClassMap

public void addToSourceToClassMap(String key,
                                  String val)

getSourceForClass

public String getSourceForClass(String className)
Returns the name of the class in which the (possibly inner) class className appears.