createStructs(structs);
Map<StructStruct,String> tocreate = new HashMap<StructStruct,String>(structs); for (StructStruct ss: existing.keySet()) tocreate.remove(ss); createStructs(tocreate, structs);
   void createStruct(String name, String type, String pack, PrintStream out) throws DBusException, IOException   {      out.println("package "+pack+";");      Set<String> imports = new TreeSet<String>();      imports.add("org.freedesktop.dbus.Position");      imports.add("org.freedesktop.dbus.Struct");      Map<StructStruct,String> structs = new HashMap<StructStruct, String>();      Vector<String> types = new Vector<String>();            String s = type;      for (int i = 0; i < s.length(); i++) {         switch (s.charAt(i)) {            case 'a':               types.add(DBusConnection.getJavaType(s.substring(i), imports, structs, true, false));               if ('{' == s.charAt(i+1))  {                  int c = 1;                  int j;                  for (j = i+2; c > 0; j++)                     switch (s.charAt(j)) {                        case '{': c++; break;                        case '}': c--; break;                     }                  i = j;               }               else                   i++;               break;            case '(':               types.add(DBusConnection.getJavaType(s.substring(i), imports, structs, true, false));               int c = 1;               int j;               for (j = i+1; c > 0; j++)                  switch (s.charAt(j)) {                     case '(': c++; break;                     case ')': c--; break;                  }               i = j;            default:                  types.add(DBusConnection.getJavaType(s.substring(i,i+1), imports, structs, true, false));         }      }      for (String im: imports) out.println("import "+im+";");            out.println("public final class "+name+" extends Struct");      out.println("{");      int i = 0;      char c = 'a';      String params = "";      for (String t: types) {         out.println("   @Position("+i+")");         out.println("   public final "+t+" "+c+";");         params += t+" "+c+", ";         c++;      }      out.println("  public "+name+"("+params.replaceAll("..$", "")+")");      out.println("  {");      for (char d = 'a'; d < c; d++)         out.println("   this."+d+" = "+d+";");               out.println("  }");      out.println("}");            structs = StructStruct.fillPackages(structs, pack);      createStructs(structs);   }