home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / main.bin / CConnection.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-08-05  |  3.0 KB  |  104 lines

  1. package symantec.descfileconverter;
  2.  
  3. class CConnection {
  4.    String form;
  5.    String type;
  6.    String init;
  7.    String expr;
  8.    String description;
  9.    String method;
  10.    String arg;
  11.  
  12.    void setMethodName(String var1) {
  13.       int var3 = this.expr.indexOf("%name%.");
  14.       String var2;
  15.       if (var3 == -1) {
  16.          var3 = this.expr.indexOf("%class%.");
  17.          if (var3 == -1) {
  18.             this.method = "none";
  19.             return;
  20.          }
  21.  
  22.          var2 = this.expr.substring(var3 + 8);
  23.       } else {
  24.          var2 = this.expr.substring(var3 + 7);
  25.       }
  26.  
  27.       var3 = var2.indexOf("(");
  28.       if (var3 == -1) {
  29.          this.method = "none";
  30.       } else {
  31.          this.method = var2.substring(0, var3);
  32.          this.setArgName(var1, var2.substring(var3));
  33.       }
  34.    }
  35.  
  36.    void setArgName(String var1, String var2) {
  37.       if (this.form.equalsIgnoreCase("output")) {
  38.          if (var1.equalsIgnoreCase("symantec.itools.awt.ImageListBox") && this.method.equalsIgnoreCase("isEdited")) {
  39.             this.arg = "int";
  40.          } else {
  41.             if (var1.equalsIgnoreCase("symantec.itools.awt.MultiList")) {
  42.                if (this.method.equalsIgnoreCase("getHeadings")) {
  43.                   this.arg = "int";
  44.                   return;
  45.                }
  46.  
  47.                if (this.method.equalsIgnoreCase("getCellText")) {
  48.                   this.arg = "int";
  49.                   return;
  50.                }
  51.  
  52.                if (this.method.equalsIgnoreCase("getColumnSize")) {
  53.                   this.arg = "int";
  54.                   return;
  55.                }
  56.             }
  57.  
  58.             this.arg = "void";
  59.          }
  60.       } else if (var2.startsWith("(%arg%") && !var2.startsWith("(%arg%,")) {
  61.          this.arg = this.type;
  62.       } else if (this.type.equalsIgnoreCase("RelativeURL")) {
  63.          this.arg = "URL";
  64.       } else if (!var2.startsWith("()") && !var2.startsWith("( )")) {
  65.          if (!var2.startsWith("(!") && !var2.startsWith("( !")) {
  66.             if (!var2.startsWith("(true") && !var2.startsWith("( true")) {
  67.                if (!var2.startsWith("(false") && !var2.startsWith("( false")) {
  68.                   if (!var2.startsWith("(%arg%, true") && !var2.startsWith("(%arg%, false")) {
  69.                      if (!var2.startsWith("(%arg%,true") && !var2.startsWith("(%arg%,false")) {
  70.                         if (var2.startsWith("(%name%.") && var2.substring(var2.indexOf("."), var2.indexOf(")")).indexOf("(") == -1) {
  71.                            this.arg = "int";
  72.                         } else if ((var2.startsWith("(%arg%, %name%.") || var2.startsWith("(%arg%,%name%.")) && var2.substring(var2.indexOf("."), var2.indexOf(")")).indexOf("(") == -1) {
  73.                            this.arg = this.type + ",int";
  74.                         } else if ((var1.equalsIgnoreCase("symantec.itools.awt.util.ProgressBar") || var1.equalsIgnoreCase("symantec.itools.awt.Slider")) && this.method.equalsIgnoreCase("setValue")) {
  75.                            this.arg = "int";
  76.                         } else if (var1.equalsIgnoreCase("symantec.itools.awt.util.StatusScroller") && this.method.equalsIgnoreCase("setRightToLeft")) {
  77.                            this.arg = "boolean";
  78.                         } else {
  79.                            this.arg = "void";
  80.                            System.out.println("Argument type set to void for method " + this.method + " in");
  81.                            System.out.println("component " + var1 + ".  This is a best guess,");
  82.                            System.out.println("please verify the generated BeanInfo code for accuracy.");
  83.                         }
  84.                      } else {
  85.                         this.arg = this.type + ",boolean";
  86.                      }
  87.                   } else {
  88.                      this.arg = this.type + ",boolean";
  89.                   }
  90.                } else {
  91.                   this.arg = "boolean";
  92.                }
  93.             } else {
  94.                this.arg = "boolean";
  95.             }
  96.          } else {
  97.             this.arg = "boolean";
  98.          }
  99.       } else {
  100.          this.arg = "void";
  101.       }
  102.    }
  103. }
  104.