if ("in".equals(arg.getAttribute("direction")))
if ("out".equals(arg.getAttribute("direction"))) out.add(arg); else
   String parseMethod(Element meth, Set<String> imports, Map<String,Integer> tuples, Map<String, Integer> structs, Set<String> exceptions) throws DBusException   {      Vector<Element> in = new Vector<Element>();      Vector<Element> out = new Vector<Element>();      if (null == meth.getAttribute("name") ||            "".equals(meth.getAttribute("name"))) {         System.err.println("ERROR: Interface name was blank, failed");         System.exit(1);      }      String annotations = "";      String throwses = null;      for (Node a: new IterableNodeList(meth.getChildNodes())) {         if (Node.ELEMENT_NODE != a.getNodeType()) continue;         checkNode(a, "arg", "annotation");         if ("arg".equals(a.getNodeName())) {            Element arg = (Element) a;            if ("in".equals(arg.getAttribute("direction")))               in.add(arg);            else               out.add(arg);         }         else if ("annotation".equals(a.getNodeName())) {            Element e = (Element) a;            if (e.getAttribute("name").equals("org.freedesktop.DBus.Method.Error")) {               if (null == throwses)                  throwses = e.getAttribute("value");               else                  throwses += ", " + e.getAttribute("value");               exceptions.add(e.getAttribute("value"));            } else               annotations += parseAnnotation(e, imports);         }      }      String sig = "";      comment = "";      sig += parseReturns(out, imports, tuples, structs);      sig += meth.getAttribute("name")+"(";      char defaultname = 'a';      String params = "";      for (Element arg: in) {         String type = DBusConnection.getJavaType(arg.getAttribute("type"), imports, structs, false, false);         String name = arg.getAttribute("name");         if (null == name || "".equals(name)) name = ""+(defaultname++);         params += type+" "+name+", ";               }      return ("".equals(comment) ? "" : "   /**\n" + comment + "   */\n")         + annotations + "  public " + sig +          params.replaceAll("..$", "")+")"+         (null == throwses? "": " throws "+throwses)+";";   }