Class ModuleMetadataMap.ModuleMetadata
- java.lang.Object
-
- com.google.javascript.jscomp.modules.ModuleMetadataMap.ModuleMetadata
-
- Enclosing class:
- ModuleMetadataMap
public abstract static class ModuleMetadataMap.ModuleMetadata extends java.lang.Object
Struct containing basic information about a module/script including its type and goog namespaces.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModuleMetadataMap.ModuleMetadata.Builder
Builder forModuleMetadataMap.ModuleMetadata
.
-
Constructor Summary
Constructors Constructor Description ModuleMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ModuleMetadataMap.ModuleMetadata.Builder
builder()
abstract com.google.common.collect.ImmutableMultiset<java.lang.String>
dynamicallyRequiredGoogNamespaces()
Closure namespaces this file dynamically require, i.e., arguments to goog.requireDynamic() calls.boolean
equals(java.lang.Object other)
abstract com.google.common.collect.ImmutableMultiset<java.lang.String>
es6ImportSpecifiers()
Raw text of all ES6 import specifiers (includes "export from" as well).abstract com.google.common.collect.ImmutableMultiset<java.lang.String>
googNamespaces()
Closure namespaces that this file is associated with.int
hashCode()
boolean
isCommonJs()
boolean
isEs6Module()
boolean
isGoogModule()
boolean
isGoogProvide()
boolean
isLegacyGoogModule()
boolean
isModule()
Whether this is a module (with it's own local scope).boolean
isNonLegacyGoogModule()
boolean
isNonProvideScript()
abstract boolean
isTestOnly()
Whether goog.setTestOnly was called.abstract ModuleMetadataMap.ModuleType
moduleType()
abstract com.google.common.collect.ImmutableList<ModuleMetadataMap.ModuleMetadata>
nestedModules()
abstract @Nullable ModuleLoader.ModulePath
path()
abstract @Nullable Node
rootNode()
AST node that represents the root of this module.abstract com.google.common.collect.ImmutableMultiset<java.lang.String>
stronglyRequiredGoogNamespaces()
Closure namespaces this file strongly requires, i.e., arguments to goog.require calls.abstract boolean
usesClosure()
Whether this file uses Closure Library at all.abstract com.google.common.collect.ImmutableMultiset<java.lang.String>
weaklyRequiredGoogNamespaces()
Closure namespaces this file weakly requires, i.e., arguments to goog.requireType calls.
-
-
-
Method Detail
-
moduleType
public abstract ModuleMetadataMap.ModuleType moduleType()
-
isEs6Module
public boolean isEs6Module()
-
isGoogModule
public boolean isGoogModule()
-
isNonLegacyGoogModule
public boolean isNonLegacyGoogModule()
-
isLegacyGoogModule
public boolean isLegacyGoogModule()
-
isGoogProvide
public boolean isGoogProvide()
-
isCommonJs
public boolean isCommonJs()
-
isNonProvideScript
public boolean isNonProvideScript()
-
isModule
public boolean isModule()
Whether this is a module (with it's own local scope).
-
rootNode
public abstract @Nullable Node rootNode()
AST node that represents the root of this module.May be null if this is a synthetic piece of metadata - e.g. in a test, or something used as a fallback.
-
usesClosure
public abstract boolean usesClosure()
Whether this file uses Closure Library at all. Note that a file could use Closure Library even without calling goog.provide/module/require - there are some primitives in base.js that can be used without being required like goog.isArray.If this is true this indicates the base.js is needed and is not part of this script - it is an EXTERNAL dependencym otherwise false. If this is also false if Closure Library is part of this script - e.g. a bundle with base.js. So something could be a "goog.provide'd file", but not use Closure if the bundle already contains Closure.
-
isTestOnly
public abstract boolean isTestOnly()
Whether goog.setTestOnly was called.
-
googNamespaces
public abstract com.google.common.collect.ImmutableMultiset<java.lang.String> googNamespaces()
Closure namespaces that this file is associated with. Created by goog.provide, goog.module, and goog.declareModuleId.This is a multiset as it does not warn on duplicate namespaces, but will still encapsulate that information with this multiset.
-
stronglyRequiredGoogNamespaces
public abstract com.google.common.collect.ImmutableMultiset<java.lang.String> stronglyRequiredGoogNamespaces()
Closure namespaces this file strongly requires, i.e., arguments to goog.require calls.This is a multiset as it does not warn on duplicate namespaces, but will still encapsulate that information with this multiset.
-
dynamicallyRequiredGoogNamespaces
public abstract com.google.common.collect.ImmutableMultiset<java.lang.String> dynamicallyRequiredGoogNamespaces()
Closure namespaces this file dynamically require, i.e., arguments to goog.requireDynamic() calls.This is a multiset as it does not warn on duplicate namespaces, but will still encapsulate that information with this multiset.
-
weaklyRequiredGoogNamespaces
public abstract com.google.common.collect.ImmutableMultiset<java.lang.String> weaklyRequiredGoogNamespaces()
Closure namespaces this file weakly requires, i.e., arguments to goog.requireType calls.This is a multiset as it does not warn on duplicate namespaces, but will still encapsulate that information with this multiset.
-
es6ImportSpecifiers
public abstract com.google.common.collect.ImmutableMultiset<java.lang.String> es6ImportSpecifiers()
Raw text of all ES6 import specifiers (includes "export from" as well).
-
nestedModules
public abstract com.google.common.collect.ImmutableList<ModuleMetadataMap.ModuleMetadata> nestedModules()
-
path
public abstract @Nullable ModuleLoader.ModulePath path()
-
builder
public static ModuleMetadataMap.ModuleMetadata.Builder builder()
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-