Exemple #1
0
  /**
   * This method overloads the widget method It returns the server specific description
   *
   * @return DataObject The information common to all servers
   */
  public DataObject getWidgetDescription() {
    DataObject result;

    // Get the server non constant attributes
    DataObject doAtt_ = setServerAttributes().toDataObject();
    println("server all att = " + doAtt_.toString());
    Vector vAtt = new Vector();
    vAtt.addElement(doAtt_);
    DataObject doAtt = new DataObject(Discoverer.SERVER_NON_CONSTANT_ATTRIBUTES, vAtt);

    // Get the server constant attributes
    DataObject doCstAtt_ = setServerConstantAttributes().toDataObject();
    println("server att = " + doCstAtt_.toString());
    Vector vCstAtt = new Vector();
    vCstAtt.addElement(doCstAtt_);
    DataObject doCstAtt = new DataObject(Discoverer.SERVER_CONSTANT_ATTRIBUTES, vCstAtt);

    // Get the server callbacks
    DataObject doCallbacks_ = setServerCallbacks().toDataObject();
    Vector vCall = new Vector();
    vCall.addElement(doCallbacks_);
    DataObject doCallbacks = new DataObject(Discoverer.SERVER_CALLBACKS, vCall);

    // Get the server services
    DataObject doServices_ = setServerServices().toDataObject();
    Vector vSer = new Vector();
    vSer.addElement(doServices_);
    DataObject doServices = new DataObject(Discoverer.SERVER_SERVICES, vSer);

    Vector v = new Vector();
    v.addElement(doAtt);
    v.addElement(doCstAtt);
    v.addElement(doCallbacks);
    v.addElement(doServices);

    // Get getWidgetDescription
    DataObject doDescrip = getServerDescription();
    if (doDescrip != null) {
      Vector vDescrip = doDescrip.getChildren();
      Enumeration e = vDescrip.elements();
      DataObject temp;
      while (e.hasMoreElements()) {
        temp = (DataObject) e.nextElement();
        v.addElement(temp);
      }
    }

    result = new DataObject(Discoverer.TEMP_DEST, v);

    return result;
  }
  /**
   * This method creates a string version of the recursive DataObject
   *
   * @return String version (printable) version of the DataObject
   */
  public String toString() {
    StringBuffer sb = new StringBuffer();
    sb.append("\n[name=" + getName());

    // print value
    sb.append(", value=" + value);

    // print children
    int i = 0;
    for (DataObject child : children) {
      sb.append(", " + name + "-child(" + i++ + ")=");
      sb.append(child.toString());
    }
    sb.append("]");
    return sb.toString();
  }