Package com.google.gwt.xml.client

Examples of com.google.gwt.xml.client.Attr


      assertEquals("bean", testBean.getNodeName());
      assertEquals("http://www.springframework.org/schema/beans", testBean.getNamespaceURI());
      assertEquals("org.springframework.beans.TestBean", testBean.getAttribute("class"));
      assertTrue(testBean.hasAttribute("class"));
      assertFalse(testBean.hasAttribute("fooAttr"));
      Attr classAttr = testBean.getAttributeNode("class");
      assertEquals("class", classAttr.getName());
      assertEquals("org.springframework.beans.TestBean", classAttr.getValue());
      assertEquals("http://www.springframework.org/schema/beans", classAttr.getNamespaceURI());
      assertEquals("class", classAttr.getNodeName());
      // CDATA attribute
      Element ageProperty = (Element) testBean.getChildNodes().item(0);
      assertEquals(1, ageProperty.getAttributes().getLength());
      assertEquals("age", ageProperty.getAttribute("name"));
      assertEquals("<10>", ageProperty.getNodeValue());
View Full Code Here


  @Override
  public ImmutableMap<String, String> getAttributes() {
    final ImmutableMap.Builder<String, String> result = ImmutableMap.builder();
    final NamedNodeMap attribs = element.getAttributes();
    for (int i = 0; i < attribs.getLength(); i++) {
      final Attr attrib = (Attr) attribs.item(i);
      result.put(attrib.getName(), attrib.getValue());
    }
    return result.build();
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.xml.client.Attr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.