pnuts.tools
Class init

java.lang.Object
  extended by pnuts.ext.ModuleBase
      extended by pnuts.tools.init
All Implemented Interfaces:
java.io.Serializable, Executable

public class init
extends ModuleBase

See Also:
Serialized Form

Constructor Summary
init()
           
 
Method Summary
 java.lang.Object execute(Context context)
          Subclasses should override this method, instead of run(Context), to define the initialization process.
 java.lang.String getPrefix()
          Defines the prefix of script class (resource) name.
protected  java.lang.String[] getSubModules()
          This method is supposed to be redefined in a subclass to define a set of modules that this module provides in the caller's context.
 
Methods inherited from class pnuts.ext.ModuleBase
autoload, autoloadClass, autoloadFunction, getClassName, getPackage, getRequiredModules, newInstance, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

init

public init()
Method Detail

getPrefix

public java.lang.String getPrefix()
Description copied from class: ModuleBase
Defines the prefix of script class (resource) name. This method is overriden by subclasses.

Overrides:
getPrefix in class ModuleBase

getSubModules

protected java.lang.String[] getSubModules()
Description copied from class: ModuleBase
This method is supposed to be redefined in a subclass to define a set of modules that this module provides in the caller's context. If this method returns an array of module names (non-null), they are use()'d, then Context.clearPackages() is called, before calling execute() method.

Overrides:
getSubModules in class ModuleBase

execute

public java.lang.Object execute(Context context)
Description copied from class: ModuleBase
Subclasses should override this method, instead of run(Context), to define the initialization process. If neither getSubModules() nor getRequiredModules() are redefined to return non-null value, execute() method should be implemented as the following steps. 1. Call context.usePackage() to use the modules that this module provides 2. Call context.clearPackages() 3. Call context.usePackage() to use the module that this module requires 4. Define symbols (functions)

Overrides:
execute in class ModuleBase
Parameters:
context - the context