public final class JSModule extends DependencyInfo.Base implements java.io.Serializable
DependencyInfo.Base, DependencyInfo.Require, DependencyInfo.Util
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
STRONG_MODULE_NAME |
static java.lang.String |
WEAK_MODULE_NAME |
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.
|
com.google.common.collect.ImmutableList<JSModule> |
getDependencies()
Gets the list of modules that this module depends on.
|
int |
getDepth() |
boolean |
getHasExternsAnnotation()
Whether the file '@externs' annotation.
|
boolean |
getHasNoCompileAnnotation()
Whether the file has the '@nocompile' annotation.
|
int |
getIndex() |
CompilerInput |
getInput(int i)
Returns the i-th source code input.
|
int |
getInputCount()
Returns the number of source code inputs.
|
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.
|
com.google.common.collect.ImmutableList<java.lang.String> |
getProvides()
Gets the symbols provided by this file.
|
com.google.common.collect.ImmutableList<DependencyInfo.Require> |
getRequires()
Gets the symbols required by this file.
|
java.util.Set<JSModule> |
getThisAndAllDependencies()
Returns this module and all of its dependencies in one list.
|
com.google.common.collect.ImmutableList<java.lang.String> |
getTypeRequires()
Gets the symbols type-required by this file (i.e.
|
boolean |
isModule()
Whether the symbol is provided by a module
|
boolean |
isSynthetic()
Returns whether this module is synthetic (i.e.
|
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).
|
getRequiredSymbols
public static final java.lang.String STRONG_MODULE_NAME
public static final java.lang.String WEAK_MODULE_NAME
public JSModule(java.lang.String name)
name
- A unique name for the modulepublic java.lang.String getName()
getName
in interface DependencyInfo
public void setName(java.lang.String name)
public com.google.common.collect.ImmutableList<java.lang.String> getProvides()
DependencyInfo
getProvides
in interface DependencyInfo
public boolean getHasExternsAnnotation()
DependencyInfo
getHasExternsAnnotation
in interface DependencyInfo
public boolean getHasNoCompileAnnotation()
DependencyInfo
getHasNoCompileAnnotation
in interface DependencyInfo
public com.google.common.collect.ImmutableList<DependencyInfo.Require> getRequires()
DependencyInfo
getRequires
in interface DependencyInfo
public com.google.common.collect.ImmutableList<java.lang.String> getTypeRequires()
DependencyInfo
getTypeRequires
in interface DependencyInfo
public java.lang.String getPathRelativeToClosureBase()
DependencyInfo
getPathRelativeToClosureBase
in interface DependencyInfo
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getLoadFlags()
DependencyInfo
getLoadFlags
in interface DependencyInfo
public boolean isModule()
DependencyInfo
isModule
in interface DependencyInfo
isModule
in class DependencyInfo.Base
public 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 com.google.common.collect.ImmutableList<JSModule> getDependencies()
public java.util.Set<JSModule> getAllDependencies()
public java.util.Set<JSModule> getThisAndAllDependencies()
public int getInputCount()
public CompilerInput getInput(int i)
public java.util.List<CompilerInput> getInputs()
public CompilerInput getByName(java.lang.String name)
public boolean removeByName(java.lang.String name)
public boolean isSynthetic()
public java.lang.String toString()
toString
in class java.lang.Object
public 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-2020 Google. All Rights Reserved.