|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.javascript.jscomp.JSModule
public class JSModule
A JavaScript module has a unique name, consists of a list of compiler inputs, and can depend on other modules.
Constructor Summary | |
---|---|
JSModule(String name)
Creates an instance. |
Method Summary | |
---|---|
void |
add(CompilerInput input)
Adds a source code input to this module. |
void |
add(SourceFile file)
Adds a source file input to this module. |
void |
addAfter(CompilerInput input,
CompilerInput other)
Adds a source code input to this module directly after other. |
void |
addDependency(JSModule dep)
Adds a dependency on another module. |
void |
addFirst(CompilerInput input)
Adds a source code input to this module. |
void |
addFirst(SourceFile file)
Adds a source file input to this module. |
void |
clearAsts()
Removes any references to nodes of the AST. |
Set<JSModule> |
getAllDependencies()
Returns the transitive closure of dependencies starting from the dependencies of this module. |
CompilerInput |
getByName(String name)
Returns the input with the given name or null if none. |
List<JSModule> |
getDependencies()
Gets the list of modules that this module depends on. |
int |
getDepth()
|
List<CompilerInput> |
getInputs()
Gets this module's list of source code inputs. |
String |
getName()
Gets the module name. |
String |
getPathRelativeToClosureBase()
Gets the path of this file relative to Closure's base.js file. |
List<String> |
getProvides()
Gets the symbols provided by this file. |
List<String> |
getRequires()
Gets the symbols required by this file. |
Set<JSModule> |
getThisAndAllDependencies()
Returns this module and all of its dependencies in one list. |
void |
remove(CompilerInput input)
Removes an input from this module. |
void |
removeAll()
Removes all of the inputs from this module. |
boolean |
removeByName(String name)
Removes any input with the given name. |
void |
setDepth(int dep)
|
void |
sortInputsByDeps(Compiler compiler)
Puts the JS files into a topologically sorted order by their dependencies. |
static JSModule[] |
sortJsModules(Collection<JSModule> modules)
Returns the given collection of modules in topological order. |
String |
toString()
Returns the module name (primarily for debugging). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JSModule(String name)
name
- A unique name for the moduleMethod Detail |
---|
public String getName()
getName
in interface DependencyInfo
public List<String> getProvides()
DependencyInfo
getProvides
in interface DependencyInfo
public List<String> getRequires()
DependencyInfo
getRequires
in interface DependencyInfo
public String getPathRelativeToClosureBase()
DependencyInfo
getPathRelativeToClosureBase
in interface DependencyInfo
public void add(SourceFile file)
public void addFirst(SourceFile file)
public void add(CompilerInput input)
public void addFirst(CompilerInput input)
public void addAfter(CompilerInput input, CompilerInput other)
public void addDependency(JSModule dep)
public void remove(CompilerInput input)
public void removeAll()
public List<JSModule> getDependencies()
public Set<JSModule> getAllDependencies()
public Set<JSModule> getThisAndAllDependencies()
public List<CompilerInput> getInputs()
public CompilerInput getByName(String name)
public boolean removeByName(String name)
public String toString()
toString
in class Object
public void clearAsts()
public void sortInputsByDeps(Compiler compiler)
public static JSModule[] sortJsModules(Collection<JSModule> modules) throws SortedDependencies.CircularDependencyException
SortedDependencies.CircularDependencyException
public void setDepth(int dep)
dep
- the depth to setpublic int getDepth()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |