1 5 package com.opensymphony.webwork.views.xslt; 6 7 import org.apache.commons.logging.LogFactory; 8 import org.w3c.dom.*; 9 10 11 16 public abstract class DefaultAdapterNode implements Node, AdapterNode { 17 19 private static final NodeList EMPTY_NODELIST = new NodeList() { 20 public Node item(int i) { 21 return null; 22 } 23 24 public int getLength() { 25 return 0; 26 } 27 }; 28 29 30 32 private AdapterNode parent; 33 private DOMAdapter rootAdapter; 34 private Object value; 35 private String propertyName; 36 37 39 public DefaultAdapterNode(DOMAdapter rootAdapter, AdapterNode parent, String propertyName, Object value) { 40 this.rootAdapter = rootAdapter; 42 43 this.parent = parent; 45 46 this.propertyName = propertyName; 48 this.value = value; 49 50 if (LogFactory.getLog(getClass()).isDebugEnabled()) { 51 LogFactory.getLog(getClass()).debug("Creating " + this); 52 } 53 } 54 55 57 public NamedNodeMap getAttributes() { 58 return null; 59 } 60 61 public NodeList getChildNodes() { 62 return EMPTY_NODELIST; 63 } 64 65 public Node getFirstChild() { 66 return null; 67 } 68 69 public Node getLastChild() { 70 return null; 71 } 72 73 public String getLocalName() { 74 return null; 75 } 76 77 public String getNamespaceURI() { 78 return null; 79 } 80 81 public Node getNextSibling() { 82 return (getParentAdapterNode() != null) ? getParentAdapterNode().getNextSibling(this) : null; 83 } 84 85 public Node getNextSibling(AdapterNode child) { 86 return null; 87 } 88 89 public void setNodeValue(String string) throws DOMException { 90 operationNotSupported(); 91 } 92 93 public String getNodeValue() throws DOMException { 94 operationNotSupported(); 95 96 return null; 97 } 98 99 public Document getOwnerDocument() { 100 return null; 101 } 102 103 public AdapterNode getParentAdapterNode() { 104 return parent; 105 } 106 107 public Node getParentNode() { 108 return parent; 109 } 110 111 public void setPrefix(String string) throws DOMException { 112 operationNotSupported(); 113 } 114 115 public String getPrefix() { 116 return null; 117 } 118 119 public Node getPreviousSibling() { 120 return null; 121 } 122 123 public String getPropertyName() { 124 return propertyName; 125 } 126 127 public DOMAdapter getRootAdapter() { 128 return rootAdapter; 129 } 130 131 public boolean isSupported(String string, String string1) { 132 operationNotSupported(); 133 134 return false; 135 } 136 137 public Object getValue() { 138 return value; 139 } 140 141 public Node appendChild(Node node) throws DOMException { 142 operationNotSupported(); 143 144 return null; 145 } 146 147 public Node cloneNode(boolean b) { 148 operationNotSupported(); 149 150 return null; 151 } 152 153 public boolean equals(Object other) { 154 try { 155 AdapterNode otherNode = (AdapterNode) other; 156 boolean result = true; 157 result &= getRootAdapter().equals(otherNode.getRootAdapter()); 158 result &= getPropertyName().equals(otherNode.getPropertyName()); 159 result &= ((getValue() != null) ? getValue().equals(otherNode.getValue()) : (otherNode.getValue() == null)); 160 result &= ((getParentAdapterNode() != null) ? getParentAdapterNode().equals(otherNode.getParentAdapterNode()) : (otherNode.getParentAdapterNode() == null)); 161 162 return result; 163 } catch (ClassCastException e) { 164 return false; 165 } 166 } 167 168 public boolean hasAttributes() { 169 return false; 170 } 171 172 public boolean hasChildNodes() { 173 return false; 174 } 175 176 public int hashCode() { 177 return (getRootAdapter().hashCode() * 37) + ((getParentAdapterNode() != null) ? (getParentAdapterNode().hashCode() * 41) : 0) + (getPropertyName().hashCode() * 43) + ((getValue() != null) ? (getValue().hashCode() * 47) : 0); 178 } 179 180 public Node insertBefore(Node node, Node node1) throws DOMException { 181 operationNotSupported(); 182 183 return null; 184 } 185 186 public void normalize() { 187 operationNotSupported(); 188 } 189 190 public Node removeChild(Node node) throws DOMException { 191 operationNotSupported(); 192 193 return null; 194 } 195 196 public Node replaceChild(Node node, Node node1) throws DOMException { 197 operationNotSupported(); 198 199 return null; 200 } 201 202 protected void operationNotSupported() { 203 throw new RuntimeException ("Operation not supported."); 204 } 205 206 207 210 public boolean isElementContentWhitespace() { 211 return false; 213 } 214 215 218 public String getWholeText() { 219 return null; 221 } 222 223 226 public Text replaceWholeText(String content) throws DOMException { 227 return null; 229 } 230 231 234 public String getBaseURI() { 235 return null; 237 } 238 239 242 public short compareDocumentPosition(Node other) throws DOMException { 243 return 0; 245 } 246 247 250 public String getTextContent() throws DOMException { 251 return null; 253 } 254 255 258 public void setTextContent(String textContent) throws DOMException { 259 261 } 262 263 266 public boolean isSameNode(Node other) { 267 return false; 269 } 270 271 274 public String lookupPrefix(String namespaceURI) { 275 return null; 277 } 278 279 282 public boolean isDefaultNamespace(String namespaceURI) { 283 return false; 285 } 286 287 290 public String lookupNamespaceURI(String prefix) { 291 return null; 293 } 294 295 298 public boolean isEqualNode(Node arg) { 299 return false; 301 } 302 303 306 public Object getFeature(String feature, String version) { 307 return null; 309 } 310 311 314 public Object setUserData(String key, Object data, UserDataHandler handler) { 315 return null; 317 } 318 319 322 public Object getUserData(String key) { 323 return null; 325 } 326 329 public String getInputEncoding() { 330 return null; 332 } 333 334 337 public String getXmlEncoding() { 338 return null; 340 } 341 342 345 public boolean getXmlStandalone() { 346 return false; 348 } 349 350 353 public void setXmlStandalone(boolean xmlStandalone) throws DOMException { 354 356 } 357 358 361 public String getXmlVersion() { 362 return null; 364 } 365 366 369 public void setXmlVersion(String xmlVersion) throws DOMException { 370 372 } 373 374 377 public boolean getStrictErrorChecking() { 378 return false; 380 } 381 382 385 public void setStrictErrorChecking(boolean strictErrorChecking) { 386 388 } 389 390 393 public String getDocumentURI() { 394 return null; 396 } 397 398 401 public void setDocumentURI(String documentURI) { 402 404 } 405 406 409 public Node adoptNode(Node source) throws DOMException { 410 return null; 412 } 413 414 417 public DOMConfiguration getDomConfig() { 418 return null; 420 } 421 422 425 public void normalizeDocument() { 426 428 } 429 430 433 public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { 434 return null; 436 } 437 438 439 } 440 | Popular Tags |