1 18 package org.apache.batik.dom; 19 20 import org.w3c.dom.DOMException ; 21 import org.w3c.dom.DocumentFragment ; 22 import org.w3c.dom.Node ; 23 24 30 31 public abstract class AbstractDocumentFragment 32 extends AbstractParentNode 33 implements DocumentFragment { 34 38 public String getNodeName() { 39 return "#document-fragment"; 40 } 41 42 46 public short getNodeType() { 47 return DOCUMENT_FRAGMENT_NODE; 48 } 49 50 53 protected void checkChildType(Node n, boolean replace) { 54 switch (n.getNodeType()) { 55 case ELEMENT_NODE: 56 case PROCESSING_INSTRUCTION_NODE: 57 case COMMENT_NODE: 58 case TEXT_NODE: 59 case CDATA_SECTION_NODE: 60 case ENTITY_REFERENCE_NODE: 61 case DOCUMENT_FRAGMENT_NODE: 62 break; 63 default: 64 throw createDOMException 65 (DOMException.HIERARCHY_REQUEST_ERR, 66 "child.type", 67 new Object [] { new Integer (getNodeType()), 68 getNodeName(), 69 new Integer (n.getNodeType()), 70 n.getNodeName() }); 71 } 72 } 73 } 74 | Popular Tags |