1 20 21 25 26 package org.ozoneDB.xml.dom; 27 28 import org.w3c.dom.*; 29 30 31 49 public final class CommentImpl extends CharacterDataImpl implements CommentProxy { 50 51 final static long serialVersionUID = 1; 52 53 54 public short getNodeType() { 55 return COMMENT_NODE; 56 } 57 58 59 public final Object clone() { 60 CommentProxy clone = null; 61 try { 62 clone = (CommentProxy)database().createObject( CommentImpl.class.getName() ); 63 clone.init( _ownerDocument, getNodeValue() ); 64 cloneInto( clone, true ); 65 } catch (Exception except) { 66 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 67 } 68 return clone; 69 } 70 71 72 public final Node cloneNode( boolean deep ) { 73 CommentProxy clone = null; 74 try { 75 clone = (CommentProxy)database().createObject( CommentImpl.class.getName() ); 76 clone.init( _ownerDocument, getNodeValue() ); 77 cloneInto( clone, deep ); 78 } catch (Exception except) { 79 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 80 } 81 return clone; 82 } 83 84 85 public String toString() { 86 String value; 87 88 value = getData(); 89 if (value.length() > 64) { 90 value = value.substring( 0, 64 ) + ".."; 91 } 92 value = value.replace( '\n', '|' ); 93 return "Comment node: [" + value + "]"; 94 } 95 96 97 103 public CommentImpl( DocumentImpl owner, String comment ) { 104 super(); 105 super.init( owner, "#comment", comment ); 106 } 107 108 109 public CommentImpl() { 110 super(); 111 } 112 113 114 public final void init( DocumentProxy owner, String comment ) { 115 super.init( owner, "#comment", comment ); 116 } 117 118 } 119 | Popular Tags |