public final class ModuleLoader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ModuleLoader.ModulePath
A path to a module.
|
static class |
ModuleLoader.PathResolver
An enum indicating whether to absolutize paths.
|
static class |
ModuleLoader.ResolutionMode
An enum used to specify what algorithm to use to locate non path-based modules
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_FILENAME_PREFIX
The default module root, the current directory.
|
static ModuleLoader |
EMPTY
A trivial module loader with no roots.
|
static DiagnosticType |
INVALID_MODULE_PATH |
static DiagnosticType |
LOAD_WARNING |
static DiagnosticType |
MODULE_CONFLICT |
static java.lang.String |
MODULE_SLASH
According to the spec, the forward slash should be the delimiter on all platforms.
|
Constructor and Description |
---|
ModuleLoader(ErrorHandler errorHandler,
java.lang.Iterable<java.lang.String> moduleRoots,
java.lang.Iterable<? extends DependencyInfo> inputs,
ModuleLoader.PathResolver pathResolver,
ModuleLoader.ResolutionMode resolutionMode) |
ModuleLoader(ErrorHandler errorHandler,
java.lang.Iterable<java.lang.String> moduleRoots,
java.lang.Iterable<? extends DependencyInfo> inputs,
ModuleLoader.PathResolver pathResolver,
ModuleLoader.ResolutionMode resolutionMode,
java.util.Map<java.lang.String,java.lang.String> packageJsonMainEntries)
Creates an instance of the module loader which can be used to locate ES6 and CommonJS modules.
|
ModuleLoader(ErrorHandler errorHandler,
java.lang.Iterable<java.lang.String> moduleRoots,
java.lang.Iterable<? extends DependencyInfo> inputs,
ModuleLoader.ResolutionMode resolutionMode) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
getPackageJsonMainEntries() |
static boolean |
isAbsoluteIdentifier(java.lang.String name)
Whether this is absolute to the compilation.
|
static boolean |
isAmbiguousIdentifier(java.lang.String name)
Whether this is neither absolute or relative.
|
static boolean |
isPathIdentifier(java.lang.String name)
Whether name is a path-based identifier (has a '/' character)
|
static boolean |
isRelativeIdentifier(java.lang.String name)
Whether this is relative to the current file, or a top-level identifier.
|
ModuleLoader.ModulePath |
resolve(java.lang.String path)
Resolves a path into a
ModuleLoader.ModulePath . |
public static final DiagnosticType MODULE_CONFLICT
public static final java.lang.String MODULE_SLASH
public static final java.lang.String DEFAULT_FILENAME_PREFIX
public static final DiagnosticType LOAD_WARNING
public static final DiagnosticType INVALID_MODULE_PATH
public static final ModuleLoader EMPTY
public ModuleLoader(@Nullable ErrorHandler errorHandler, java.lang.Iterable<java.lang.String> moduleRoots, java.lang.Iterable<? extends DependencyInfo> inputs, ModuleLoader.PathResolver pathResolver, ModuleLoader.ResolutionMode resolutionMode, java.util.Map<java.lang.String,java.lang.String> packageJsonMainEntries)
inputs
- All inputs to the compilation process.public ModuleLoader(@Nullable ErrorHandler errorHandler, java.lang.Iterable<java.lang.String> moduleRoots, java.lang.Iterable<? extends DependencyInfo> inputs, ModuleLoader.ResolutionMode resolutionMode)
public ModuleLoader(@Nullable ErrorHandler errorHandler, java.lang.Iterable<java.lang.String> moduleRoots, java.lang.Iterable<? extends DependencyInfo> inputs, ModuleLoader.PathResolver pathResolver, ModuleLoader.ResolutionMode resolutionMode)
public java.util.Map<java.lang.String,java.lang.String> getPackageJsonMainEntries()
public ModuleLoader.ModulePath resolve(java.lang.String path)
ModuleLoader.ModulePath
.public static boolean isRelativeIdentifier(java.lang.String name)
public static boolean isAbsoluteIdentifier(java.lang.String name)
public static boolean isAmbiguousIdentifier(java.lang.String name)
public static boolean isPathIdentifier(java.lang.String name)
Copyright © 2009-2017 Google. All Rights Reserved.