Package org.mozilla.javascript.commonjs.module

## 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.Serializable

  Represents a compiled CommonJS module script. The `Require` functions use them and obtain them through a `ModuleScriptProvider`. Instances are immutable.
  Version:
    $Id: ModuleScript.java,v 1.3 2011/04/07 20:26:11 hannes%helma.at Exp $
  Author:
    Attila Szegedi
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ModuleScript​(Script script, java.net.URI uri, java.net.URI base)` | Creates a new CommonJS module.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `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.
    `Script` | `getScript()` | Returns the script object representing the code of the module.
    `java.net.URI` | `getUri()` | Returns the URI of the module.
    `boolean` | `isSandboxed()` | Returns true if this script has a base URI and has a source URI that is contained within that base URI.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ModuleScript

          public 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

    - #### getScript

          public Script getScript()

      Returns the script object representing the code of the module.
      Returns:
        the script object representing the code of the module.

    - #### getUri

          public java.net.URI getUri()

      Returns the URI of the module.
      Returns:
        the URI of the module.

    - #### getBase

          public 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.

    - #### isSandboxed

          public 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.