src/share/jaxws_classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java

changeset 1377
1d5f442d50df
parent 1341
e5cc521294d8
child 1435
a90b319bae7a
equal deleted inserted replaced
1376:9153a257b264 1377:1d5f442d50df
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
45 protected abstract DetailEntry createDetailEntry(QName name); 45 protected abstract DetailEntry createDetailEntry(QName name);
46 46
47 public DetailEntry addDetailEntry(Name name) throws SOAPException { 47 public DetailEntry addDetailEntry(Name name) throws SOAPException {
48 DetailEntry entry = createDetailEntry(name); 48 DetailEntry entry = createDetailEntry(name);
49 addNode(entry); 49 addNode(entry);
50 return (DetailEntry) circumventBug5034339(entry); 50 return entry;
51 } 51 }
52 52
53 public DetailEntry addDetailEntry(QName qname) throws SOAPException { 53 public DetailEntry addDetailEntry(QName qname) throws SOAPException {
54 DetailEntry entry = createDetailEntry(qname); 54 DetailEntry entry = createDetailEntry(qname);
55 addNode(entry); 55 addNode(entry);
56 return (DetailEntry) circumventBug5034339(entry); 56 return entry;
57 } 57 }
58 58
59 protected SOAPElement addElement(Name name) throws SOAPException { 59 protected SOAPElement addElement(Name name) throws SOAPException {
60 return addDetailEntry(name); 60 return addDetailEntry(name);
61 } 61 }
117 117
118 protected boolean isStandardFaultElement() { 118 protected boolean isStandardFaultElement() {
119 return true; 119 return true;
120 } 120 }
121 121
122 //overriding this method since the only two uses of this method
123 // are in ElementImpl and DetailImpl
124 //whereas the original base impl does the correct job for calls to it inside ElementImpl
125 // But it would not work for DetailImpl.
126 protected SOAPElement circumventBug5034339(SOAPElement element) {
127
128 Name elementName = element.getElementName();
129 if (!isNamespaceQualified(elementName)) {
130 String prefix = elementName.getPrefix();
131 String defaultNamespace = getNamespaceURI(prefix);
132 if (defaultNamespace != null) {
133 Name newElementName =
134 NameImpl.create(
135 elementName.getLocalName(),
136 elementName.getPrefix(),
137 defaultNamespace);
138 SOAPElement newElement = createDetailEntry(newElementName);
139 replaceChild(newElement, element);
140 return newElement;
141 }
142 }
143 return element;
144 }
145
146 } 122 }

mercurial