1 20 21 25 26 27 package org.ozoneDB.xml.dom; 28 29 import org.w3c.dom.*; 30 31 32 50 public final class CDATASectionImpl extends TextImpl implements CDATASectionProxy { 51 52 final static long serialVersionUID = 1; 53 54 55 57 public short getNodeType() { 58 return this.CDATA_SECTION_NODE; 59 } 60 61 62 64 public final Object clone() { 65 CDATASectionProxy clone = null; 66 try { 67 clone = (CDATASectionProxy)database().createObject( CDATASectionImpl.class.getName() ); 68 clone.init( _ownerDocument, getNodeValue() ); 69 cloneInto( clone, true ); 70 } catch (Exception except) { 71 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 72 } 73 return clone; 74 } 75 76 77 79 public final Node cloneNode( boolean deep ) { 80 CDATASectionProxy clone = null; 81 try { 82 clone = (CDATASectionProxy)database().createObject( CDATASectionImpl.class.getName() ); 83 clone.init( _ownerDocument, getNodeValue() ); 84 cloneInto( clone, deep ); 85 } catch (Exception except) { 86 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 87 } 88 return clone; 89 } 90 91 92 94 public String toString() { 95 String value; 96 97 value = getData(); 98 if (value.length() > 64) { 99 value = value.substring( 0, 64 ) + ".."; 100 } 101 value = value.replace( '\n', '|' ); 102 return "CDATA node: [" + value + "]"; 103 } 104 105 106 112 CDATASectionImpl( DocumentImpl owner, String value ) { 113 super( owner, "#cdata-section", value ); 114 } 115 116 117 119 public CDATASectionImpl() { 120 super(); 121 } 122 123 124 126 public final void init( DocumentProxy owner, String value ) { 127 super.init( owner, "#cdata-section", value ); 128 } 129 130 } 131 | Popular Tags |