/** * Internal subroutine returns this NodeNameMap's (shallow) readOnly value. * */ boolean getReadOnly() { return isReadOnly(); } // getReadOnly()
/** * Internal subroutine to allow read-only Nodes to make their contained * NamedNodeMaps readonly too. I expect that in fact the shallow * version of this operation will never be * * @param readOnly boolean true to make read-only, false to permit editing. * @param deep boolean true to pass this request along to the contained * nodes, false to only toggle the NamedNodeMap itself. I expect that * the shallow version of this operation will never be used, but I want * to design it in now, while I'm thinking about it. */ void setReadOnly(boolean readOnly, boolean deep) { isReadOnly(readOnly); if (deep && nodes != null) { for (int i = nodes.size() - 1; i >= 0; i--) { ((NodeImpl) nodes.get(i)).setReadOnly(readOnly,deep); } } } // setReadOnly(boolean,boolean)
/***/ public Node removeNamedItem(String name) throws DOMException { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } int i = findNamePoint(name,0); if (i < 0) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } NodeImpl n = (NodeImpl)nodes.get(i); nodes.remove(i); return n; } // removeNamedItem(String):Node
if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg);
/** * Introduced in DOM Level 2. <p> * Removes a node specified by local name and namespace URI. * @param namespaceURI * The namespace URI of the node to remove. * When it is null or an empty string, this * method behaves like removeNamedItem. * @param name The local name of the node to remove. * @return Node The node removed from the map if a node with such * a local name and namespace URI exists. * @throws NOT_FOUND_ERR: Raised if there is no node named * name in the map. */ public Node removeNamedItemNS(String namespaceURI, String name) throws DOMException { if (isReadOnly()) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } int i = findNamePoint(namespaceURI, name); if (i < 0) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } NodeImpl n = (NodeImpl)nodes.get(i); nodes.remove(i); return n; } // removeNamedItem(String):Node