Mon, 04 May 2009 21:10:41 -0700
6658158: Mutable statics in SAAJ (findbugs)
6658163: txw2.DatatypeWriter.BUILDIN is a mutable static (findbugs)
Reviewed-by: darcy
1 /*
2 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25 /*
26 *
27 */
31 /**
32 *
33 * @author SAAJ RI Development Team
34 */
35 package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
37 import java.util.logging.Level;
38 import java.util.logging.Logger;
40 import javax.xml.namespace.QName;
41 import javax.xml.soap.Name;
42 import javax.xml.soap.SOAPException;
43 import javax.xml.soap.SOAPElement;
45 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
46 import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderElementImpl;
47 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
48 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
50 public class HeaderElement1_1Impl extends HeaderElementImpl {
52 protected static final Logger log =
53 Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
54 "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
56 public HeaderElement1_1Impl(SOAPDocumentImpl ownerDoc, Name qname) {
57 super(ownerDoc, qname);
58 }
59 public HeaderElement1_1Impl(SOAPDocumentImpl ownerDoc, QName qname) {
60 super(ownerDoc, qname);
61 }
63 public SOAPElement setElementQName(QName newName) throws SOAPException {
64 HeaderElementImpl copy =
65 new HeaderElement1_1Impl((SOAPDocumentImpl) getOwnerDocument(), newName);
66 return replaceElementWithSOAPElement(this,copy);
67 }
69 protected NameImpl getActorAttributeName() {
70 return NameImpl.create("actor", null, NameImpl.SOAP11_NAMESPACE);
71 }
73 // role not supported by SOAP 1.1
74 protected NameImpl getRoleAttributeName() {
75 log.log(
76 Level.SEVERE,
77 "SAAJ0302.ver1_1.hdr.attr.unsupported.in.SOAP1.1",
78 new String[] { "Role" });
79 throw new UnsupportedOperationException("Role not supported by SOAP 1.1");
80 }
82 protected NameImpl getMustunderstandAttributeName() {
83 return NameImpl.create("mustUnderstand", null, NameImpl.SOAP11_NAMESPACE);
84 }
86 // mustUnderstand attribute has literal value "1" or "0"
87 protected String getMustunderstandLiteralValue(boolean mustUnderstand) {
88 return (mustUnderstand == true ? "1" : "0");
89 }
91 protected boolean getMustunderstandAttributeValue(String mu) {
92 if ("1".equals(mu) || "true".equalsIgnoreCase(mu))
93 return true;
94 return false;
95 }
97 // relay not supported by SOAP 1.1
98 protected NameImpl getRelayAttributeName() {
99 log.log(
100 Level.SEVERE,
101 "SAAJ0302.ver1_1.hdr.attr.unsupported.in.SOAP1.1",
102 new String[] { "Relay" });
103 throw new UnsupportedOperationException("Relay not supported by SOAP 1.1");
104 }
106 protected String getRelayLiteralValue(boolean relayAttr) {
107 log.log(
108 Level.SEVERE,
109 "SAAJ0302.ver1_1.hdr.attr.unsupported.in.SOAP1.1",
110 new String[] { "Relay" });
111 throw new UnsupportedOperationException("Relay not supported by SOAP 1.1");
112 }
114 protected boolean getRelayAttributeValue(String mu) {
115 log.log(
116 Level.SEVERE,
117 "SAAJ0302.ver1_1.hdr.attr.unsupported.in.SOAP1.1",
118 new String[] { "Relay" });
119 throw new UnsupportedOperationException("Relay not supported by SOAP 1.1");
120 }
122 protected String getActorOrRole() {
123 return getActor();
124 }
126 }