public final class JSModule extends java.lang.Object implements DependencyInfo, java.io.Serializable
DependencyInfo.Base, DependencyInfo.Util| Constructor and Description |
|---|
JSModule(java.lang.String name)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.util.Set<JSModule> |
getAllDependencies()
Returns the transitive closure of dependencies starting from the
dependencies of this module.
|
CompilerInput |
getByName(java.lang.String name)
Returns the input with the given name or null if none.
|
java.util.List<JSModule> |
getDependencies()
Gets the list of modules that this module depends on.
|
int |
getDepth() |
int |
getIndex() |
java.util.List<CompilerInput> |
getInputs()
Gets this module's list of source code inputs.
|
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> |
getLoadFlags()
Gets the loading information for this file.
|
java.lang.String |
getName()
Gets the module name.
|
java.lang.String |
getPathRelativeToClosureBase()
Gets the path of this file relative to Closure's base.js file.
|
java.util.List<java.lang.String> |
getProvides()
Gets the symbols provided by this file.
|
java.util.List<java.lang.String> |
getRequires()
Gets the symbols required by this file.
|
java.util.Set<JSModule> |
getThisAndAllDependencies()
Returns this module and all of its dependencies in one list.
|
boolean |
isModule()
Whether the symbol is provided by a module
|
void |
remove(CompilerInput input)
Removes an input from this module.
|
void |
removeAll()
Removes all of the inputs from this module.
|
boolean |
removeByName(java.lang.String name)
Removes any input with the given name.
|
void |
setDepth(int dep) |
void |
setIndex(int index) |
void |
setName(java.lang.String name)
Sets the module name.
|
void |
sortInputsByDeps(AbstractCompiler compiler)
Puts the JS files into a topologically sorted order by their dependencies.
|
java.lang.String |
toString()
Returns the module name (primarily for debugging).
|
public JSModule(java.lang.String name)
name - A unique name for the modulepublic java.lang.String getName()
getName in interface DependencyInfopublic void setName(java.lang.String name)
public java.util.List<java.lang.String> getProvides()
DependencyInfogetProvides in interface DependencyInfopublic java.util.List<java.lang.String> getRequires()
DependencyInfogetRequires in interface DependencyInfopublic java.lang.String getPathRelativeToClosureBase()
DependencyInfogetPathRelativeToClosureBase in interface DependencyInfopublic com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getLoadFlags()
DependencyInfogetLoadFlags in interface DependencyInfopublic boolean isModule()
DependencyInfoisModule in interface DependencyInfopublic void add(SourceFile file)
public void add(CompilerInput input)
public void addAfter(CompilerInput input, CompilerInput other)
public void addDependency(JSModule dep)
public void remove(CompilerInput input)
public void removeAll()
public java.util.List<JSModule> getDependencies()
public java.util.Set<JSModule> getAllDependencies()
public java.util.Set<JSModule> getThisAndAllDependencies()
public java.util.List<CompilerInput> getInputs()
public CompilerInput getByName(java.lang.String name)
public boolean removeByName(java.lang.String name)
public java.lang.String toString()
toString in class java.lang.Objectpublic void sortInputsByDeps(AbstractCompiler compiler)
public void setDepth(int dep)
dep - the depth to setpublic int getDepth()
public void setIndex(int index)
public int getIndex()
Copyright © 2009-2017 Google. All Rights Reserved.