module.ModuleInfo Extends goog.Disposable
A ModuleInfo object is used by the ModuleManager to hold information about a module of js code that may or may not yet be loaded into the environment.

Inheritance

Constructor

goog.module.ModuleInfo(depsid)

Parameters

deps : Array.<string>
Ids of the modules that must be loaded before this one. The ids must be in dependency order (i.e. if the ith module depends on the jth module, then i > j).
id : string
The module's ID.

Instance Methods

Public Protected Private
callCallbacks_(callbackscontext) Array.<*>
Helper to call the callbacks after module load.
Arguments:
callbacks : Array.<goog.module.ModuleLoadCallback>
The callbacks to call and then clear.
context : *
The module context.
Returns: Array.<*>  Any errors encountered while calling the callbacks, or null if there were no errors.
code »
disposeInternal()
No description.
code »
getDependencies() Array.<string>
Gets the dependencies of this module.
Returns: Array.<string>  The ids of the modules that this module depends on.
code »
getId() string
Gets the ID of this module.
Returns: string  The ID.
code »
getModule() ?goog.module.BaseModule
Gets the module.
Returns: ?goog.module.BaseModule  The module if it has been loaded. Otherwise, null.
code »
getUris() ?Array.<string>
Gets the uris of this module.
Returns: ?Array.<string>  Uris for this module's code.
code »
isLoaded() boolean
Determines whether the module has been loaded.
Returns: boolean  Whether the module has been loaded.
code »
onError(cause)
Calls the error callbacks for the module.
Arguments:
cause : goog.module.ModuleManager.FailureType
What caused the error.
code »
onLoad(contextProvider) boolean
Sets this module as loaded.
Arguments:
contextProvider : function() : Object
A function that provides the module context.
Returns: boolean  Whether any errors occurred while executing the onload callbacks.
code »
registerCallback(fnopt_handler) !goog.module.ModuleLoadCallback
Registers a function that should be called after the module is loaded.
Arguments:
fn : Function
A callback function that takes a single argument which is the module context.
opt_handler : Object=
Optional handler under whose scope to execute the callback.
Returns: !goog.module.ModuleLoadCallback  Reference to the callback object.
code »
registerCallback_(callbacksfnopt_handler) !goog.module.ModuleLoadCallback
Registers a function that should be called after the module is loaded.
Arguments:
callbacks : Array.<goog.module.ModuleLoadCallback>
The array to add the callback to.
fn : Function
A callback function that takes a single argument which is the module context.
opt_handler : Object=
Optional handler under whose scope to execute the callback.
Returns: !goog.module.ModuleLoadCallback  Reference to the callback object.
code »
registerEarlyCallback(fnopt_handler) !goog.module.ModuleLoadCallback
Registers a function that should be called after the module is loaded. These early callbacks are called after Module#initialize is called but before the other callbacks are called.
Arguments:
fn : Function
A callback function that takes a single argument which is the module context.
opt_handler : Object=
Optional handler under whose scope to execute the callback.
Returns: !goog.module.ModuleLoadCallback  Reference to the callback object.
code »
registerErrback(fnopt_handler) !goog.module.ModuleLoadCallback
Registers a function that should be called if the module load fails.
Arguments:
fn : Function
A callback function that takes a single argument which is the failure type.
opt_handler : Object=
Optional handler under whose scope to execute the callback.
Returns: !goog.module.ModuleLoadCallback  Reference to the callback object.
code »
setModuleConstructor(constructor)
Sets the constructor to use to instantiate the module object after the module code is loaded.
Arguments:
constructor : Function
The constructor of a goog.module.BaseModule subclass.
code »
setUris(uris)
Sets the uris of this module.
Arguments:
uris : Array.<string>
Uris for this module's code.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
  mypackage.MyClass = function() {
    mypackage.MyClass.base(this, 'constructor');
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    mypackage.MyClass.base(this, 'disposeInternal');
  };
code »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

constructor :
No description.
Code »
deps_ :
A list of the ids of the modules that must be loaded before this module.
Code »
earlyOnloadCallbacks_ :
Early callbacks to execute once this module is loaded. Called after module initialization but before regular onload callbacks.
Code »
id_ :
The module's ID.
Code »
moduleConstructor_ :
The constructor to use to instantiate the module object after the module code is loaded. This must be either goog.module.BaseModule or a subclass of it.
Code »
The module object. This will be null until the module is loaded.
Code »
onErrorCallbacks_ :
Callbacks to execute if the module load errors.
Code »
onloadCallbacks_ :
Callbacks to execute once this module is loaded.
Code »
uris_ :
The uris that can be used to retrieve this module's code.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Properties

goog.module.ModuleInfo.superClass_ :
No description.
Code »

Package module

Package Reference