Class ModuleScript
- java.lang.Object
- 
- org.mozilla.javascript.commonjs.module.ModuleScript
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class ModuleScript extends java.lang.Object implements java.io.SerializableRepresents a compiled CommonJS module script. TheRequirefunctions use them and obtain them through aModuleScriptProvider. Instances are immutable.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ModuleScript(Script script, java.net.URI uri, java.net.URI base)Creates a new CommonJS module.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URIgetBase()Returns the base URI from which this module source was loaded, or null if it was loaded from an absolute URI.ScriptgetScript()Returns the script object representing the code of the module.java.net.URIgetUri()Returns the URI of the module.booleanisSandboxed()Returns true if this script has a base URI and has a source URI that is contained within that base URI.
 
- 
- 
- 
Constructor Detail- 
ModuleScriptpublic ModuleScript(Script script, java.net.URI uri, java.net.URI base) Creates a new CommonJS module.- Parameters:
- script- the script representing the code of the module.
- uri- the URI of the module.
- base- the base URI, or null.
 
 
- 
 - 
Method Detail- 
getScriptpublic Script getScript() Returns the script object representing the code of the module.- Returns:
- the script object representing the code of the module.
 
 - 
getUripublic java.net.URI getUri() Returns the URI of the module.- Returns:
- the URI of the module.
 
 - 
getBasepublic java.net.URI getBase() Returns the base URI from which this module source was loaded, or null if it was loaded from an absolute URI.- Returns:
- the base URI, or null.
 
 - 
isSandboxedpublic boolean isSandboxed() Returns true if this script has a base URI and has a source URI that is contained within that base URI.- Returns:
- true if this script is contained within its sandbox base URI.
 
 
- 
 
-