1 16 19 20 21 package com.sun.org.apache.xpath.internal.domapi; 22 23 import org.w3c.dom.Attr ; 24 import org.w3c.dom.DOMException ; 25 import org.w3c.dom.Document ; 26 import org.w3c.dom.Element ; 27 import org.w3c.dom.NamedNodeMap ; 28 import org.w3c.dom.Node ; 29 import org.w3c.dom.NodeList ; 30 import org.w3c.dom.xpath.XPathNamespace; 31 32 import org.w3c.dom.UserDataHandler ; 33 34 71 72 class XPathNamespaceImpl implements XPathNamespace { 73 74 final private Node m_attributeNode; 76 77 80 XPathNamespaceImpl(Node node) { 81 m_attributeNode = node; 82 } 83 84 87 public Element getOwnerElement() { 88 return ((Attr )m_attributeNode).getOwnerElement(); 89 } 90 91 94 public String getNodeName() { 95 return "#namespace"; 96 } 97 98 101 public String getNodeValue() throws DOMException { 102 return m_attributeNode.getNodeValue(); 103 } 104 105 108 public void setNodeValue(String arg0) throws DOMException { 109 } 110 111 114 public short getNodeType() { 115 return XPathNamespace.XPATH_NAMESPACE_NODE; 116 } 117 118 121 public Node getParentNode() { 122 return m_attributeNode.getParentNode(); 123 } 124 125 128 public NodeList getChildNodes() { 129 return m_attributeNode.getChildNodes(); 130 } 131 132 135 public Node getFirstChild() { 136 return m_attributeNode.getFirstChild(); 137 } 138 139 142 public Node getLastChild() { 143 return m_attributeNode.getLastChild(); 144 } 145 146 149 public Node getPreviousSibling() { 150 return m_attributeNode.getPreviousSibling(); 151 } 152 153 156 public Node getNextSibling() { 157 return m_attributeNode.getNextSibling(); 158 } 159 160 163 public NamedNodeMap getAttributes() { 164 return m_attributeNode.getAttributes(); 165 } 166 167 170 public Document getOwnerDocument() { 171 return m_attributeNode.getOwnerDocument(); 172 } 173 174 177 public Node insertBefore(Node arg0, Node arg1) throws DOMException { 178 return null; 179 } 180 181 184 public Node replaceChild(Node arg0, Node arg1) throws DOMException { 185 return null; 186 } 187 188 191 public Node removeChild(Node arg0) throws DOMException { 192 return null; 193 } 194 195 198 public Node appendChild(Node arg0) throws DOMException { 199 return null; 200 } 201 202 205 public boolean hasChildNodes() { 206 return false; 207 } 208 209 212 public Node cloneNode(boolean arg0) { 213 throw new DOMException (DOMException.NOT_SUPPORTED_ERR,null); 214 } 215 216 219 public void normalize() { 220 m_attributeNode.normalize(); 221 } 222 223 226 public boolean isSupported(String arg0, String arg1) { 227 return m_attributeNode.isSupported(arg0, arg1); 228 } 229 230 233 public String getNamespaceURI() { 234 235 return m_attributeNode.getNodeValue(); 238 } 239 240 243 public String getPrefix() { 244 return m_attributeNode.getPrefix(); 245 } 246 247 250 public void setPrefix(String arg0) throws DOMException { 251 } 252 253 256 public String getLocalName() { 257 258 return m_attributeNode.getPrefix(); 260 } 261 262 265 public boolean hasAttributes() { 266 return m_attributeNode.hasAttributes(); 267 } 268 269 public String getBaseURI ( ) { 270 return null; 271 } 272 273 public short compareDocumentPosition(Node other) throws DOMException { 274 return 0; 275 } 276 277 private String textContent; 278 279 public String getTextContent() throws DOMException { 280 return textContent; 281 } 282 283 public void setTextContent(String textContent) throws DOMException { 284 this.textContent = textContent; 285 } 286 287 public boolean isSameNode(Node other) { 288 return false; 289 } 290 291 public String lookupPrefix(String namespaceURI) { 292 return ""; } 294 295 public boolean isDefaultNamespace(String namespaceURI) { 296 return false; 297 } 298 299 public String lookupNamespaceURI(String prefix) { 300 return null; 301 } 302 303 public boolean isEqualNode(Node arg) { 304 return false; 305 } 306 307 public Object getFeature(String feature, String version) { 308 return null; } 310 311 public Object setUserData(String key, 312 Object data, 313 UserDataHandler handler) { 314 return null; } 316 317 public Object getUserData(String key) { 318 return null; 319 } 320 } 321 | Popular Tags |