Package org.pkl.core.module
Class ModuleKeys
java.lang.Object
org.pkl.core.module.ModuleKeys
Utilities for creating and using
ModuleKeys.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a module imported via theprojectpackagescheme. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleKeyCreates a module key that behaves likedelegate, except that it returnstextas its loaded source.static ModuleKeyclassPath(URI uri, ClassLoader classLoader) Creates a module key for amodulepath:module to be resolved with the given class loader.static ModuleKeyCreates a module key for afile:module.static ModuleKeygenericUrl(URI url) Creates a module key for the module with the given URL.static ModuleKeyCreates a module key forhttp:andhttps:uris.static booleanisBaseModule(ModuleKey module) Tells if the given module is the standard library module with URIpkl:base.static booleanisStdLibModule(ModuleKey module) Tells if the given module is a standard library module.static ModuleKeymodulePath(URI uri, ModulePathResolver resolver) Creates a module key for amodulepath:module to be resolved with the given resolver.static ModuleKeyCreates a module key for the given package.static ModuleKeyprojectpackage(URI uri) static ModuleKeystandardLibrary(URI uri) Creates a module key for the standard library module with the given URI.static ModuleKeyCreates a module key identified by the given URI and backed by the given source code.static ModuleKeyCreates a module key identified by the given URI and backed by the given source code.
-
Method Details
-
isStdLibModule
Tells if the given module is a standard library module. Standard library modules ship with the language and have a URI of the formpkl:<simple module name>. -
isBaseModule
Tells if the given module is the standard library module with URIpkl:base. -
synthetic
Creates a module key identified by the given URI and backed by the given source code. Shorthand forsynthetic(uri, uri, uri, sourceText, false. -
synthetic
public static ModuleKey synthetic(URI uri, URI importBaseUri, URI resolvedUri, String sourceText, boolean isCached) Creates a module key identified by the given URI and backed by the given source code. Module imports will be resolved against the givenimportBaseUri. IfisCachedistrue, the resulting module will be cached withuriandresolvedUriused as cache keys. -
standardLibrary
Creates a module key for the standard library module with the given URI. The URI for a standard library module ispkl:<simple module name>. For example, the URI for the base library module ispkl:base. -
file
Creates a module key for afile:module. -
modulePath
Creates a module key for amodulepath:module to be resolved with the given resolver. -
classPath
Creates a module key for amodulepath:module to be resolved with the given class loader. -
genericUrl
Creates a module key for the module with the given URL. -
http
Creates a module key forhttp:andhttps:uris. -
pkg
Creates a module key for the given package.- Throws:
URISyntaxException
-
projectpackage
- Throws:
URISyntaxException
-
cached
Creates a module key that behaves likedelegate, except that it returnstextas its loaded source.
-