|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.joanju.cg.api.CgAPI
public class CgAPI
This is the public API to Joanju Callgraph. You may create an instance or use the default instance.
The only part of the API that triggers a refresh to the Callgraph database is the buildOrRefresh() function. Everything else treats the database as "read only".
Database location note: Joanju Callgraph uses the Eclipse API plugin.getStateLocation() in order to set the database location. If there is no Eclipse workbench, then "callgraphdb" in the context directory is used. For unit tests, that's just the "./" working directory. As a servlet in a container like Tomcat, that's the directory that Callgraph itself was installed into.
getDefault()
,
buildOrRefresh(java.lang.String, java.io.File)
Constructor Summary | |
---|---|
CgAPI()
|
Method Summary | |
---|---|
void |
buildIfNecessary(ParseUnit pu)
Performs build/refresh on a parse unit only if it hasn't been built or is stale. |
void |
buildOrRefresh(java.lang.String projectName,
java.util.Collection<java.io.File> compileUnitSourceFiles)
Same as buildOrRefresh(String, File), but for a collection of files. |
void |
buildOrRefresh(java.lang.String projectName,
java.io.File compileUnitSourceFile)
Build or refresh the database for a given compile unit's source file. |
static int |
findOnPropathGetID(java.lang.String filename)
Find a file on PROPATH and return a string ID for it. |
static int[] |
generateFileIndex(ParseUnit parseUnit)
The filenames from the Callgraph API are lowercased canonical, but the ones we get from the ParseUnit are not. |
java.util.ArrayList<CallSite> |
getCallSites(java.io.File file)
Get the list of call sites found in a compile unit. |
static CgAPI |
getDefault()
Get a default instance of this API. |
java.util.ArrayList<Procedure> |
getProcedures(java.io.File file)
Get the list of procedures found in a compile unit. |
int |
lookupStringID(java.lang.String string)
Lookup a unique integer ID for a given string. |
java.lang.String |
lookupStringValue(int id)
Lookup the string value for a unique integer ID. |
void |
updateCuFileTable()
Update the table of compile unit files for the current project. |
void |
updateCuFileTable(java.lang.String projectname)
Update the table of compile unit files for the input project name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CgAPI()
getDefault()
Method Detail |
---|
public void buildIfNecessary(ParseUnit pu) throws java.lang.Exception
java.lang.Exception
public void buildOrRefresh(java.lang.String projectName, java.io.File compileUnitSourceFile) throws java.lang.Exception
ProRefactor's project settings - especially PROPATH and schema names - must be configured.
java.lang.Exception
public void buildOrRefresh(java.lang.String projectName, java.util.Collection<java.io.File> compileUnitSourceFiles) throws java.lang.Exception
java.lang.Exception
buildOrRefresh(String, File)
public static int findOnPropathGetID(java.lang.String filename) throws java.sql.SQLException, java.io.IOException
java.io.IOException
- if getCanonicalPath fails
java.sql.SQLException
- if the database access failspublic static int[] generateFileIndex(ParseUnit parseUnit) throws java.lang.Exception
java.lang.Exception
lookupStringValue(int)
public java.util.ArrayList<CallSite> getCallSites(java.io.File file) throws java.sql.SQLException, java.io.IOException
file
- Can be fully qualified, or else must be found on the current project's path.
java.io.IOException
java.sql.SQLException
public static CgAPI getDefault()
public java.util.ArrayList<Procedure> getProcedures(java.io.File file) throws java.sql.SQLException, java.io.IOException
file
- Can be fully qualified, or else must be found on the current project's path.
java.io.IOException
java.sql.SQLException
public int lookupStringID(java.lang.String string) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String lookupStringValue(int id) throws java.sql.SQLException
java.sql.SQLException
public void updateCuFileTable() throws java.lang.Exception
new CuFilenamesBuilder().run();
.
java.lang.Exception
CuFileTable
public void updateCuFileTable(java.lang.String projectname) throws java.lang.Exception
java.lang.Exception
CuFileTable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |