Fri, 04 Oct 2013 16:21:34 +0100
8025054: Update JAX-WS RI integration to 2.2.9-b130926.1035
Reviewed-by: chegar
ohair@286 | 1 | /* |
alanb@368 | 2 | * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. |
ohair@286 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ohair@286 | 4 | * |
ohair@286 | 5 | * This code is free software; you can redistribute it and/or modify it |
ohair@286 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@286 | 7 | * published by the Free Software Foundation. Oracle designates this |
ohair@286 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@286 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
ohair@286 | 10 | * |
ohair@286 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
ohair@286 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ohair@286 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ohair@286 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
ohair@286 | 15 | * accompanied this code). |
ohair@286 | 16 | * |
ohair@286 | 17 | * You should have received a copy of the GNU General Public License version |
ohair@286 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
ohair@286 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ohair@286 | 20 | * |
ohair@286 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@286 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@286 | 23 | * questions. |
ohair@286 | 24 | */ |
ohair@286 | 25 | |
ohair@286 | 26 | package javax.xml.soap; |
ohair@286 | 27 | |
ohair@286 | 28 | import java.util.Iterator; |
ohair@286 | 29 | |
ohair@286 | 30 | import javax.xml.namespace.QName; |
ohair@286 | 31 | |
ohair@286 | 32 | /** |
ohair@286 | 33 | * An object representing an element of a SOAP message that is allowed but not |
ohair@286 | 34 | * specifically prescribed by a SOAP specification. This interface serves as the |
ohair@286 | 35 | * base interface for those objects that are specifically prescribed by a SOAP |
ohair@286 | 36 | * specification. |
ohair@286 | 37 | * <p> |
ohair@286 | 38 | * Methods in this interface that are required to return SAAJ specific objects |
ohair@286 | 39 | * may "silently" replace nodes in the tree as required to successfully return |
ohair@286 | 40 | * objects of the correct type. See {@link #getChildElements()} and |
ohair@286 | 41 | * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>} |
ohair@286 | 42 | * for details. |
ohair@286 | 43 | */ |
ohair@286 | 44 | public interface SOAPElement extends Node, org.w3c.dom.Element { |
ohair@286 | 45 | |
ohair@286 | 46 | /** |
ohair@286 | 47 | * Creates a new <code>SOAPElement</code> object initialized with the |
ohair@286 | 48 | * given <code>Name</code> object and adds the new element to this |
ohair@286 | 49 | * <code>SOAPElement</code> object. |
ohair@286 | 50 | * <P> |
ohair@286 | 51 | * This method may be deprecated in a future release of SAAJ in favor of |
ohair@286 | 52 | * addChildElement(javax.xml.namespace.QName) |
ohair@286 | 53 | * |
ohair@286 | 54 | * @param name a <code>Name</code> object with the XML name for the |
ohair@286 | 55 | * new element |
ohair@286 | 56 | * |
ohair@286 | 57 | * @return the new <code>SOAPElement</code> object that was created |
ohair@286 | 58 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 59 | * <code>SOAPElement</code> object |
ohair@286 | 60 | * @see SOAPElement#addChildElement(javax.xml.namespace.QName) |
ohair@286 | 61 | */ |
ohair@286 | 62 | public SOAPElement addChildElement(Name name) throws SOAPException; |
ohair@286 | 63 | |
ohair@286 | 64 | /** |
ohair@286 | 65 | * Creates a new <code>SOAPElement</code> object initialized with the given |
ohair@286 | 66 | * <code>QName</code> object and adds the new element to this <code>SOAPElement</code> |
ohair@286 | 67 | * object. The <i>namespace</i>, <i>localname</i> and <i>prefix</i> of the new |
ohair@286 | 68 | * <code>SOAPElement</code> are all taken from the <code>qname</code> argument. |
ohair@286 | 69 | * |
ohair@286 | 70 | * @param qname a <code>QName</code> object with the XML name for the |
ohair@286 | 71 | * new element |
ohair@286 | 72 | * |
ohair@286 | 73 | * @return the new <code>SOAPElement</code> object that was created |
ohair@286 | 74 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 75 | * <code>SOAPElement</code> object |
ohair@286 | 76 | * @see SOAPElement#addChildElement(Name) |
ohair@286 | 77 | * @since SAAJ 1.3 |
ohair@286 | 78 | */ |
ohair@286 | 79 | public SOAPElement addChildElement(QName qname) throws SOAPException; |
ohair@286 | 80 | |
ohair@286 | 81 | /** |
ohair@286 | 82 | * Creates a new <code>SOAPElement</code> object initialized with the |
ohair@286 | 83 | * specified local name and adds the new element to this |
ohair@286 | 84 | * <code>SOAPElement</code> object. |
ohair@286 | 85 | * The new <code>SOAPElement</code> inherits any in-scope default namespace. |
ohair@286 | 86 | * |
ohair@286 | 87 | * @param localName a <code>String</code> giving the local name for |
ohair@286 | 88 | * the element |
ohair@286 | 89 | * @return the new <code>SOAPElement</code> object that was created |
ohair@286 | 90 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 91 | * <code>SOAPElement</code> object |
ohair@286 | 92 | */ |
ohair@286 | 93 | public SOAPElement addChildElement(String localName) throws SOAPException; |
ohair@286 | 94 | |
ohair@286 | 95 | /** |
ohair@286 | 96 | * Creates a new <code>SOAPElement</code> object initialized with the |
ohair@286 | 97 | * specified local name and prefix and adds the new element to this |
ohair@286 | 98 | * <code>SOAPElement</code> object. |
ohair@286 | 99 | * |
ohair@286 | 100 | * @param localName a <code>String</code> giving the local name for |
ohair@286 | 101 | * the new element |
ohair@286 | 102 | * @param prefix a <code>String</code> giving the namespace prefix for |
ohair@286 | 103 | * the new element |
ohair@286 | 104 | * |
ohair@286 | 105 | * @return the new <code>SOAPElement</code> object that was created |
ohair@286 | 106 | * @exception SOAPException if the <code>prefix</code> is not valid in the |
ohair@286 | 107 | * context of this <code>SOAPElement</code> or if there is an error in creating the |
ohair@286 | 108 | * <code>SOAPElement</code> object |
ohair@286 | 109 | */ |
ohair@286 | 110 | public SOAPElement addChildElement(String localName, String prefix) |
ohair@286 | 111 | throws SOAPException; |
ohair@286 | 112 | |
ohair@286 | 113 | /** |
ohair@286 | 114 | * Creates a new <code>SOAPElement</code> object initialized with the |
ohair@286 | 115 | * specified local name, prefix, and URI and adds the new element to this |
ohair@286 | 116 | * <code>SOAPElement</code> object. |
ohair@286 | 117 | * |
ohair@286 | 118 | * @param localName a <code>String</code> giving the local name for |
ohair@286 | 119 | * the new element |
ohair@286 | 120 | * @param prefix a <code>String</code> giving the namespace prefix for |
ohair@286 | 121 | * the new element |
ohair@286 | 122 | * @param uri a <code>String</code> giving the URI of the namespace |
ohair@286 | 123 | * to which the new element belongs |
ohair@286 | 124 | * |
ohair@286 | 125 | * @return the new <code>SOAPElement</code> object that was created |
ohair@286 | 126 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 127 | * <code>SOAPElement</code> object |
ohair@286 | 128 | */ |
ohair@286 | 129 | public SOAPElement addChildElement(String localName, String prefix, |
ohair@286 | 130 | String uri) |
ohair@286 | 131 | throws SOAPException; |
ohair@286 | 132 | |
ohair@286 | 133 | /** |
ohair@286 | 134 | * Add a <code>SOAPElement</code> as a child of this |
ohair@286 | 135 | * <code>SOAPElement</code> instance. The <code>SOAPElement</code> |
ohair@286 | 136 | * is expected to be created by a |
ohair@286 | 137 | * <code>SOAPFactory</code>. Callers should not rely on the |
ohair@286 | 138 | * element instance being added as is into the XML |
ohair@286 | 139 | * tree. Implementations could end up copying the content |
ohair@286 | 140 | * of the <code>SOAPElement</code> passed into an instance of |
ohair@286 | 141 | * a different <code>SOAPElement</code> implementation. For |
ohair@286 | 142 | * instance if <code>addChildElement()</code> is called on a |
ohair@286 | 143 | * <code>SOAPHeader</code>, <code>element</code> will be copied |
ohair@286 | 144 | * into an instance of a <code>SOAPHeaderElement</code>. |
ohair@286 | 145 | * |
ohair@286 | 146 | * <P>The fragment rooted in <code>element</code> is either added |
ohair@286 | 147 | * as a whole or not at all, if there was an error. |
ohair@286 | 148 | * |
ohair@286 | 149 | * <P>The fragment rooted in <code>element</code> cannot contain |
ohair@286 | 150 | * elements named "Envelope", "Header" or "Body" and in the SOAP |
ohair@286 | 151 | * namespace. Any namespace prefixes present in the fragment |
ohair@286 | 152 | * should be fully resolved using appropriate namespace |
ohair@286 | 153 | * declarations within the fragment itself. |
ohair@286 | 154 | * |
ohair@286 | 155 | * @param element the <code>SOAPElement</code> to be added as a |
ohair@286 | 156 | * new child |
ohair@286 | 157 | * |
ohair@286 | 158 | * @exception SOAPException if there was an error in adding this |
ohair@286 | 159 | * element as a child |
ohair@286 | 160 | * |
ohair@286 | 161 | * @return an instance representing the new SOAP element that was |
ohair@286 | 162 | * actually added to the tree. |
ohair@286 | 163 | */ |
ohair@286 | 164 | public SOAPElement addChildElement(SOAPElement element) |
ohair@286 | 165 | throws SOAPException; |
ohair@286 | 166 | |
ohair@286 | 167 | /** |
ohair@286 | 168 | * Detaches all children of this <code>SOAPElement</code>. |
ohair@286 | 169 | * <p> |
ohair@286 | 170 | * This method is useful for rolling back the construction of partially |
ohair@286 | 171 | * completed <code>SOAPHeaders</code> and <code>SOAPBodys</code> in |
ohair@286 | 172 | * preparation for sending a fault when an error condition is detected. It |
ohair@286 | 173 | * is also useful for recycling portions of a document within a SOAP |
ohair@286 | 174 | * message. |
ohair@286 | 175 | * |
ohair@286 | 176 | * @since SAAJ 1.2 |
ohair@286 | 177 | */ |
ohair@286 | 178 | public abstract void removeContents(); |
ohair@286 | 179 | |
ohair@286 | 180 | /** |
ohair@286 | 181 | * Creates a new <code>Text</code> object initialized with the given |
ohair@286 | 182 | * <code>String</code> and adds it to this <code>SOAPElement</code> object. |
ohair@286 | 183 | * |
ohair@286 | 184 | * @param text a <code>String</code> object with the textual content to be added |
ohair@286 | 185 | * |
ohair@286 | 186 | * @return the <code>SOAPElement</code> object into which |
ohair@286 | 187 | * the new <code>Text</code> object was inserted |
ohair@286 | 188 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 189 | * new <code>Text</code> object or if it is not legal to |
ohair@286 | 190 | * attach it as a child to this |
ohair@286 | 191 | * <code>SOAPElement</code> |
ohair@286 | 192 | */ |
ohair@286 | 193 | public SOAPElement addTextNode(String text) throws SOAPException; |
ohair@286 | 194 | |
ohair@286 | 195 | /** |
ohair@286 | 196 | * Adds an attribute with the specified name and value to this |
ohair@286 | 197 | * <code>SOAPElement</code> object. |
ohair@286 | 198 | * |
ohair@286 | 199 | * @param name a <code>Name</code> object with the name of the attribute |
ohair@286 | 200 | * @param value a <code>String</code> giving the value of the attribute |
ohair@286 | 201 | * @return the <code>SOAPElement</code> object into which the attribute was |
ohair@286 | 202 | * inserted |
ohair@286 | 203 | * |
ohair@286 | 204 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 205 | * Attribute, or it is invalid to set |
ohair@286 | 206 | an attribute with <code>Name</code> |
ohair@286 | 207 | <code>name</code> on this SOAPElement. |
ohair@286 | 208 | * @see SOAPElement#addAttribute(javax.xml.namespace.QName, String) |
ohair@286 | 209 | */ |
ohair@286 | 210 | public SOAPElement addAttribute(Name name, String value) |
ohair@286 | 211 | throws SOAPException; |
ohair@286 | 212 | |
ohair@286 | 213 | /** |
ohair@286 | 214 | * Adds an attribute with the specified name and value to this |
ohair@286 | 215 | * <code>SOAPElement</code> object. |
ohair@286 | 216 | * |
ohair@286 | 217 | * @param qname a <code>QName</code> object with the name of the attribute |
ohair@286 | 218 | * @param value a <code>String</code> giving the value of the attribute |
ohair@286 | 219 | * @return the <code>SOAPElement</code> object into which the attribute was |
ohair@286 | 220 | * inserted |
ohair@286 | 221 | * |
ohair@286 | 222 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 223 | * Attribute, or it is invalid to set |
ohair@286 | 224 | an attribute with <code>QName</code> |
ohair@286 | 225 | <code>qname</code> on this SOAPElement. |
ohair@286 | 226 | * @see SOAPElement#addAttribute(Name, String) |
ohair@286 | 227 | * @since SAAJ 1.3 |
ohair@286 | 228 | */ |
ohair@286 | 229 | public SOAPElement addAttribute(QName qname, String value) |
ohair@286 | 230 | throws SOAPException; |
ohair@286 | 231 | |
ohair@286 | 232 | /** |
ohair@286 | 233 | * Adds a namespace declaration with the specified prefix and URI to this |
ohair@286 | 234 | * <code>SOAPElement</code> object. |
ohair@286 | 235 | * |
ohair@286 | 236 | * @param prefix a <code>String</code> giving the prefix of the namespace |
ohair@286 | 237 | * @param uri a <code>String</code> giving the uri of the namespace |
ohair@286 | 238 | * @return the <code>SOAPElement</code> object into which this |
ohair@286 | 239 | * namespace declaration was inserted. |
ohair@286 | 240 | * |
ohair@286 | 241 | * @exception SOAPException if there is an error in creating the |
ohair@286 | 242 | * namespace |
ohair@286 | 243 | */ |
ohair@286 | 244 | public SOAPElement addNamespaceDeclaration(String prefix, String uri) |
ohair@286 | 245 | throws SOAPException; |
ohair@286 | 246 | |
ohair@286 | 247 | /** |
ohair@286 | 248 | * Returns the value of the attribute with the specified name. |
ohair@286 | 249 | * |
ohair@286 | 250 | * @param name a <code>Name</code> object with the name of the attribute |
ohair@286 | 251 | * @return a <code>String</code> giving the value of the specified |
ohair@286 | 252 | * attribute, Null if there is no such attribute |
ohair@286 | 253 | * @see SOAPElement#getAttributeValue(javax.xml.namespace.QName) |
ohair@286 | 254 | */ |
ohair@286 | 255 | public String getAttributeValue(Name name); |
ohair@286 | 256 | |
ohair@286 | 257 | /** |
ohair@286 | 258 | * Returns the value of the attribute with the specified qname. |
ohair@286 | 259 | * |
ohair@286 | 260 | * @param qname a <code>QName</code> object with the qname of the attribute |
ohair@286 | 261 | * @return a <code>String</code> giving the value of the specified |
ohair@286 | 262 | * attribute, Null if there is no such attribute |
ohair@286 | 263 | * @see SOAPElement#getAttributeValue(Name) |
ohair@286 | 264 | * @since SAAJ 1.3 |
ohair@286 | 265 | */ |
ohair@286 | 266 | public String getAttributeValue(QName qname); |
ohair@286 | 267 | |
ohair@286 | 268 | /** |
ohair@286 | 269 | * Returns an <code>Iterator</code> over all of the attribute |
ohair@286 | 270 | * <code>Name</code> objects in this |
ohair@286 | 271 | * <code>SOAPElement</code> object. The iterator can be used to get |
ohair@286 | 272 | * the attribute names, which can then be passed to the method |
ohair@286 | 273 | * <code>getAttributeValue</code> to retrieve the value of each |
ohair@286 | 274 | * attribute. |
ohair@286 | 275 | * |
ohair@286 | 276 | * @see SOAPElement#getAllAttributesAsQNames() |
ohair@286 | 277 | * @return an iterator over the names of the attributes |
ohair@286 | 278 | */ |
ohair@286 | 279 | public Iterator getAllAttributes(); |
ohair@286 | 280 | |
ohair@286 | 281 | /** |
ohair@286 | 282 | * Returns an <code>Iterator</code> over all of the attributes |
ohair@286 | 283 | * in this <code>SOAPElement</code> as <code>QName</code> objects. |
ohair@286 | 284 | * The iterator can be used to get the attribute QName, which can then |
ohair@286 | 285 | * be passed to the method <code>getAttributeValue</code> to retrieve |
ohair@286 | 286 | * the value of each attribute. |
ohair@286 | 287 | * |
ohair@286 | 288 | * @return an iterator over the QNames of the attributes |
ohair@286 | 289 | * @see SOAPElement#getAllAttributes() |
ohair@286 | 290 | * @since SAAJ 1.3 |
ohair@286 | 291 | */ |
ohair@286 | 292 | public Iterator getAllAttributesAsQNames(); |
ohair@286 | 293 | |
ohair@286 | 294 | |
ohair@286 | 295 | /** |
ohair@286 | 296 | * Returns the URI of the namespace that has the given prefix. |
ohair@286 | 297 | * |
ohair@286 | 298 | * @param prefix a <code>String</code> giving the prefix of the namespace |
ohair@286 | 299 | * for which to search |
ohair@286 | 300 | * @return a <code>String</code> with the uri of the namespace that has |
ohair@286 | 301 | * the given prefix |
ohair@286 | 302 | */ |
ohair@286 | 303 | public String getNamespaceURI(String prefix); |
ohair@286 | 304 | |
ohair@286 | 305 | /** |
ohair@286 | 306 | * Returns an <code>Iterator</code> over the namespace prefix |
ohair@286 | 307 | * <code>String</code>s declared by this element. The prefixes returned by |
ohair@286 | 308 | * this iterator can be passed to the method |
ohair@286 | 309 | * <code>getNamespaceURI</code> to retrieve the URI of each namespace. |
ohair@286 | 310 | * |
ohair@286 | 311 | * @return an iterator over the namespace prefixes in this |
ohair@286 | 312 | * <code>SOAPElement</code> object |
ohair@286 | 313 | */ |
ohair@286 | 314 | public Iterator getNamespacePrefixes(); |
ohair@286 | 315 | |
ohair@286 | 316 | /** |
ohair@286 | 317 | * Returns an <code>Iterator</code> over the namespace prefix |
ohair@286 | 318 | * <code>String</code>s visible to this element. The prefixes returned by |
ohair@286 | 319 | * this iterator can be passed to the method |
ohair@286 | 320 | * <code>getNamespaceURI</code> to retrieve the URI of each namespace. |
ohair@286 | 321 | * |
ohair@286 | 322 | * @return an iterator over the namespace prefixes are within scope of this |
ohair@286 | 323 | * <code>SOAPElement</code> object |
ohair@286 | 324 | * |
ohair@286 | 325 | * @since SAAJ 1.2 |
ohair@286 | 326 | */ |
ohair@286 | 327 | public Iterator getVisibleNamespacePrefixes(); |
ohair@286 | 328 | |
ohair@286 | 329 | /** |
ohair@286 | 330 | * Creates a <code>QName</code> whose namespace URI is the one associated |
ohair@286 | 331 | * with the parameter, <code>prefix</code>, in the context of this |
ohair@286 | 332 | * <code>SOAPElement</code>. The remaining elements of the new |
ohair@286 | 333 | * <code>QName</code> are taken directly from the parameters, |
ohair@286 | 334 | * <code>localName</code> and <code>prefix</code>. |
ohair@286 | 335 | * |
ohair@286 | 336 | * @param localName |
ohair@286 | 337 | * a <code>String</code> containing the local part of the name. |
ohair@286 | 338 | * @param prefix |
ohair@286 | 339 | * a <code>String</code> containing the prefix for the name. |
ohair@286 | 340 | * |
ohair@286 | 341 | * @return a <code>QName</code> with the specified <code>localName</code> |
ohair@286 | 342 | * and <code>prefix</code>, and with a namespace that is associated |
ohair@286 | 343 | * with the <code>prefix</code> in the context of this |
ohair@286 | 344 | * <code>SOAPElement</code>. This namespace will be the same as |
ohair@286 | 345 | * the one that would be returned by |
ohair@286 | 346 | * <code>{@link #getNamespaceURI(String)}</code> if it were given |
ohair@286 | 347 | * <code>prefix</code> as it's parameter. |
ohair@286 | 348 | * |
ohair@286 | 349 | * @exception SOAPException if the <code>QName</code> cannot be created. |
ohair@286 | 350 | * |
ohair@286 | 351 | * @since SAAJ 1.3 |
ohair@286 | 352 | */ |
ohair@286 | 353 | public QName createQName(String localName, String prefix) |
ohair@286 | 354 | throws SOAPException; |
ohair@286 | 355 | /** |
ohair@286 | 356 | * Returns the name of this <code>SOAPElement</code> object. |
ohair@286 | 357 | * |
ohair@286 | 358 | * @return a <code>Name</code> object with the name of this |
ohair@286 | 359 | * <code>SOAPElement</code> object |
ohair@286 | 360 | */ |
ohair@286 | 361 | public Name getElementName(); |
ohair@286 | 362 | |
ohair@286 | 363 | /** |
ohair@286 | 364 | * Returns the qname of this <code>SOAPElement</code> object. |
ohair@286 | 365 | * |
ohair@286 | 366 | * @return a <code>QName</code> object with the qname of this |
ohair@286 | 367 | * <code>SOAPElement</code> object |
ohair@286 | 368 | * @see SOAPElement#getElementName() |
ohair@286 | 369 | * @since SAAJ 1.3 |
ohair@286 | 370 | */ |
ohair@286 | 371 | public QName getElementQName(); |
ohair@286 | 372 | |
ohair@286 | 373 | /** |
ohair@286 | 374 | * Changes the name of this <code>Element</code> to <code>newName</code> if |
ohair@286 | 375 | * possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody |
ohair@286 | 376 | * etc. cannot have their names changed using this method. Any attempt to do |
ohair@286 | 377 | * so will result in a SOAPException being thrown. |
ohair@286 | 378 | *<P> |
ohair@286 | 379 | * Callers should not rely on the element instance being renamed as is. |
ohair@286 | 380 | * Implementations could end up copying the content of the |
ohair@286 | 381 | * <code>SOAPElement</code> to a renamed instance. |
ohair@286 | 382 | * |
ohair@286 | 383 | * @param newName the new name for the <code>Element</code>. |
ohair@286 | 384 | * |
ohair@286 | 385 | * @exception SOAPException if changing the name of this <code>Element</code> |
ohair@286 | 386 | * is not allowed. |
ohair@286 | 387 | * @return The renamed Node |
ohair@286 | 388 | * |
ohair@286 | 389 | * @since SAAJ 1.3 |
ohair@286 | 390 | */ |
ohair@286 | 391 | public SOAPElement setElementQName(QName newName) throws SOAPException; |
ohair@286 | 392 | |
ohair@286 | 393 | /** |
ohair@286 | 394 | * Removes the attribute with the specified name. |
ohair@286 | 395 | * |
ohair@286 | 396 | * @param name the <code>Name</code> object with the name of the |
ohair@286 | 397 | * attribute to be removed |
ohair@286 | 398 | * @return <code>true</code> if the attribute was |
ohair@286 | 399 | * removed successfully; <code>false</code> if it was not |
ohair@286 | 400 | * @see SOAPElement#removeAttribute(javax.xml.namespace.QName) |
ohair@286 | 401 | */ |
ohair@286 | 402 | public boolean removeAttribute(Name name); |
ohair@286 | 403 | |
ohair@286 | 404 | /** |
ohair@286 | 405 | * Removes the attribute with the specified qname. |
ohair@286 | 406 | * |
ohair@286 | 407 | * @param qname the <code>QName</code> object with the qname of the |
ohair@286 | 408 | * attribute to be removed |
ohair@286 | 409 | * @return <code>true</code> if the attribute was |
ohair@286 | 410 | * removed successfully; <code>false</code> if it was not |
ohair@286 | 411 | * @see SOAPElement#removeAttribute(Name) |
ohair@286 | 412 | * @since SAAJ 1.3 |
ohair@286 | 413 | */ |
ohair@286 | 414 | public boolean removeAttribute(QName qname); |
ohair@286 | 415 | |
ohair@286 | 416 | /** |
ohair@286 | 417 | * Removes the namespace declaration corresponding to the given prefix. |
ohair@286 | 418 | * |
ohair@286 | 419 | * @param prefix a <code>String</code> giving the prefix for which |
ohair@286 | 420 | * to search |
ohair@286 | 421 | * @return <code>true</code> if the namespace declaration was |
ohair@286 | 422 | * removed successfully; <code>false</code> if it was not |
ohair@286 | 423 | */ |
ohair@286 | 424 | public boolean removeNamespaceDeclaration(String prefix); |
ohair@286 | 425 | |
ohair@286 | 426 | /** |
ohair@286 | 427 | * Returns an <code>Iterator</code> over all the immediate child |
ohair@286 | 428 | * {@link Node}s of this element. This includes <code>javax.xml.soap.Text</code> |
ohair@286 | 429 | * objects as well as <code>SOAPElement</code> objects. |
ohair@286 | 430 | * <p> |
ohair@286 | 431 | * Calling this method may cause child <code>Element</code>, |
ohair@286 | 432 | * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be |
ohair@286 | 433 | * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>, |
ohair@286 | 434 | * <code>SOAPBodyElement</code> or <code>javax.xml.soap.Text</code> nodes as |
ohair@286 | 435 | * appropriate for the type of this parent node. As a result the calling |
ohair@286 | 436 | * application must treat any existing references to these child nodes that |
ohair@286 | 437 | * have been obtained through DOM APIs as invalid and either discard them or |
ohair@286 | 438 | * refresh them with the values returned by this <code>Iterator</code>. This |
ohair@286 | 439 | * behavior can be avoided by calling the equivalent DOM APIs. See |
ohair@286 | 440 | * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>} |
ohair@286 | 441 | * for more details. |
ohair@286 | 442 | * |
ohair@286 | 443 | * @return an iterator with the content of this <code>SOAPElement</code> |
ohair@286 | 444 | * object |
ohair@286 | 445 | */ |
ohair@286 | 446 | public Iterator getChildElements(); |
ohair@286 | 447 | |
ohair@286 | 448 | /** |
ohair@286 | 449 | * Returns an <code>Iterator</code> over all the immediate child |
ohair@286 | 450 | * {@link Node}s of this element with the specified name. All of these |
ohair@286 | 451 | * children will be <code>SOAPElement</code> nodes. |
ohair@286 | 452 | * <p> |
ohair@286 | 453 | * Calling this method may cause child <code>Element</code>, |
ohair@286 | 454 | * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be |
ohair@286 | 455 | * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>, |
ohair@286 | 456 | * <code>SOAPBodyElement</code> or <code>javax.xml.soap.Text</code> nodes as |
ohair@286 | 457 | * appropriate for the type of this parent node. As a result the calling |
ohair@286 | 458 | * application must treat any existing references to these child nodes that |
ohair@286 | 459 | * have been obtained through DOM APIs as invalid and either discard them or |
ohair@286 | 460 | * refresh them with the values returned by this <code>Iterator</code>. This |
ohair@286 | 461 | * behavior can be avoided by calling the equivalent DOM APIs. See |
ohair@286 | 462 | * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>} |
ohair@286 | 463 | * for more details. |
ohair@286 | 464 | * |
ohair@286 | 465 | * @param name a <code>Name</code> object with the name of the child |
ohair@286 | 466 | * elements to be returned |
ohair@286 | 467 | * |
ohair@286 | 468 | * @return an <code>Iterator</code> object over all the elements |
ohair@286 | 469 | * in this <code>SOAPElement</code> object with the |
ohair@286 | 470 | * specified name |
ohair@286 | 471 | * @see SOAPElement#getChildElements(javax.xml.namespace.QName) |
ohair@286 | 472 | */ |
ohair@286 | 473 | public Iterator getChildElements(Name name); |
ohair@286 | 474 | |
ohair@286 | 475 | /** |
ohair@286 | 476 | * Returns an <code>Iterator</code> over all the immediate child |
ohair@286 | 477 | * {@link Node}s of this element with the specified qname. All of these |
ohair@286 | 478 | * children will be <code>SOAPElement</code> nodes. |
ohair@286 | 479 | * <p> |
ohair@286 | 480 | * Calling this method may cause child <code>Element</code>, |
ohair@286 | 481 | * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be |
ohair@286 | 482 | * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>, |
ohair@286 | 483 | * <code>SOAPBodyElement</code> or <code>javax.xml.soap.Text</code> nodes as |
ohair@286 | 484 | * appropriate for the type of this parent node. As a result the calling |
ohair@286 | 485 | * application must treat any existing references to these child nodes that |
ohair@286 | 486 | * have been obtained through DOM APIs as invalid and either discard them or |
ohair@286 | 487 | * refresh them with the values returned by this <code>Iterator</code>. This |
ohair@286 | 488 | * behavior can be avoided by calling the equivalent DOM APIs. See |
ohair@286 | 489 | * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>} |
ohair@286 | 490 | * for more details. |
ohair@286 | 491 | * |
ohair@286 | 492 | * @param qname a <code>QName</code> object with the qname of the child |
ohair@286 | 493 | * elements to be returned |
ohair@286 | 494 | * |
ohair@286 | 495 | * @return an <code>Iterator</code> object over all the elements |
ohair@286 | 496 | * in this <code>SOAPElement</code> object with the |
ohair@286 | 497 | * specified qname |
ohair@286 | 498 | * @see SOAPElement#getChildElements(Name) |
ohair@286 | 499 | * @since SAAJ 1.3 |
ohair@286 | 500 | */ |
ohair@286 | 501 | public Iterator getChildElements(QName qname); |
ohair@286 | 502 | |
ohair@286 | 503 | /** |
ohair@286 | 504 | * Sets the encoding style for this <code>SOAPElement</code> object |
ohair@286 | 505 | * to one specified. |
ohair@286 | 506 | * |
ohair@286 | 507 | * @param encodingStyle a <code>String</code> giving the encoding style |
ohair@286 | 508 | * |
ohair@286 | 509 | * @exception IllegalArgumentException if there was a problem in the |
ohair@286 | 510 | * encoding style being set. |
ohair@286 | 511 | * @exception SOAPException if setting the encodingStyle is invalid for this SOAPElement. |
ohair@286 | 512 | * @see #getEncodingStyle |
ohair@286 | 513 | */ |
ohair@286 | 514 | public void setEncodingStyle(String encodingStyle) |
ohair@286 | 515 | throws SOAPException; |
ohair@286 | 516 | /** |
ohair@286 | 517 | * Returns the encoding style for this <code>SOAPElement</code> object. |
ohair@286 | 518 | * |
ohair@286 | 519 | * @return a <code>String</code> giving the encoding style |
ohair@286 | 520 | * |
ohair@286 | 521 | * @see #setEncodingStyle |
ohair@286 | 522 | */ |
ohair@286 | 523 | public String getEncodingStyle(); |
ohair@286 | 524 | } |