@Immutable
public abstract class ModuleIdentifier
extends java.lang.Object
implements java.io.Serializable
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.
Constructor and Description |
---|
ModuleIdentifier() |
Modifier and Type | Method and Description |
---|---|
static ModuleIdentifier |
forClosure(java.lang.String name)
Returns an identifier for a Closure namespace.
|
static ModuleIdentifier |
forFile(java.lang.String filepath)
Returns an identifier for an ES or CommonJS module.
|
static ModuleIdentifier |
forFlagValue(java.lang.String flagValue)
Returns an identifier for an --entry_point flag value.
|
abstract java.lang.String |
getClosureNamespace()
Returns the Closure namespace name.
|
abstract java.lang.String |
getModuleName()
Returns the module name.
|
abstract java.lang.String |
getName()
Returns the user-provided name.
|
java.lang.String |
toString() |
public abstract java.lang.String getName()
public abstract java.lang.String getClosureNamespace()
public abstract java.lang.String getModuleName()
public final java.lang.String toString()
toString
in class java.lang.Object
public static ModuleIdentifier forClosure(java.lang.String name)
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.public static ModuleIdentifier forFile(java.lang.String filepath)
filepath
- Path to the ES or CommonJS module.public static ModuleIdentifier forFlagValue(java.lang.String flagValue)
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.Copyright © 2009-2018 Google. All Rights Reserved.