home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / os2 / fp1os2.arj / OS2 / DATA / 49 / C / 0 / F_26836 / JScriptModule.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-05-15  |  2.3 KB  |  91 lines

  1. public class JScriptModule extends JSbxObject {
  2.    private JScriptManager pMyJSManager;
  3.    private static final String DEFAULT_NAME = "Default Module Name";
  4.    private String aModuleName;
  5.    private String aSourceStr;
  6.    private String[] aGlobalVarList;
  7.    private JScriptCodeBlock aModuleCodeBlock;
  8.  
  9.    public JScriptManager GetJSManager() {
  10.       return this.pMyJSManager;
  11.    }
  12.  
  13.    public String GetName() {
  14.       return this.aModuleName;
  15.    }
  16.  
  17.    public void SetName(String var1) {
  18.       this.aModuleName = var1;
  19.    }
  20.  
  21.    public String GetSource() {
  22.       return this.aSourceStr;
  23.    }
  24.  
  25.    public void SetSource(String var1) {
  26.       this.aSourceStr = var1;
  27.    }
  28.  
  29.    public String[] GetGlobalVarList() {
  30.       return this.aGlobalVarList;
  31.    }
  32.  
  33.    public void SetGlobalVarList(String[] var1) {
  34.       this.aGlobalVarList = var1;
  35.    }
  36.  
  37.    public JScriptCodeBlock GetCodeBlock() {
  38.       if (this.aModuleCodeBlock == null) {
  39.          this.aModuleCodeBlock = new JScriptCodeBlock();
  40.       }
  41.  
  42.       return this.aModuleCodeBlock;
  43.    }
  44.  
  45.    public void ClrForCompile() {
  46.       this.aModuleCodeBlock = null;
  47.       super.aNameArray = null;
  48.    }
  49.  
  50.    private JScriptModule() {
  51.       this("Default Module Name", (String)null, (JScriptManager)null);
  52.    }
  53.  
  54.    public JScriptModule(String var1) {
  55.       this(var1, (String)null, (JScriptManager)null);
  56.    }
  57.  
  58.    public JScriptModule(JScriptManager var1) {
  59.       this("Default Module Name", (String)null, var1);
  60.    }
  61.  
  62.    public JScriptModule(String var1, String var2) {
  63.       this(var1, var2, (JScriptManager)null);
  64.    }
  65.  
  66.    public JScriptModule(String var1, String var2, JScriptManager var3) {
  67.       this.aModuleName = var1;
  68.       this.aSourceStr = var2;
  69.       this.aModuleCodeBlock = null;
  70.       this.pMyJSManager = var3;
  71.       this.aGlobalVarList = null;
  72.    }
  73.  
  74.    public void AddFunction(JScriptMethod var1) throws JSbxException {
  75.       JSbxValueProperty var2 = new JSbxValueProperty(var1.GetName(), (JSbxObject)null, new JSbxValue(var1));
  76.       ((JSbxObject)this).Put(var2);
  77.    }
  78.  
  79.    public JScriptMethod GetFunction(String var1) throws JSbxException {
  80.       JScriptMethod var2 = null;
  81.       JSbxProperty var3 = ((JSbxObject)this).Get(var1);
  82.       if (var3 != null) {
  83.          JSbxValue var4 = new JSbxValue((short)2);
  84.          var3.Get(var4);
  85.          var2 = (JScriptMethod)var4.GetObject();
  86.       }
  87.  
  88.       return var2;
  89.    }
  90. }
  91.