1 16 package com.google.gwt.xml.client.impl; 17 18 import com.google.gwt.core.client.JavaScriptException; 19 import com.google.gwt.core.client.JavaScriptObject; 20 import com.google.gwt.xml.client.DOMException; 21 import com.google.gwt.xml.client.NamedNodeMap; 22 import com.google.gwt.xml.client.Node; 23 24 27 class NamedNodeMapImpl extends NodeListImpl implements NamedNodeMap { 28 29 protected NamedNodeMapImpl(JavaScriptObject o) { 30 super(o); 31 } 32 33 39 public int getLength() { 40 return super.getLength(); 41 } 42 43 49 public Node getNamedItem(String name) { 50 return NodeImpl.build(XMLParserImpl.getNamedItem(this.getJsObject(), name)); 51 } 52 53 public Node item(int index) { 54 return super.item(index); 55 } 56 57 61 public Node removeNamedItem(String name) { 62 try { 63 return NodeImpl.build(XMLParserImpl.removeNamedItem(this.getJsObject(), 64 name)); 65 } catch (JavaScriptException e) { 66 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 67 } 68 } 69 70 74 public Node setNamedItem(Node arg) { 75 try { 76 return NodeImpl.build(XMLParserImpl.setNamedItem(this.getJsObject(), 77 ((DOMItem) arg).getJsObject())); 78 } catch (JavaScriptException e) { 79 throw new DOMNodeException(DOMException.INVALID_MODIFICATION_ERR, e, this); 80 } 81 } 82 } 83 | Popular Tags |