jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
author aefimov
Thu, 16 Feb 2017 13:14:39 +0300
changeset 43852 93a527059d8a
parent 43126 26c4004e8cc0
child 45678 65fdff10664d
permissions -rw-r--r--
8174735: Update JAX-WS RI integration to latest version Reviewed-by: alanb, mchung, lancea Contributed-by: roman.grigoriadi@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     1
/*
43126
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
     2
 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     4
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    10
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    15
 * accompanied this code).
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    16
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    20
 *
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    23
 * questions.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    24
 */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    25
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    26
package com.sun.xml.internal.messaging.saaj.soap.impl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    27
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
    28
import java.net.URI;
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
    29
import java.net.URISyntaxException;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    30
import java.util.*;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    31
import java.util.logging.Level;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    32
import java.util.logging.Logger;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    33
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    34
import javax.xml.namespace.QName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    35
import javax.xml.soap.*;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    36
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    37
import org.w3c.dom.*;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    38
import org.w3c.dom.Node;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    39
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    40
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    41
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    42
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    43
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    44
import com.sun.xml.internal.messaging.saaj.util.*;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    45
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    46
public class ElementImpl implements SOAPElement, SOAPBodyElement {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    47
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    48
    public static final String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#".intern();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    49
    public static final String XENC_NS = "http://www.w3.org/2001/04/xmlenc#".intern();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    50
    public static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd".intern();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    51
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
    52
    private transient AttributeManager encodingStyleAttribute = new AttributeManager();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    53
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    54
    protected QName elementQName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
    55
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    56
    private Element element;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    57
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    58
    private SOAPDocumentImpl soapDocument;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    59
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    60
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    61
    public String getTagName() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    62
        return element.getTagName();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    63
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    64
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    65
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    66
    public String getAttribute(String name) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    67
        return element.getAttribute(name);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    68
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    69
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    70
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    71
    public void setAttribute(String name, String value) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    72
        boolean isQualifiedName = (name.indexOf(":") > 0);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    73
        //this is because of BugfixTest#testCR7020991, after removal internal dependencies
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    74
        //SOAPDocumentImpl#createAttribute is not called anymore from xerces parent
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    75
        if (isQualifiedName) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    76
            String nsUri = null;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    77
            String prefix = name.substring(0, name.indexOf(":"));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    78
            //cannot do anything to resolve the URI if prefix is not
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    79
            //XMLNS.
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    80
            if (XMLNS.equals(prefix)) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    81
                nsUri = ElementImpl.XMLNS_URI;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    82
                setAttributeNS(nsUri, name, value);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    83
                return;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    84
            }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    85
        }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    86
        element.setAttribute(name, value);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    87
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    88
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    89
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    90
    public void removeAttribute(String name) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    91
        element.removeAttribute(name);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    92
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    93
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    94
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    95
    public Attr getAttributeNode(String name) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    96
        return element.getAttributeNode(name);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    97
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    98
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
    99
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   100
    public Attr setAttributeNode(Attr newAttr) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   101
        return element.setAttributeNode(newAttr);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   102
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   103
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   104
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   105
    public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   106
        return element.removeAttributeNode(oldAttr);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   107
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   108
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   109
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   110
    public NodeList getElementsByTagName(String name) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   111
        return new NodeListImpl(getSoapDocument(), element.getElementsByTagName(name));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   112
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   113
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   114
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   115
    public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   116
        return element.getAttributeNS(namespaceURI, localName);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   117
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   118
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   119
    protected static final Logger log =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   120
        Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   121
                         "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   122
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   123
    /**
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   124
     * XML Information Set REC
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   125
     * all namespace attributes (including those named xmlns,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   126
     * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   127
     */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   128
    public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   129
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   130
    /**
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   131
     * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   132
     * the Namespace URI that is automatically mapped to the "xml" prefix.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   133
     */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   134
    public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   135
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   136
    private final static String XMLNS = "xmlns".intern();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   137
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   138
    public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   139
        this.soapDocument = ownerDoc;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   140
        this.element = ownerDoc.getDomDocument().createElementNS(name.getURI(), name.getQualifiedName());
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   141
        elementQName = NameImpl.convertToQName(name);
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   142
        getSoapDocument().register(this);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   143
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   144
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   145
    public ElementImpl(SOAPDocumentImpl ownerDoc, QName name) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   146
        this.soapDocument = ownerDoc;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   147
        this.element = ownerDoc.getDomDocument().createElementNS(name.getNamespaceURI(), getQualifiedName(name));
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   148
        elementQName = name;
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   149
        getSoapDocument().register(this);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   150
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   151
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   152
    public ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   153
        this.element = domElement;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   154
        this.soapDocument = ownerDoc;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   155
        this.elementQName = new QName(domElement.getNamespaceURI(), domElement.getLocalName());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   156
        getSoapDocument().register(this);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   157
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   158
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   159
    public ElementImpl(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   160
        SOAPDocumentImpl ownerDoc,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   161
        String uri,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   162
        String qualifiedName) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   163
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   164
        this.soapDocument = ownerDoc;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   165
        this.element = ownerDoc.getDomDocument().createElementNS(uri, qualifiedName);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   166
        elementQName =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   167
            new QName(uri, getLocalPart(qualifiedName), getPrefix(qualifiedName));
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   168
        getSoapDocument().register(this);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   169
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   170
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   171
    public void ensureNamespaceIsDeclared(String prefix, String uri) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   172
        String alreadyDeclaredUri = getNamespaceURI(prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   173
        if (alreadyDeclaredUri == null || !alreadyDeclaredUri.equals(uri)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   174
            try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   175
                addNamespaceDeclaration(prefix, uri);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   176
            } catch (SOAPException e) { /*ignore*/
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   177
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   178
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   179
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   180
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   181
    public Document getOwnerDocument() {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   182
        return soapDocument;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   183
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   184
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   185
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   186
    public Node insertBefore(Node newChild, Node refChild) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   187
        return element.insertBefore(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(refChild));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   188
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   189
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   190
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   191
    public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   192
        return element.replaceChild(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(oldChild));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   193
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   194
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   195
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   196
    public Node removeChild(Node oldChild) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   197
        return element.removeChild(getSoapDocument().getDomNode(oldChild));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   198
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   199
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   200
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   201
    public Node appendChild(Node newChild) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   202
        return element.appendChild(getSoapDocument().getDomNode(newChild));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   203
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   204
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   205
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   206
    public boolean hasChildNodes() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   207
        return element.hasChildNodes();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   208
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   209
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   210
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   211
    public Node cloneNode(boolean deep) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   212
        return element.cloneNode(deep);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   213
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   214
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   215
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   216
    public void normalize() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   217
        element.normalize();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   218
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   219
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   220
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   221
    public boolean isSupported(String feature, String version) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   222
        return element.isSupported(feature, version);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   223
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   224
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   225
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   226
    public String getNamespaceURI() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   227
        return element.getNamespaceURI();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   228
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   229
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   230
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   231
    public String getPrefix() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   232
        return element.getPrefix();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   233
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   234
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   235
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   236
    public void setPrefix(String prefix) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   237
        element.setPrefix(prefix);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   238
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   239
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   240
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   241
    public String getLocalName() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   242
        return element.getLocalName();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   243
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   244
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   245
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   246
    public boolean hasAttributes() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   247
        return element.hasAttributes();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   248
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   249
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   250
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   251
    public String getBaseURI() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   252
        return element.getBaseURI();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   253
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   254
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   255
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   256
    public short compareDocumentPosition(Node other) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   257
        return element.compareDocumentPosition(other);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   258
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   259
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   260
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   261
    public String getTextContent() throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   262
        return element.getTextContent();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   263
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   264
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   265
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   266
    public void setTextContent(String textContent) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   267
        element.setTextContent(textContent);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   268
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   269
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   270
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   271
    public boolean isSameNode(Node other) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   272
        return element.isSameNode(other);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   273
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   274
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   275
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   276
    public String lookupPrefix(String namespaceURI) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   277
        return element.lookupPrefix(namespaceURI);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   278
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   279
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   280
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   281
    public boolean isDefaultNamespace(String namespaceURI) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   282
        return element.isDefaultNamespace(namespaceURI);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   283
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   284
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   285
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   286
    public String lookupNamespaceURI(String prefix) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   287
        return element.lookupNamespaceURI(prefix);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   288
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   289
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   290
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   291
    public boolean isEqualNode(Node arg) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   292
        return element.isEqualNode(arg);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   293
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   294
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   295
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   296
    public Object getFeature(String feature, String version) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   297
        return element.getFeature(feature, version);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   298
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   299
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   300
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   301
    public Object setUserData(String key, Object data, UserDataHandler handler) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   302
        return element.setUserData(key, data, handler);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   303
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   304
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   305
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   306
    public Object getUserData(String key) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   307
        return element.getUserData(key);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   308
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   309
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   310
    public SOAPElement addChildElement(Name name) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   311
        return  addElement(name);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   312
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   313
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   314
    public SOAPElement addChildElement(QName qname) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   315
        return  addElement(qname);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   316
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   317
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   318
    public SOAPElement addChildElement(String localName) throws SOAPException {
43126
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   319
        String nsUri = getNamespaceURI("");
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   320
        Name name = (nsUri == null || nsUri.isEmpty())
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   321
                ?  NameImpl.createFromUnqualifiedName(localName)
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   322
                :  NameImpl.createFromQualifiedName(localName, nsUri);
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   323
        return addChildElement(name);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   324
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   325
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   326
    public SOAPElement addChildElement(String localName, String prefix)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   327
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   328
        String uri = getNamespaceURI(prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   329
        if (uri == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   330
            log.log(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   331
                Level.SEVERE,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   332
                "SAAJ0101.impl.parent.of.body.elem.mustbe.body",
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   333
                new String[] { prefix });
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   334
            throw new SOAPExceptionImpl(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   335
                "Unable to locate namespace for prefix " + prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   336
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   337
        return addChildElement(localName, prefix, uri);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   338
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   339
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   340
    public String getNamespaceURI(String prefix) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   341
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   342
        if ("xmlns".equals(prefix)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   343
            return XMLNS_URI;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   344
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   345
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   346
        if("xml".equals(prefix)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   347
            return XML_URI;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   348
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   349
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   350
        if ("".equals(prefix)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   351
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   352
            org.w3c.dom.Node currentAncestor = this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   353
            while (currentAncestor != null &&
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   354
                   !(currentAncestor instanceof Document)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   355
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   356
                if (currentAncestor instanceof ElementImpl) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   357
                    /*
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   358
                    QName name = ((ElementImpl) currentAncestor).getElementQName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   359
                    if (prefix.equals(name.getPrefix())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   360
                        String uri = name.getNamespaceURI();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   361
                        if ("".equals(uri)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   362
                            return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   363
                        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   364
                        else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   365
                            return uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   366
                        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   367
                    }*/
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   368
                    if (((Element) currentAncestor).hasAttributeNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   369
                            XMLNS_URI, "xmlns")) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   370
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   371
                        String uri =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   372
                            ((Element) currentAncestor).getAttributeNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   373
                                XMLNS_URI, "xmlns");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   374
                        if ("".equals(uri))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   375
                            return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   376
                        else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   377
                            return uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   378
                        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   379
                    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   380
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   381
                currentAncestor = currentAncestor.getParentNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   382
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   383
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   384
        } else if (prefix != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   385
            // Find if there's an ancester whose name contains this prefix
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   386
            org.w3c.dom.Node currentAncestor = this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   387
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   388
//            String uri = currentAncestor.lookupNamespaceURI(prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   389
//            return uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   390
            while (currentAncestor != null &&
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   391
                   !(currentAncestor instanceof Document)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   392
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   393
               /* if (prefix.equals(currentAncestor.getPrefix())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   394
                    String uri = currentAncestor.getNamespaceURI();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   395
                    // this is because the javadoc says getNamespaceURI() is not a computed value
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   396
                    // and URI for a non-empty prefix cannot be null
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   397
                    if (uri != null)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   398
                        return uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   399
                }*/
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   400
                //String uri = currentAncestor.lookupNamespaceURI(prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   401
                //if (uri != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   402
                //    return uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   403
                //}
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   404
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   405
                if (((Element) currentAncestor).hasAttributeNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   406
                        XMLNS_URI, prefix)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   407
                    return ((Element) currentAncestor).getAttributeNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   408
                               XMLNS_URI, prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   409
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   410
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   411
                currentAncestor = currentAncestor.getParentNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   412
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   413
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   414
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   415
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   416
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   417
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   418
    public SOAPElement setElementQName(QName newName) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   419
        ElementImpl copy =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   420
            new ElementImpl((SOAPDocumentImpl) getOwnerDocument(), newName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   421
        return replaceElementWithSOAPElement(this,copy);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   422
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   423
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   424
    public QName createQName(String localName, String prefix)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   425
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   426
        String uri = getNamespaceURI(prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   427
        if (uri == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   428
            log.log(Level.SEVERE, "SAAJ0102.impl.cannot.locate.ns",
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   429
                    new Object[] {prefix});
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   430
            throw new SOAPException("Unable to locate namespace for prefix "
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   431
                                    + prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   432
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   433
        return new QName(uri, localName, prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   434
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   435
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   436
    public String getNamespacePrefix(String uri) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   437
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   438
        NamespaceContextIterator eachNamespace = getNamespaceContextNodes();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   439
        while (eachNamespace.hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   440
            org.w3c.dom.Attr namespaceDecl = eachNamespace.nextNamespaceAttr();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   441
            if (namespaceDecl.getNodeValue().equals(uri)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   442
                String candidatePrefix = namespaceDecl.getLocalName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   443
                if ("xmlns".equals(candidatePrefix))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   444
                    return "";
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   445
                else
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   446
                    return candidatePrefix;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   447
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   448
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   449
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   450
        // Find if any of the ancestors' name has this uri
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   451
        org.w3c.dom.Node currentAncestor = this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   452
        while (currentAncestor != null &&
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   453
               !(currentAncestor instanceof Document)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   454
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   455
            if (uri.equals(currentAncestor.getNamespaceURI()))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   456
                return currentAncestor.getPrefix();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   457
            currentAncestor = currentAncestor.getParentNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   458
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   459
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   460
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   461
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   462
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   463
    protected org.w3c.dom.Attr getNamespaceAttr(String prefix) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   464
        NamespaceContextIterator eachNamespace = getNamespaceContextNodes();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   465
        if (!"".equals(prefix))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   466
            prefix = ":"+prefix;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   467
        while (eachNamespace.hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   468
            org.w3c.dom.Attr namespaceDecl = eachNamespace.nextNamespaceAttr();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   469
            if (!"".equals(prefix)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   470
                if (namespaceDecl.getNodeName().endsWith(prefix))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   471
                    return namespaceDecl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   472
            } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   473
                if (namespaceDecl.getNodeName().equals("xmlns"))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   474
                    return namespaceDecl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   475
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   476
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   477
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   478
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   479
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   480
    public NamespaceContextIterator getNamespaceContextNodes() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   481
        return getNamespaceContextNodes(true);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   482
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   483
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   484
    public NamespaceContextIterator getNamespaceContextNodes(boolean traverseStack) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   485
        return new NamespaceContextIterator(this, traverseStack);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   486
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   487
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   488
    public SOAPElement addChildElement(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   489
        String localName,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   490
        String prefix,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   491
        String uri)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   492
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   493
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   494
        SOAPElement newElement = createElement(NameImpl.create(localName, prefix, uri));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   495
        addNode(newElement);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   496
        return convertToSoapElement(newElement);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   497
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   498
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   499
    public SOAPElement addChildElement(SOAPElement element)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   500
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   501
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   502
        // check if Element falls in SOAP 1.1 or 1.2 namespace.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   503
        String elementURI = element.getElementName().getURI();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   504
        String localName = element.getLocalName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   505
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   506
        if ((SOAPConstants.URI_NS_SOAP_ENVELOPE).equals(elementURI)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   507
            || (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE).equals(elementURI)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   508
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   509
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   510
            if ("Envelope".equalsIgnoreCase(localName) ||
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   511
                "Header".equalsIgnoreCase(localName) || "Body".equalsIgnoreCase(localName)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   512
                log.severe("SAAJ0103.impl.cannot.add.fragements");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   513
                throw new SOAPExceptionImpl(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   514
                    "Cannot add fragments which contain elements "
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   515
                        + "which are in the SOAP namespace");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   516
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   517
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   518
            if ("Fault".equalsIgnoreCase(localName) && !"Body".equalsIgnoreCase(this.getLocalName())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   519
                log.severe("SAAJ0154.impl.adding.fault.to.nonbody");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   520
                throw new SOAPExceptionImpl("Cannot add a SOAPFault as a child of " + this.getLocalName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   521
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   522
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   523
            if ("Detail".equalsIgnoreCase(localName) && !"Fault".equalsIgnoreCase(this.getLocalName())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   524
                log.severe("SAAJ0155.impl.adding.detail.nonfault");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   525
                throw new SOAPExceptionImpl("Cannot add a Detail as a child of " + this.getLocalName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   526
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   527
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   528
            if ("Fault".equalsIgnoreCase(localName)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   529
               // if body is not empty throw an exception
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   530
               if (!elementURI.equals(this.getElementName().getURI())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   531
                   log.severe("SAAJ0158.impl.version.mismatch.fault");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   532
                   throw new SOAPExceptionImpl("SOAP Version mismatch encountered when trying to add SOAPFault to SOAPBody");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   533
               }
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   534
               Iterator<Node> it = this.getChildElements();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   535
               if (it.hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   536
                   log.severe("SAAJ0156.impl.adding.fault.error");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   537
                   throw new SOAPExceptionImpl("Cannot add SOAPFault as a child of a non-Empty SOAPBody");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   538
               }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   539
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   540
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   541
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   542
        // preserve the encodingStyle attr as it may get lost in the import
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   543
        String encodingStyle = element.getEncodingStyle();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   544
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   545
        final Element domElement = ((ElementImpl) element).getDomElement();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   546
        final Element importedElement = importElement(domElement);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   547
        addNode(importedElement);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   548
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   549
        final SOAPElement converted = convertToSoapElement(importedElement);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   550
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   551
        if (encodingStyle != null)
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   552
            converted.setEncodingStyle(encodingStyle);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   553
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   554
        return converted;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   555
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   556
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   557
    protected Element importElement(Element element) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   558
        Document document = getOwnerDocument();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   559
        Document oldDocument = element.getOwnerDocument();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   560
        if (!oldDocument.equals(document)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   561
            return (Element) document.importNode(element, true);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   562
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   563
            return element;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   564
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   565
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   566
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   567
    protected SOAPElement addElement(Name name) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   568
        SOAPElement newElement = createElement(name);
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   569
        addNode(((ElementImpl) newElement).getDomElement());
43126
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   570
        return newElement;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   571
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   572
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   573
    protected SOAPElement addElement(QName name) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   574
        SOAPElement newElement = createElement(name);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   575
        addNode(newElement);
43126
26c4004e8cc0 8159058: SAXParseException when sending soap message
aefimov
parents: 33547
diff changeset
   576
        return newElement;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   577
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   578
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   579
    protected SOAPElement createElement(Name name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   580
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   581
        if (isNamespaceQualified(name)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   582
            return (SOAPElement)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   583
                getOwnerDocument().createElementNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   584
                                       name.getURI(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   585
                                       name.getQualifiedName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   586
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   587
            return (SOAPElement)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   588
                getOwnerDocument().createElement(name.getQualifiedName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   589
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   590
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   591
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   592
    protected SOAPElement createElement(QName name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   593
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   594
        if (isNamespaceQualified(name)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   595
            return (SOAPElement)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   596
                getOwnerDocument().createElementNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   597
                                       name.getNamespaceURI(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   598
                                       getQualifiedName(name));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   599
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   600
            return (SOAPElement)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   601
                getOwnerDocument().createElement(getQualifiedName(name));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   602
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   603
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   604
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   605
    protected void addNode(org.w3c.dom.Node newElement) throws SOAPException {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   606
        insertBefore(getSoapDocument().getDomNode(newElement), null);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   607
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   608
        if (getOwnerDocument() instanceof DocumentFragment)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   609
            return;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   610
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   611
        if (newElement instanceof ElementImpl) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   612
            ElementImpl element = (ElementImpl) newElement;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   613
            QName elementName = element.getElementQName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   614
            if (!"".equals(elementName.getNamespaceURI())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   615
                element.ensureNamespaceIsDeclared(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   616
                    elementName.getPrefix(), elementName.getNamespaceURI());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   617
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   618
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   619
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   620
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   621
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   622
    Element getFirstChildElement() {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   623
        Node child = getFirstChild();
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   624
        while (child != null) {
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   625
            if (child instanceof Element) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   626
                return (Element) getSoapDocument().find(child);
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   627
            }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   628
            child = child.getNextSibling();
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   629
        }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   630
        return null;
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   631
    }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   632
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   633
    protected SOAPElement findChild(NameImpl name) {
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   634
        Node eachChild = getFirstChild();
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   635
        while (eachChild != null) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   636
            if (eachChild instanceof Element) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   637
                SOAPElement eachChildSoap = (SOAPElement) getSoapDocument().find(eachChild);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   638
                if (eachChildSoap != null) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   639
                    if (eachChildSoap.getElementName().equals(name)) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   640
                        return eachChildSoap;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   641
                    }
23782
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   642
                }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   643
            }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   644
            eachChild = eachChild.getNextSibling();
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   645
        }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   646
        return null;
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   647
    }
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   648
953bfc3fbe31 8036030: Update JAX-WS RI integration to latest version
mkos
parents: 22679
diff changeset
   649
    protected SOAPElement findAndConvertChildElement(NameImpl name) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   650
        Iterator<Node> eachChild = getChildElementNodes();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   651
        while (eachChild.hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   652
            SOAPElement child = (SOAPElement) eachChild.next();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   653
            if (child.getElementName().equals(name)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   654
                return child;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   655
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   656
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   657
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   658
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   659
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   660
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   661
    public SOAPElement addTextNode(String text) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   662
        if (text.startsWith(CDATAImpl.cdataUC)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   663
            || text.startsWith(CDATAImpl.cdataLC))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   664
            return addCDATA(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   665
                text.substring(CDATAImpl.cdataUC.length(), text.length() - 3));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   666
        return addText(text);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   667
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   668
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   669
    protected SOAPElement addCDATA(String text) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   670
        org.w3c.dom.Text cdata =
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   671
                getOwnerDocument().createCDATASection(text);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   672
        addNode(cdata);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   673
        return this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   674
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   675
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   676
    protected SOAPElement addText(String text) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   677
        org.w3c.dom.Text textNode =
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   678
                getOwnerDocument().createTextNode(text);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   679
        addNode(textNode);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   680
        return this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   681
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   682
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   683
    public SOAPElement addAttribute(Name name, String value)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   684
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   685
        addAttributeBare(name, value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   686
        if (!"".equals(name.getURI())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   687
            ensureNamespaceIsDeclared(name.getPrefix(), name.getURI());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   688
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   689
        return this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   690
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   691
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   692
    public SOAPElement addAttribute(QName qname, String value)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   693
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   694
        addAttributeBare(qname, value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   695
        if (!"".equals(qname.getNamespaceURI())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   696
            ensureNamespaceIsDeclared(qname.getPrefix(), qname.getNamespaceURI());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   697
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   698
        return this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   699
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   700
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   701
    private void addAttributeBare(Name name, String value) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   702
        addAttributeBare(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   703
            name.getURI(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   704
            name.getPrefix(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   705
            name.getQualifiedName(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   706
            value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   707
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   708
    private void addAttributeBare(QName name, String value) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   709
        addAttributeBare(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   710
            name.getNamespaceURI(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   711
            name.getPrefix(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   712
            getQualifiedName(name),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   713
            value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   714
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   715
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   716
    private void addAttributeBare(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   717
        String uri,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   718
        String prefix,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   719
        String qualifiedName,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   720
        String value) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   721
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   722
        uri = uri.length() == 0 ? null : uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   723
        if (qualifiedName.equals("xmlns")) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   724
            uri = XMLNS_URI;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   725
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   726
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   727
        if (uri == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   728
            setAttribute(qualifiedName, value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   729
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   730
            setAttributeNS(uri, qualifiedName, value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   731
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   732
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   733
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   734
    public SOAPElement addNamespaceDeclaration(String prefix, String uri)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   735
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   736
        if (prefix.length() > 0) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   737
            setAttributeNS(XMLNS_URI, "xmlns:" + prefix, uri);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   738
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   739
            setAttributeNS(XMLNS_URI, "xmlns", uri);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   740
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   741
        //Fix for CR:6474641
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   742
        //tryToFindEncodingStyleAttributeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   743
        return this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   744
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   745
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   746
    public String getAttributeValue(Name name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   747
        return getAttributeValueFrom(this, name);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   748
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   749
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   750
    public String getAttributeValue(QName qname) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   751
        return getAttributeValueFrom(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   752
                   this,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   753
                   qname.getNamespaceURI(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   754
                   qname.getLocalPart(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   755
                   qname.getPrefix(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   756
                   getQualifiedName(qname));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   757
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   758
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   759
    public Iterator getAllAttributes() {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   760
        Iterator<Name> i = getAllAttributesFrom(this);
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   761
        ArrayList<Name> list = new ArrayList<Name>();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   762
        while (i.hasNext()) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   763
            Name name = i.next();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   764
            if (!"xmlns".equalsIgnoreCase(name.getPrefix()))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   765
                list.add(name);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   766
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   767
        return list.iterator();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   768
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   769
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   770
    public Iterator getAllAttributesAsQNames() {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   771
        Iterator<Name> i = getAllAttributesFrom(this);
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   772
        ArrayList<QName> list = new ArrayList<QName>();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   773
        while (i.hasNext()) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   774
            Name name = i.next();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   775
            if (!"xmlns".equalsIgnoreCase(name.getPrefix())) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   776
                list.add(NameImpl.convertToQName(name));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   777
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   778
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   779
        return list.iterator();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   780
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   781
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   782
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   783
    public Iterator getNamespacePrefixes() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   784
        return doGetNamespacePrefixes(false);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   785
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   786
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   787
    public Iterator getVisibleNamespacePrefixes() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   788
        return doGetNamespacePrefixes(true);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   789
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   790
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   791
    protected Iterator<String> doGetNamespacePrefixes(final boolean deep) {
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   792
        return new Iterator<String>() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   793
            String next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   794
            String last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   795
            NamespaceContextIterator eachNamespace =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   796
                getNamespaceContextNodes(deep);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   797
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   798
            void findNext() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   799
                while (next == null && eachNamespace.hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   800
                    String attributeKey =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   801
                        eachNamespace.nextNamespaceAttr().getNodeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   802
                    if (attributeKey.startsWith("xmlns:")) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   803
                        next = attributeKey.substring("xmlns:".length());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   804
                    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   805
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   806
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   807
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   808
            public boolean hasNext() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   809
                findNext();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   810
                return next != null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   811
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   812
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   813
            public String next() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   814
                findNext();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   815
                if (next == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   816
                    throw new NoSuchElementException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   817
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   818
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   819
                last = next;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   820
                next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   821
                return last;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   822
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   823
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   824
            public void remove() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   825
                if (last == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   826
                    throw new IllegalStateException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   827
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   828
                eachNamespace.remove();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   829
                next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   830
                last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   831
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   832
        };
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   833
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   834
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   835
    public Name getElementName() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   836
        return NameImpl.convertToName(elementQName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   837
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   838
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   839
    public QName getElementQName() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   840
        return elementQName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   841
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   842
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   843
    public boolean removeAttribute(Name name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   844
        return removeAttribute(name.getURI(), name.getLocalName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   845
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   846
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   847
    public boolean removeAttribute(QName name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   848
        return removeAttribute(name.getNamespaceURI(), name.getLocalPart());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   849
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   850
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   851
    private boolean removeAttribute(String uri, String localName) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   852
        String nonzeroLengthUri =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   853
            (uri == null || uri.length() == 0) ? null : uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   854
        org.w3c.dom.Attr attribute =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   855
            getAttributeNodeNS(nonzeroLengthUri, localName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   856
        if (attribute == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   857
            return false;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   858
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   859
        removeAttributeNode(attribute);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   860
        return true;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   861
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   862
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   863
    public boolean removeNamespaceDeclaration(String prefix) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   864
        org.w3c.dom.Attr declaration = getNamespaceAttr(prefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   865
        if (declaration == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   866
            return false;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   867
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   868
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   869
            removeAttributeNode(declaration);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   870
        } catch (DOMException de) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   871
            // ignore
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   872
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   873
        return true;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   874
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   875
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   876
    public Iterator<Node> getChildElements() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   877
        return getChildElementsFrom(this);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   878
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   879
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   880
    protected SOAPElement convertToSoapElement(Element element) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   881
        final Node soapNode = getSoapDocument().findIfPresent(element);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   882
        if (soapNode instanceof SOAPElement) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   883
            return (SOAPElement) soapNode;
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   884
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   885
            return replaceElementWithSOAPElement(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   886
                element,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   887
                (ElementImpl) createElement(NameImpl.copyElementName(element)));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   888
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   889
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   890
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   891
    protected SOAPElement replaceElementWithSOAPElement(
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   892
        Element element,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   893
        ElementImpl copy) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   894
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   895
        Iterator<Name> eachAttribute = getAllAttributesFrom(element);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   896
        while (eachAttribute.hasNext()) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   897
            Name name = eachAttribute.next();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   898
            copy.addAttributeBare(name, getAttributeValueFrom(element, name));
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   899
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   900
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   901
        Iterator<Node> eachChild = getChildElementsFrom(element);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   902
        while (eachChild.hasNext()) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   903
            Node nextChild = eachChild.next();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   904
            copy.insertBefore(nextChild, null);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   905
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   906
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   907
        Node parent = getSoapDocument().find(element.getParentNode());
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   908
        if (parent != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   909
            parent.replaceChild(copy, element);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   910
        } // XXX else throw an exception?
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   911
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   912
        return copy;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   913
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   914
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   915
    protected Iterator<Node> getChildElementNodes() {
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   916
        return new Iterator<Node>() {
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   917
            Iterator<Node> eachNode = getChildElements();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   918
            Node next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   919
            Node last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   920
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   921
            public boolean hasNext() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   922
                if (next == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   923
                    while (eachNode.hasNext()) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   924
                        Node node = eachNode.next();
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   925
                        if (node instanceof Element) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
   926
                            next = getSoapDocument().findIfPresent(node);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   927
                            break;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   928
                        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   929
                    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   930
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   931
                return next != null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   932
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   933
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   934
            public Node next() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   935
                if (hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   936
                    last = next;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   937
                    next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   938
                    return last;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   939
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   940
                throw new NoSuchElementException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   941
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   942
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   943
            public void remove() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   944
                if (last == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   945
                    throw new IllegalStateException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   946
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   947
                Node target = last;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   948
                last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   949
                removeChild(target);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   950
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   951
        };
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   952
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   953
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   954
    public Iterator getChildElements(final Name name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   955
       return getChildElements(name.getURI(), name.getLocalName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   956
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   957
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   958
    public Iterator getChildElements(final QName qname) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   959
        return getChildElements(qname.getNamespaceURI(), qname.getLocalPart());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   960
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   961
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   962
    private Iterator<Node> getChildElements(final String nameUri, final String nameLocal) {
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   963
        return new Iterator<Node>() {
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   964
            Iterator<Node> eachElement = getChildElementNodes();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   965
            Node next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   966
            Node last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   967
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   968
            public boolean hasNext() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   969
                if (next == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   970
                    while (eachElement.hasNext()) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   971
                        Node element = eachElement.next();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   972
                        String elementUri = element.getNamespaceURI();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   973
                        elementUri = elementUri == null ? "" : elementUri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   974
                        String elementName = element.getLocalName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   975
                        if (elementUri.equals(nameUri)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   976
                            && elementName.equals(nameLocal)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   977
                            next = element;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   978
                            break;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   979
                        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   980
                    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   981
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   982
                return next != null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   983
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   984
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
   985
            public Node next() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   986
                if (!hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   987
                    throw new NoSuchElementException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   988
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   989
                last = next;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   990
                next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   991
                return last;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   992
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   993
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   994
            public void remove() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   995
                if (last == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   996
                    throw new IllegalStateException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   997
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   998
                Node target = last;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
   999
                last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1000
                removeChild(target);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1001
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1002
        };
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1003
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1004
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1005
    public void removeContents() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1006
        Node currentChild = getFirstChild();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1007
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1008
        while (currentChild != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1009
            Node temp = currentChild.getNextSibling();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1010
            if (currentChild instanceof javax.xml.soap.Node) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1011
                ((javax.xml.soap.Node) currentChild).detachNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1012
            } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1013
                Node parent = currentChild.getParentNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1014
                if (parent != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1015
                    parent.removeChild(currentChild);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1016
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1017
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1018
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1019
            currentChild = temp;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1020
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1021
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1022
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1023
    public void setEncodingStyle(String encodingStyle) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1024
        if (!"".equals(encodingStyle)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1025
            try {
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
  1026
                new URI(encodingStyle);
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
  1027
            } catch (URISyntaxException m) {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1028
                log.log(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1029
                    Level.SEVERE,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1030
                    "SAAJ0105.impl.encoding.style.mustbe.valid.URI",
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1031
                    new String[] { encodingStyle });
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1032
                throw new IllegalArgumentException(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1033
                    "Encoding style (" + encodingStyle + ") should be a valid URI");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1034
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1035
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1036
        encodingStyleAttribute.setValue(encodingStyle);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1037
        tryToFindEncodingStyleAttributeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1038
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1039
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1040
    public String getEncodingStyle() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1041
        String encodingStyle = encodingStyleAttribute.getValue();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1042
        if (encodingStyle != null)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1043
            return encodingStyle;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1044
        String soapNamespace = getSOAPNamespace();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1045
        if (soapNamespace != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1046
            Attr attr = getAttributeNodeNS(soapNamespace, "encodingStyle");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1047
            if (attr != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1048
                encodingStyle = attr.getValue();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1049
                try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1050
                    setEncodingStyle(encodingStyle);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1051
                } catch (SOAPException se) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1052
                    // has to be ignored
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1053
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1054
                return encodingStyle;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1055
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1056
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1057
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1058
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1059
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1060
    // Node methods
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1061
    public String getValue() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1062
        javax.xml.soap.Node valueNode = getValueNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1063
        return valueNode == null ? null : valueNode.getValue();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1064
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1065
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1066
    public void setValue(String value) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1067
        Node valueNode = getValueNodeStrict();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1068
        if (valueNode != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1069
            valueNode.setNodeValue(value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1070
        } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1071
            try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1072
                addTextNode(value);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1073
            } catch (SOAPException e) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1074
                throw new RuntimeException(e.getMessage());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1075
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1076
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1077
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1078
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1079
    protected Node getValueNodeStrict() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1080
        Node node = getFirstChild();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1081
        if (node != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1082
            if (node.getNextSibling() == null
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1083
                && node.getNodeType() == org.w3c.dom.Node.TEXT_NODE) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1084
                return node;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1085
            } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1086
                log.severe("SAAJ0107.impl.elem.child.not.single.text");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1087
                throw new IllegalStateException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1088
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1089
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1090
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1091
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1092
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1093
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1094
    protected javax.xml.soap.Node getValueNode() {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
  1095
        Iterator<Node> i = getChildElements();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1096
        while (i.hasNext()) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1097
            Node n = i.next();
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1098
            if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE ||
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1099
                n.getNodeType() == org.w3c.dom.Node.CDATA_SECTION_NODE) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1100
                // TODO: Hack to fix text node split into multiple lines.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1101
                normalize();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1102
                // Should remove the normalization step when this gets fixed in
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1103
                // DOM/Xerces.
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1104
                return getSoapDocument().find(n);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1105
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1106
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1107
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1108
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1109
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1110
    public void setParentElement(SOAPElement element) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1111
        if (element == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1112
            log.severe("SAAJ0106.impl.no.null.to.parent.elem");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1113
            throw new SOAPException("Cannot pass NULL to setParentElement");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1114
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1115
        element.addChildElement(this);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1116
        findEncodingStyleAttributeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1117
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1118
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1119
    protected void findEncodingStyleAttributeName() throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1120
        String soapNamespace = getSOAPNamespace();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1121
        if (soapNamespace != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1122
            String soapNamespacePrefix = getNamespacePrefix(soapNamespace);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1123
            if (soapNamespacePrefix != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1124
                setEncodingStyleNamespace(soapNamespace, soapNamespacePrefix);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1125
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1126
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1127
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1128
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1129
    protected void setEncodingStyleNamespace(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1130
        String soapNamespace,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1131
        String soapNamespacePrefix)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1132
        throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1133
        Name encodingStyleAttributeName =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1134
            NameImpl.create(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1135
                "encodingStyle",
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1136
                soapNamespacePrefix,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1137
                soapNamespace);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1138
        encodingStyleAttribute.setName(encodingStyleAttributeName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1139
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1140
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1141
    public SOAPElement getParentElement() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1142
        Node parentNode = getParentNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1143
        if (parentNode instanceof SOAPDocument) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1144
            return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1145
        }
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1146
        return (SOAPElement) getSoapDocument().find(parentNode);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1147
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1148
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1149
    protected String getSOAPNamespace() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1150
        String soapNamespace = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1151
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1152
        SOAPElement antecedent = this;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1153
        while (antecedent != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1154
            Name antecedentName = antecedent.getElementName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1155
            String antecedentNamespace = antecedentName.getURI();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1156
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1157
            if (NameImpl.SOAP11_NAMESPACE.equals(antecedentNamespace)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1158
                || NameImpl.SOAP12_NAMESPACE.equals(antecedentNamespace)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1159
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1160
                soapNamespace = antecedentNamespace;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1161
                break;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1162
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1163
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1164
            antecedent = antecedent.getParentElement();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1165
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1166
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1167
        return soapNamespace;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1168
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1169
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1170
    public void detachNode() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1171
        Node parent = getParentNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1172
        if (parent != null) {
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1173
            parent.removeChild(element);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1174
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1175
        encodingStyleAttribute.clearNameAndValue();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1176
        // Fix for CR: 6474641
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1177
        //tryToFindEncodingStyleAttributeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1178
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1179
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1180
    public void tryToFindEncodingStyleAttributeName() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1181
        try {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1182
            findEncodingStyleAttributeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1183
        } catch (SOAPException e) { /*okay to fail*/
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1184
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1185
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1186
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1187
    public void recycleNode() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1188
        detachNode();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1189
        // TBD
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1190
        //  - add this to the factory so subsequent
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1191
        //    creations can reuse this object.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1192
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1193
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1194
    class AttributeManager {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1195
        Name attributeName = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1196
        String attributeValue = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1197
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1198
        public void setName(Name newName) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1199
            clearAttribute();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1200
            attributeName = newName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1201
            reconcileAttribute();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1202
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1203
        public void clearName() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1204
            clearAttribute();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1205
            attributeName = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1206
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1207
        public void setValue(String value) throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1208
            attributeValue = value;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1209
            reconcileAttribute();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1210
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1211
        public Name getName() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1212
            return attributeName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1213
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1214
        public String getValue() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1215
            return attributeValue;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1216
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1217
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1218
        /** Note: to be used only in detachNode method */
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1219
        public void clearNameAndValue() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1220
            attributeName = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1221
            attributeValue = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1222
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1223
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1224
        private void reconcileAttribute() throws SOAPException {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1225
            if (attributeName != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1226
                removeAttribute(attributeName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1227
                if (attributeValue != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1228
                    addAttribute(attributeName, attributeValue);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1229
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1230
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1231
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1232
        private void clearAttribute() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1233
            if (attributeName != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1234
                removeAttribute(attributeName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1235
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1236
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1237
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1238
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1239
    protected static org.w3c.dom.Attr getNamespaceAttrFrom(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1240
        Element element,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1241
        String prefix) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1242
        NamespaceContextIterator eachNamespace =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1243
            new NamespaceContextIterator(element);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1244
        while (eachNamespace.hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1245
            org.w3c.dom.Attr namespaceDecl = eachNamespace.nextNamespaceAttr();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1246
            String declaredPrefix =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1247
                NameImpl.getLocalNameFromTagName(namespaceDecl.getNodeName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1248
            if (declaredPrefix.equals(prefix)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1249
                return namespaceDecl;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1250
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1251
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1252
        return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1253
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1254
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
  1255
    protected static Iterator<Name> getAllAttributesFrom(final Element element) {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1256
        final NamedNodeMap attributes = element.getAttributes();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1257
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
  1258
        return new Iterator<Name>() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1259
            int attributesLength = attributes.getLength();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1260
            int attributeIndex = 0;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1261
            String currentName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1262
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1263
            public boolean hasNext() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1264
                return attributeIndex < attributesLength;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1265
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1266
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
  1267
            public Name next() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1268
                if (!hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1269
                    throw new NoSuchElementException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1270
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1271
                Node current = attributes.item(attributeIndex++);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1272
                currentName = current.getNodeName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1273
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1274
                String prefix = NameImpl.getPrefixFromTagName(currentName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1275
                if (prefix.length() == 0) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1276
                    return NameImpl.createFromUnqualifiedName(currentName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1277
                } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1278
                    Name attributeName =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1279
                        NameImpl.createFromQualifiedName(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1280
                            currentName,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1281
                            current.getNamespaceURI());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1282
                    return attributeName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1283
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1284
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1285
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1286
            public void remove() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1287
                if (currentName == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1288
                    throw new IllegalStateException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1289
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1290
                attributes.removeNamedItem(currentName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1291
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1292
        };
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1293
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1294
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1295
    protected static String getAttributeValueFrom(Element element, Name name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1296
      return getAttributeValueFrom(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1297
          element,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1298
          name.getURI(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1299
          name.getLocalName(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1300
          name.getPrefix(),
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1301
          name.getQualifiedName());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1302
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1303
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1304
    private static String getAttributeValueFrom(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1305
        Element element,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1306
        String uri,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1307
        String localName,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1308
        String prefix,
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1309
        String qualifiedName) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1310
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1311
        String nonzeroLengthUri =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1312
            (uri == null || uri.length() == 0) ? null : uri;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1313
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1314
        boolean mustUseGetAttributeNodeNS =  (nonzeroLengthUri != null);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1315
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1316
        if (mustUseGetAttributeNodeNS) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1317
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1318
            if (!element.hasAttributeNS(uri, localName)) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1319
                return null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1320
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1321
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1322
            String attrValue =
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1323
                element.getAttributeNS(nonzeroLengthUri, localName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1324
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1325
            return attrValue;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1326
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1327
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1328
        Attr attribute = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1329
        attribute = element.getAttributeNode(qualifiedName);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1330
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1331
        return attribute == null ? null : attribute.getValue();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1332
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1333
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1334
    protected Iterator<Node> getChildElementsFrom(final Element element) {
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
  1335
        return new Iterator<Node>() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1336
            Node next = element.getFirstChild();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1337
            Node nextNext = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1338
            Node last = null;
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1339
            Node soapElement = getSoapDocument().findIfPresent(element);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1340
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1341
            public boolean hasNext() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1342
                if (next != null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1343
                    return true;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1344
                }
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1345
                if (nextNext != null) {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1346
                    next = nextNext;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1347
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1348
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1349
                return next != null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1350
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1351
33547
e4c76ac38b12 8139743: Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
mkos
parents: 28326
diff changeset
  1352
            public Node next() {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1353
                if (hasNext()) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1354
                    last = next;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1355
                    next = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1356
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1357
                    if ((soapElement instanceof ElementImpl)
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1358
                            && (last instanceof Element)) {
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1359
                        last =
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1360
                                ((ElementImpl) soapElement).convertToSoapElement(
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1361
                                        (Element) last);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1362
                    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1363
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1364
                    nextNext = last.getNextSibling();
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1365
                    return getSoapDocument().findIfPresent(last);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1366
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1367
                throw new NoSuchElementException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1368
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1369
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1370
            public void remove() {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1371
                if (last == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1372
                    throw new IllegalStateException();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1373
                }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1374
                Node target = last;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1375
                last = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1376
                element.removeChild(target);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1377
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1378
        };
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1379
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1380
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1381
    public static String getQualifiedName(QName name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1382
        String prefix = name.getPrefix();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1383
        String localName = name.getLocalPart();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1384
        String qualifiedName = null;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1385
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1386
            if (prefix != null && prefix.length() > 0) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1387
                qualifiedName = prefix + ":" + localName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1388
            } else {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1389
                qualifiedName = localName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1390
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1391
         return qualifiedName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1392
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1393
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1394
    public static String getLocalPart(String qualifiedName) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1395
        if (qualifiedName == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1396
            // Log
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1397
            throw new IllegalArgumentException("Cannot get local name for a \"null\" qualified name");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1398
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1399
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1400
        int index = qualifiedName.indexOf(':');
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1401
        if (index < 0)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1402
            return qualifiedName;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1403
        else
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1404
            return qualifiedName.substring(index + 1);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1405
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1406
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1407
    public static String getPrefix(String qualifiedName) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1408
        if (qualifiedName == null) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1409
            // Log
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1410
            throw new IllegalArgumentException("Cannot get prefix for a  \"null\" qualified name");
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1411
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1412
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1413
        int index = qualifiedName.indexOf(':');
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1414
        if (index < 0)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1415
            return "";
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1416
        else
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1417
            return qualifiedName.substring(0, index);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1418
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1419
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1420
    protected boolean isNamespaceQualified(Name name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1421
        return !"".equals(name.getURI());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1422
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1423
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1424
    protected boolean isNamespaceQualified(QName name) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1425
        return !"".equals(name.getNamespaceURI());
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1426
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1427
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1428
    //TODO: This is a temporary SAAJ workaround for optimizing XWS
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1429
    // should be removed once the corresponding JAXP bug is fixed
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1430
    // It appears the bug will be fixed in JAXP 1.4 (not by Appserver 9 timeframe)
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1431
    public void setAttributeNS(
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1432
        String namespaceURI,String qualifiedName, String value) {
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1433
        int index = qualifiedName.indexOf(':');
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
  1434
        String localName;
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
  1435
        if (index < 0)
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1436
            localName = qualifiedName;
16791
fe5141eabb0e 8010393: Update JAX-WS RI to 2.2.9-b12941
alanb
parents: 12009
diff changeset
  1437
        else
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1438
            localName = qualifiedName.substring(index + 1);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1439
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1440
        // Workaround for bug 6467808 - This needs to be fixed in JAXP
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1441
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1442
        // Rolling back this fix, this is a wrong fix, infact its causing other regressions in JAXWS tck and
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1443
        // other tests, because of this change the namespace declarations on soapenv:Fault element are never
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1444
        // picked up. The fix for bug 6467808 should be in JAXP.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1445
//        if(elementQName.getLocalPart().equals("Fault") &&
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1446
//                (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(value) ||
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1447
//                SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value)))
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1448
//            return;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1449
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1450
        element.setAttributeNS(namespaceURI,qualifiedName,value);
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1451
        //String tmpLocalName = this.getLocalName();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1452
        String tmpURI = this.getNamespaceURI();
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1453
        boolean isIDNS = false;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1454
        if( tmpURI != null && (tmpURI.equals(DSIG_NS) || tmpURI.equals(XENC_NS))){
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1455
            isIDNS = true;
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1456
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1457
        //No need to check for Signature/encryption element
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1458
        //just check for namespace.
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1459
        if(localName.equals("Id")){
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1460
            if(namespaceURI == null || namespaceURI.equals("")){
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1461
                setIdAttribute(localName,true);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1462
            }else if(isIDNS || WSU_NS.equals(namespaceURI)){
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1463
                setIdAttributeNS(namespaceURI,localName,true);
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1464
            }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1465
        }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1466
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1467
    }
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1468
43852
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1469
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1470
    public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1471
        element.removeAttributeNS(namespaceURI, localName);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1472
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1473
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1474
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1475
    public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1476
        return element.getAttributeNodeNS(namespaceURI, localName);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1477
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1478
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1479
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1480
    public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1481
        return element.setAttributeNodeNS(newAttr);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1482
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1483
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1484
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1485
    public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1486
        return new NodeListImpl(getSoapDocument(), element.getElementsByTagNameNS(namespaceURI, localName));
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1487
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1488
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1489
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1490
    public boolean hasAttribute(String name) {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1491
        return element.hasAttribute(name);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1492
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1493
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1494
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1495
    public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1496
        return element.hasAttributeNS(namespaceURI, localName);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1497
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1498
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1499
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1500
    public TypeInfo getSchemaTypeInfo() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1501
        return element.getSchemaTypeInfo();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1502
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1503
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1504
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1505
    public void setIdAttribute(String name, boolean isId) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1506
        element.setIdAttribute(name, isId);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1507
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1508
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1509
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1510
    public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1511
        element.setIdAttributeNS(namespaceURI, localName, isId);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1512
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1513
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1514
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1515
    public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1516
        element.setIdAttributeNode(idAttr, isId);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1517
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1518
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1519
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1520
    public String getNodeName() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1521
        return element.getNodeName();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1522
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1523
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1524
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1525
    public String getNodeValue() throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1526
        return element.getNodeValue();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1527
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1528
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1529
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1530
    public void setNodeValue(String nodeValue) throws DOMException {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1531
        element.setNodeValue(nodeValue);
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1532
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1533
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1534
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1535
    public short getNodeType() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1536
        return element.getNodeType();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1537
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1538
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1539
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1540
    public Node getParentNode() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1541
        return getSoapDocument().find(element.getParentNode());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1542
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1543
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1544
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1545
    public NodeList getChildNodes() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1546
        return new NodeListImpl(getSoapDocument(), element.getChildNodes());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1547
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1548
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1549
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1550
    public Node getFirstChild() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1551
        return getSoapDocument().findIfPresent(element.getFirstChild());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1552
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1553
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1554
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1555
    public Node getLastChild() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1556
        return getSoapDocument().findIfPresent(element.getLastChild());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1557
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1558
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1559
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1560
    public Node getPreviousSibling() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1561
        return getSoapDocument().findIfPresent(element.getPreviousSibling());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1562
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1563
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1564
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1565
    public Node getNextSibling() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1566
        return getSoapDocument().findIfPresent(element.getNextSibling());
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1567
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1568
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1569
    @Override
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1570
    public NamedNodeMap getAttributes() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1571
        return element.getAttributes();
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1572
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1573
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1574
    public Element getDomElement() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1575
        return element;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1576
    }
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1577
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1578
    public SOAPDocumentImpl getSoapDocument() {
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1579
        return soapDocument;
93a527059d8a 8174735: Update JAX-WS RI integration to latest version
aefimov
parents: 43126
diff changeset
  1580
    }
12009
4abb694f273a 7150322: Stop using drop source bundles in jaxws
ohair
parents:
diff changeset
  1581
}