Package com.google.javascript.jscomp
Class ModuleIdentifier
java.lang.Object
com.google.javascript.jscomp.ModuleIdentifier
- All Implemented Interfaces:
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleIdentifier
forClosure
(String name) Returns an identifier for a Closure namespace.static ModuleIdentifier
Returns an identifier for an ES or CommonJS module.static ModuleIdentifier
forFlagValue
(String flagValue) Returns an identifier for an --entry_point flag value.abstract String
Returns the Closure namespace name.abstract String
Returns the module name.abstract String
getName()
Returns the user-provided name.final String
toString()
-
Constructor Details
-
ModuleIdentifier
public ModuleIdentifier()
-
-
Method Details
-
getName
Returns the user-provided name. -
getClosureNamespace
Returns the Closure namespace name. -
getModuleName
Returns the module name. -
toString
-
forClosure
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
Returns an identifier for an ES or CommonJS module.- Parameters:
filepath
- Path to the ES or CommonJS module.
-
forFlagValue
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.
-