code: public static DbAttribute[] toDbAttributeArray(final String[] array, final int mode) throws DevFailed {
          if (mode < 1 && mode > 2) {
              Except.throw_non_supported_exception("API_NotSupportedMode", "Mode " + mode
                      + " to decode attribute properties is not supported",
                      "ApiUtil.toDbAttributeArray()");
          }
  
          int idx = 1;
          final int nb_attr = Integer.parseInt(array[idx++]);
          final DbAttribute[] attr = new DbAttribute[nb_attr];
          for (int i = 0; i < nb_attr; i++) {
              // Create DbAttribute with name and nb properties
              // ------------------------------------------------------
              attr[i] = new DbAttribute(array[idx++]);
  
              // Get nb properties
              // ------------------------------------------------------
              final int nb_prop = Integer.parseInt(array[idx++]);
  
              for (int j = 0; j < nb_prop; j++) {
                  // And copy property name and value in
                  // DbAttribute's DbDatum array
                  // ------------------------------------------
                  final String p_name = array[idx++];
                  switch (mode) {
                      case 1:
                          // Value is just one element
                          attr[i].add(p_name, array[idx++]);
                          break;
                      case 2:
                          // value is an array
                          final int p_length = Integer.parseInt(array[idx++]);
                          final String[] val = new String[p_length];
                          for (int p = 0; p < p_length; p++) {
                              val[p] = array[idx++];
                          }
                          attr[i].add(p_name, val);
                          break;
                  }
              }
          }
          return attr;
      }
docs: ==========================================================================