public final class JavaScriptModuleConfiguration extends Object
ModuleManager
service; the contribution key is the module name
(typically, a single word).
In some cases, an instance may be created and contributed to override a default module; if the module has no dependencies,
exports, or initExpression (that is, if it is a proper AMD module, where such dependencies are provided inside
the module itself), then no client-side shim configuration will be written for the module, but requests for the
module will be satisfied by the resource.'AMDWrapper
Modifier and Type | Field and Description |
---|---|
Resource |
resource
The resource for this shim module.
|
Constructor and Description |
---|
JavaScriptModuleConfiguration(Resource resource) |
Modifier and Type | Method and Description |
---|---|
JavaScriptModuleConfiguration |
dependsOn(String... moduleNames)
A list of other module names the shim depends on.
|
JavaScriptModuleConfiguration |
exports(String exports)
The name of a global variable exported by the module.
|
List<String> |
getDependencies() |
String |
getExports() |
String |
getInitExpression() |
boolean |
getNeedsConfiguration()
Returns true if the module contains any additional configuration beyond its
Resource . |
JavaScriptModuleConfiguration |
initializeWith(String expression)
Used as an alternative to exports(String), this allows a short expression to be specified; the
expression is used to initialize, clean up, and (usually) return the module's export value.
|
public JavaScriptModuleConfiguration(Resource resource)
public JavaScriptModuleConfiguration dependsOn(String... moduleNames)
moduleNames
- public List<String> getDependencies()
public JavaScriptModuleConfiguration exports(String exports)
public String getExports()
public JavaScriptModuleConfiguration initializeWith(String expression)
exports
even if you provide a initializeWith(String)
}.expression
- initialization expressionpublic String getInitExpression()
public boolean getNeedsConfiguration()
Resource
.5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.