Class ModuleIdentifier

  • All Implemented Interfaces:
    java.io.Serializable

    @Immutable
    public abstract class ModuleIdentifier
    extends java.lang.Object
    implements java.io.Serializable
    Basic information on an entry point module.

    Closure entry points are namespace names, while ES and CommonJS entry points are file paths which are normalized to a namespace name.

    This class allows error messages to be based on the user-provided name rather than the normalized name.

    See Also:
    Serialized Form
    • Constructor Detail

      • ModuleIdentifier

        public ModuleIdentifier()
    • Method Detail

      • getName

        public abstract java.lang.String getName()
        Returns the user-provided name.
      • getClosureNamespace

        public abstract java.lang.String getClosureNamespace()
        Returns the Closure namespace name.
      • getModuleName

        public abstract java.lang.String getModuleName()
        Returns the module name.
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • forClosure

        public static ModuleIdentifier forClosure​(java.lang.String name)
        Returns an identifier for a Closure namespace.
        Parameters:
        name - The Closure namespace. It may be in one of the formats `name.space`, `goog:name.space` or `goog:moduleName:name.space`, where the latter specifies that the module and namespace names are different.
      • forFile

        public static ModuleIdentifier forFile​(java.lang.String filepath)
        Returns an identifier for an ES or CommonJS module.
        Parameters:
        filepath - Path to the ES or CommonJS module.
      • forFlagValue

        public static ModuleIdentifier forFlagValue​(java.lang.String flagValue)
        Returns an identifier for an --entry_point flag value.
        Parameters:
        flagValue - The flag value. If it is in one of the formats `goog:name.space` or `goog:moduleName:name.space`, it is interpreted as a Closure namespace. Otherwise, it is interpreted as the path to an ES or CommonJS module.