1 20 21 25 26 package org.ozoneDB.xml.dom; 27 28 import org.w3c.dom.*; 29 30 31 47 public final class ProcessingInstructionImpl extends NodeImpl implements ProcessingInstructionProxy { 48 49 final static long serialVersionUID = 1; 50 51 52 public short getNodeType() { 53 return this.PROCESSING_INSTRUCTION_NODE; 54 } 55 56 57 public String getTarget() { 58 return getNodeName(); 60 } 61 62 63 public String getData() { 64 return getNodeValue(); 66 } 67 68 69 public void setData( String data ) throws DOMException { 70 setNodeValue( data ); 72 } 73 74 75 public final Object clone() { 76 ProcessingInstructionProxy clone = null; 77 try { 78 clone = (ProcessingInstructionProxy)database().createObject( ProcessingInstructionImpl.class.getName() ); 79 clone.init( _ownerDocument, getNodeName(), getNodeValue() ); 80 cloneInto( clone, true ); 81 } catch (Exception except) { 82 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 83 } 84 return clone; 85 } 86 87 88 public final Node cloneNode( boolean deep ) { 89 ProcessingInstructionProxy clone = null; 90 try { 91 clone = (ProcessingInstructionProxy)database().createObject( ProcessingInstructionImpl.class.getName() ); 92 clone.init( _ownerDocument, getNodeName(), getNodeValue() ); 93 cloneInto( clone, deep ); 94 } catch (Exception except) { 95 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 96 } 97 return clone; 98 } 99 100 101 public String toString() { 102 String target; 103 String data; 104 105 target = getTarget(); 106 if (target.length() > 32) { 107 target = target.substring( 0, 32 ) + ".."; 108 } 109 data = getData(); 110 if (data.length() > 32) { 111 data = data.substring( 0, 32 ) + ".."; 112 } 113 return "PI node: [" + target + "] [" + data + "]"; 114 } 115 116 117 protected final boolean supportsChildern() { 118 return false; 119 } 120 121 122 129 public ProcessingInstructionImpl( DocumentImpl owner, String target, String data ) { 130 super( owner, target, data, true ); 131 } 132 133 134 public ProcessingInstructionImpl() { 135 super(); 136 } 137 138 139 public void init( DocumentProxy owner, String target, String data ) { 140 super.init( owner, target, data, true ); 141 } 142 } 143 | Popular Tags |