1 20 21 25 26 package org.ozoneDB.xml.dom; 27 28 import org.w3c.dom.*; 29 30 31 53 public final class DocumentFragmentImpl extends NodeImpl implements DocumentFragmentProxy { 54 55 final static long serialVersionUID = 1; 56 57 58 public short getNodeType() { 59 return DOCUMENT_FRAGMENT_NODE; 60 } 61 62 63 public final void setNodeValue( String value ) { 64 throw new DOMExceptionImpl( DOMException.NO_DATA_ALLOWED_ERR, "This node type does not support values." ); 65 } 66 67 68 protected boolean supportsChildern() { 69 return true; 70 } 71 72 73 public final Object clone() { 74 TextProxy clone = null; 75 try { 76 clone = (TextProxy)database().createObject( TextImpl.class.getName() ); 77 clone.init( _ownerDocument, getNodeValue() ); 78 cloneInto( clone, true ); 79 } catch (Exception except) { 80 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 81 } 82 return clone; 83 } 84 85 86 public final Node cloneNode( boolean deep ) { 87 TextProxy clone = null; 88 try { 89 clone = (TextProxy)database().createObject( TextImpl.class.getName() ); 90 clone.init( _ownerDocument, getNodeValue() ); 91 cloneInto( clone, deep ); 92 } catch (Exception except) { 93 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 94 } 95 return clone; 96 } 97 98 99 public String toString() { 100 return "Document Fragment (" + getChildCount() + " nodes)"; 101 } 102 103 104 107 DocumentFragmentImpl( DocumentImpl owner ) { 108 super( owner, "#document-fragment", null, false ); 109 } 110 111 112 public DocumentFragmentImpl() { 113 super(); 114 } 115 116 117 public final void init( DocumentProxy owner, String value ) { 118 super.init( owner, "#document-fragment", value, false ); 119 } 120 121 } 122 | Popular Tags |