Class SourceDirCallGraph


  • public class SourceDirCallGraph
    extends java.lang.Object
    Driver that constructs a call graph for an application specified as a directory of source code. Example of using the JDT front-end based on ECJ. Useful for getting some code to copy-paste.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doit​(java.lang.String[] args, SourceDirCallGraph.Processor processor)  
      protected java.lang.Iterable<com.ibm.wala.ipa.callgraph.Entrypoint> getEntrypoints​(java.lang.String mainClass, com.ibm.wala.ipa.cha.IClassHierarchy cha)  
      protected com.ibm.wala.classLoader.ClassLoaderFactory getLoaderFactory​(com.ibm.wala.ipa.callgraph.AnalysisScope scope)  
      static void main​(java.lang.String[] args)
      Usage: SourceDirCallGraph -sourceDir file_path -mainClass class_name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SourceDirCallGraph

        public SourceDirCallGraph()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws com.ibm.wala.ipa.cha.ClassHierarchyException,
                                java.lang.IllegalArgumentException,
                                com.ibm.wala.ipa.callgraph.CallGraphBuilderCancelException,
                                java.io.IOException
        Usage: SourceDirCallGraph -sourceDir file_path -mainClass class_name

        If given -mainClass, uses main() method of class_name as entrypoint. Class name should start with an 'L'.

        Example args: -sourceDir /tmp/srcTest -mainClass LFoo

        Throws:
        com.ibm.wala.ipa.cha.ClassHierarchyException
        java.lang.IllegalArgumentException
        com.ibm.wala.ipa.callgraph.CallGraphBuilderCancelException
        java.io.IOException
      • getLoaderFactory

        protected com.ibm.wala.classLoader.ClassLoaderFactory getLoaderFactory​(com.ibm.wala.ipa.callgraph.AnalysisScope scope)
      • doit

        public void doit​(java.lang.String[] args,
                         SourceDirCallGraph.Processor processor)
                  throws com.ibm.wala.ipa.cha.ClassHierarchyException,
                         java.lang.IllegalArgumentException,
                         com.ibm.wala.ipa.callgraph.CallGraphBuilderCancelException,
                         java.io.IOException
        Throws:
        com.ibm.wala.ipa.cha.ClassHierarchyException
        java.lang.IllegalArgumentException
        com.ibm.wala.ipa.callgraph.CallGraphBuilderCancelException
        java.io.IOException
      • getEntrypoints

        protected java.lang.Iterable<com.ibm.wala.ipa.callgraph.Entrypoint> getEntrypoints​(java.lang.String mainClass,
                                                                                           com.ibm.wala.ipa.cha.IClassHierarchy cha)