/** * Checks the validity of a node to be inserted. */ protected void checkChildType(Node n, boolean replace) { switch (n.getNodeType()) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: case DOCUMENT_FRAGMENT_NODE: break; default: throw createDOMException (DOMException.HIERARCHY_REQUEST_ERR, "child.type", new Object[] { new Integer(getNodeType()), getNodeName(), new Integer(n.getNodeType()), n.getNodeName() }); } }
/** * Checks the validity of a node to be inserted. */ protected void checkChildType(Node n, boolean replace) { switch (n.getNodeType()) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: case DOCUMENT_FRAGMENT_NODE: break; default: throw createDOMException (DOMException.HIERARCHY_REQUEST_ERR, "child.type", new Object[] {(int) getNodeType(), getNodeName(), (int) n.getNodeType(), n.getNodeName() }); } }
/** * Checks the validity of a node to be inserted. */ protected void checkChildType(Node n, boolean replace) { switch (n.getNodeType()) { case TEXT_NODE: case ENTITY_REFERENCE_NODE: case DOCUMENT_FRAGMENT_NODE: break; default: throw createDOMException (DOMException.HIERARCHY_REQUEST_ERR, "child.type", new Object[] {(int) getNodeType(), getNodeName(), (int) n.getNodeType(), n.getNodeName() }); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { new Integer(getNodeType()), getNodeName() }); } String s = getNodeValue(); // Remove all the children Node n; while ((n = getFirstChild()) != null) { removeChild(n); } String val = (nodeValue == null) ? "" : nodeValue; // Create and append a new child. n = getOwnerDocument().createTextNode(val); appendChild(n); if (ownerElement != null) { ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } String s = getNodeValue(); // Remove all the children Node n; while ((n = getFirstChild()) != null) { removeChild(n); } String val = (nodeValue == null) ? "" : nodeValue; // Create and append a new child. n = getOwnerDocument().createTextNode(val); appendChild(n); if (ownerElement != null) { ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } String s = getNodeValue(); // Remove all the children Node n; while ((n = getFirstChild()) != null) { removeChild(n); } String val = (nodeValue == null) ? "" : nodeValue; // Create and append a new child. n = getOwnerDocument().createTextNode(val); appendChild(n); if (ownerElement != null) { ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION); } }