| java.lang.Object | |
| ↳ | com.microstrategy.web.app.utils.JavaScriptDependencyAnalyzer |
Known Direct Subclasses
|
This class is used to provide dependency analysis of JavaScript files. The caller is expected to specify any number of required JavaScript files and this class can produce a complete list of JavaScript files (implicitly adding all dependent JavaScript files) and sort them in order of increasing dependencies.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| protected File | dependencyFile | ||||||||||
| protected String | verboseLevel | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
JavaScriptDependencyAnalyzer()
Creates an instance of a JavaScript Dependency Analyzer.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
add(String jsFilePath)
Adds a file dependency to the dependency graph.
| ||||||||||
| void |
addInterScriptDependencyEdge(String fromJsFileName, String toJsFileName)
Add an Inter-JavaScript dependency relationship.
| ||||||||||
| void |
clear()
Clear the current dependency graph.
| ||||||||||
| static List<String> |
getClassesInFile(String fileName)
Returns the list of JavaScript classes defined for a given JavaScript file.
| ||||||||||
| static String |
getFileImplementingClass(String className)
Returns the path to the JavaScript file that implements the specified JavaScript class.
| ||||||||||
| Iterator<String> |
getSortedList()
Returns a list of required JavaScript files, sorted in order of
increasing dependencies.
| ||||||||||
| static void |
loadClassInformation(AppContext appContext, String bundleName)
Load the JavaScript class information from the specified "bundle name".
| ||||||||||
| static void |
loadFileDependencies(AppContext appContext, String bundleName)
Load the file dependencies from the specified "bundle name".
| ||||||||||
| void |
setMessageRouter(MessageRouter msgRouter)
Returns the MessageRouter instance used by the
JavaScriptDependencyAnalyzer instance (and on the underlying Dependency
Graph).
| ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void | loadFileDependenciesFile(File depPropFile, String resFolderPrefix) | ||||||||||
| boolean | parseCommandLine(String[] args) | ||||||||||
| void | processCommands(InputStream in, PrintStream out) | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Creates an instance of a JavaScript Dependency Analyzer.
Adds a file dependency to the dependency graph.
| jsFilePath | The path to the JS file to include. |
|---|
Add an Inter-JavaScript dependency relationship. This dependence is represented as an edge in our dependency DAG.
| fromJsFileName | String the "parent" JavaScript file name that should appear before the toJSFileName in the page. |
|---|---|
| toJsFileName | String the "dependent" JavaScript file name that should appear after the fromJSFileName in the page. |
Clear the current dependency graph.
Returns the list of JavaScript classes defined for a given JavaScript file.
| fileName | The path to the JavaScript file. |
|---|
Returns the path to the JavaScript file that implements the specified JavaScript class.
| className | The name of the JavaScript class to investigate. |
|---|
Returns a list of required JavaScript files, sorted in order of increasing dependencies.
Load the JavaScript class information from the specified "bundle name". This should only be done at application startup.
| appContext | The AppContext instance which provides
application runtime context. |
|---|---|
| bundleName | The name of the bundle that holds our JavaScript class information. |
| MissingResourceException | If we are unable to find the specified bundle. |
|---|
Load the file dependencies from the specified "bundle name". This should only be done at application startup.
| appContext | The AppContext instance which provides
application runtime context. |
|---|---|
| bundleName | The name of the bundle that holds our dependency information. |
| MissingResourceException | If we are unable to find the specified bundle. |
|---|
Returns the MessageRouter instance used by the JavaScriptDependencyAnalyzer instance (and on the underlying Dependency Graph).
| msgRouter | A MessageRouter instance.
|
|---|
| IOException |
|---|