Class 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.
    • Constructor Detail

      • ModuleMetadata

        public ModuleMetadata()
    • Method Detail

      • 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

        @Nullable
        public abstract 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.

      • 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).
      • equals

        public final boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object