1 29 30 package com.caucho.quercus.lib.dom; 31 32 import com.caucho.quercus.annotation.Optional; 33 import com.caucho.quercus.env.Env; 34 35 import org.w3c.dom.Element ; 36 37 public class DOMElement 38 extends DOMNode<Element > 39 { 40 public static DOMElement __construct(Env env, String name, @Optional String textContent, @Optional String namespace) 41 { 42 DOMElement element; 43 44 if (namespace != null && namespace.length() > 0) 45 element = getImpl(env).createElement(name, namespace); 46 else 47 element = getImpl(env).createElement(name); 48 49 if (textContent != null && textContent.length() > 0) 50 element.setTextContent(textContent); 51 52 return element; 53 } 54 55 DOMElement(DOMImplementation impl, Element node) 56 { 57 super(impl, node); 58 } 59 60 public String getAttribute(String name) 61 { 62 return _delegate.getAttribute(name); 63 } 64 65 public String getAttributeNS(String namespaceURI, String localName) 66 throws DOMException 67 { 68 try { 69 return _delegate.getAttributeNS(namespaceURI, localName); 70 } 71 catch (org.w3c.dom.DOMException ex) { 72 throw wrap(ex); 73 } 74 } 75 76 public DOMAttr getAttributeNode(String name) 77 { 78 return wrap(_delegate.getAttributeNode(name)); 79 } 80 81 public DOMAttr getAttributeNodeNS(String namespaceURI, String localName) 82 throws DOMException 83 { 84 try { 85 return wrap(_delegate.getAttributeNodeNS(namespaceURI, localName)); 86 } 87 catch (org.w3c.dom.DOMException ex) { 88 throw wrap(ex); 89 } 90 } 91 92 public DOMNodeList getElementsByTagName(String name) 93 { 94 return wrap(_delegate.getElementsByTagName(name)); 95 } 96 97 public DOMNodeList getElementsByTagNameNS(String namespaceURI, String localName) 98 throws DOMException 99 { 100 try { 101 return wrap(_delegate.getElementsByTagNameNS(namespaceURI, localName)); 102 } 103 catch (org.w3c.dom.DOMException ex) { 104 throw wrap(ex); 105 } 106 } 107 108 public DOMTypeInfo getSchemaTypeInfo() 109 { 110 return wrap(_delegate.getSchemaTypeInfo()); 111 } 112 113 public String getTagName() 114 { 115 return _delegate.getTagName(); 116 } 117 118 public boolean hasAttribute(String name) 119 { 120 return _delegate.hasAttribute(name); 121 } 122 123 public boolean hasAttributeNS(String namespaceURI, String localName) 124 throws DOMException 125 { 126 try { 127 return _delegate.hasAttributeNS(namespaceURI, localName); 128 } 129 catch (org.w3c.dom.DOMException ex) { 130 throw wrap(ex); 131 } 132 } 133 134 public void removeAttribute(String name) 135 throws DOMException 136 { 137 try { 138 _delegate.removeAttribute(name); 139 } 140 catch (org.w3c.dom.DOMException ex) { 141 throw wrap(ex); 142 } 143 } 144 145 public void removeAttributeNS(String namespaceURI, String localName) 146 throws DOMException 147 { 148 try { 149 _delegate.removeAttributeNS(namespaceURI, localName); 150 } 151 catch (org.w3c.dom.DOMException ex) { 152 throw wrap(ex); 153 } 154 } 155 156 public DOMAttr removeAttributeNode(DOMAttr oldAttr) 157 throws DOMException 158 { 159 try { 160 return wrap(_delegate.removeAttributeNode(oldAttr._delegate)); 161 } 162 catch (org.w3c.dom.DOMException ex) { 163 throw wrap(ex); 164 } 165 } 166 167 public void setAttribute(String name, String value) 168 throws DOMException 169 { 170 try { 171 _delegate.setAttribute(name, value); 172 } 173 catch (org.w3c.dom.DOMException ex) { 174 throw wrap(ex); 175 } 176 } 177 178 public void setAttributeNS(String namespaceURI, 179 String qualifiedName, 180 String value) 181 throws DOMException 182 { 183 try { 184 _delegate.setAttributeNS(namespaceURI, qualifiedName, value); 185 } 186 catch (org.w3c.dom.DOMException ex) { 187 throw wrap(ex); 188 } 189 } 190 191 public DOMAttr setAttributeNode(DOMAttr newAttr) 192 throws DOMException 193 { 194 try { 195 return wrap(_delegate.setAttributeNode(newAttr._delegate)); 196 } 197 catch (org.w3c.dom.DOMException ex) { 198 throw wrap(ex); 199 } 200 } 201 202 public DOMAttr setAttributeNodeNS(DOMAttr newAttr) 203 throws DOMException 204 { 205 try { 206 return wrap(_delegate.setAttributeNodeNS(newAttr._delegate)); 207 } 208 catch (org.w3c.dom.DOMException ex) { 209 throw wrap(ex); 210 } 211 } 212 213 public void setIdAttribute(String name, boolean isId) 214 throws DOMException 215 { 216 try { 217 _delegate.setIdAttribute(name, isId); 218 } 219 catch (org.w3c.dom.DOMException ex) { 220 throw wrap(ex); 221 } 222 } 223 224 public void setIdAttributeNS(String namespaceURI, 225 String localName, 226 boolean isId) 227 throws DOMException 228 { 229 try { 230 _delegate.setIdAttributeNS(namespaceURI, localName, isId); 231 } 232 catch (org.w3c.dom.DOMException ex) { 233 throw wrap(ex); 234 } 235 } 236 237 public void setIdAttributeNode(DOMAttr idAttr, boolean isId) 238 throws DOMException 239 { 240 try { 241 _delegate.setIdAttributeNode(idAttr._delegate, isId); 242 } 243 catch (org.w3c.dom.DOMException ex) { 244 throw wrap(ex); 245 } 246 } 247 } 248 | Popular Tags |