test_class.file: base/lang/src/test/java/leap/lang/jsoup/nodes/FormElementTest.java
test_class.identifier: FormElementTest
test_case.body: @Test public void createsFormData() {
          String html = "<form><input name='one' value='two'><select name='three'><option value='not'>" +
                  "<option value='four' selected><option value='five' selected><textarea name=six>seven</textarea></form>";
          Document doc = Jsoup.parse(html);
          FormElement form = (FormElement) doc.select("form").first();
          List<Connection.KeyVal> data = form.formData();
  
          assertEquals(4, data.size());
          assertEquals("one=two", data.get(0).toString());
          assertEquals("three=four", data.get(1).toString());
          assertEquals("three=five", data.get(2).toString());
          assertEquals("six=seven", data.get(3).toString());
      }
test_case.class_method_signature: FormElementTest.createsFormData()
test_case.full_signature: @Test public void createsFormData()
test_case.identifier: createsFormData
test_case.invocations: parse first select formData assertEquals size assertEquals toString get assertEquals toString get assertEquals toString get assertEquals toString get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createsFormData()
focal_class.declarator: elements = new Elements()
focal_class.modifier: private final
focal_class.original_string: private final Elements elements = new Elements();
focal_class.type: Elements
focal_class.var_name: elements
focal_class.file: base/lang/src/main/java/leap/lang/jsoup/nodes/FormElement.java
focal_class.identifier: FormElement
focal_class.class_method_signature: FormElement.FormElement(Tag tag, String baseUri, Attributes attributes)
focal_class.full_signature: public  FormElement(Tag tag, String baseUri, Attributes attributes)
focal_class.identifier: FormElement
focal_class.modifiers: public
focal_class.parameters: (Tag tag, String baseUri, Attributes attributes)
focal_class.signature:  FormElement(Tag tag, String baseUri, Attributes attributes)
focal_class.class_method_signature: FormElement.elements()
focal_class.full_signature: public Elements elements()
focal_class.identifier: elements
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Elements
focal_class.signature: Elements elements()
focal_class.class_method_signature: FormElement.addElement(Element element)
focal_class.full_signature: public FormElement addElement(Element element)
focal_class.identifier: addElement
focal_class.modifiers: public
focal_class.parameters: (Element element)
focal_class.return: FormElement
focal_class.signature: FormElement addElement(Element element)
focal_class.class_method_signature: FormElement.submit()
focal_class.full_signature: public Connection submit()
focal_class.identifier: submit
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Connection
focal_class.signature: Connection submit()
focal_class.class_method_signature: FormElement.formData()
focal_class.full_signature: public List<Connection.KeyVal> formData()
focal_class.identifier: formData
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<Connection.KeyVal>
focal_class.signature: List<Connection.KeyVal> formData()
focal_class.class_method_signature: FormElement.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.superclass: extends Element
focal_method.body: public List<Connection.KeyVal> formData() {
          ArrayList<Connection.KeyVal> data = new ArrayList<Connection.KeyVal>();
  
          // iterate the form control elements and accumulate their values
          for (Element el: elements) {
              if (!el.tag().isFormSubmittable()) continue; // contents are form listable, superset of submitable
              String name = el.attr("name");
              if (name.length() == 0) continue;
  
              if ("select".equals(el.tagName())) {
                  Elements options = el.select("option[selected]");
                  for (Element option: options) {
                      data.add(HttpConnection.KeyVal.create(name, option.val()));
                  }
              } else {
                  data.add(HttpConnection.KeyVal.create(name, el.val()));
              }
          }
          return data;
      }
focal_method.class_method_signature: FormElement.formData()
focal_method.full_signature: public List<Connection.KeyVal> formData()
focal_method.identifier: formData
focal_method.invocations: isFormSubmittable tag attr length equals tagName select add create val add create val
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: List<Connection.KeyVal>
focal_method.signature: List<Connection.KeyVal> formData()