1 /*
2 * $Id: FaultElement1_1Impl.java,v 1.12 2006/01/27 12:49:41 vj135062 Exp $
3 */
4
5 /*
6 * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 *
9 * This code is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 only, as
11 * published by the Free Software Foundation. Sun designates this
12 * particular file as subject to the "Classpath" exception as provided
13 * by Sun in the LICENSE file that accompanied this code.
14 *
15 * This code is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * version 2 for more details (a copy is included in the LICENSE file that
19 * accompanied this code).
20 *
21 * You should have received a copy of the GNU General Public License version
22 * 2 along with this work; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
26 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * have any questions.
28 */
29
30 /**
31 *
32 * @author SAAJ RI Development Team
33 */
34 package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
35
36 import javax.xml.namespace.QName;
37 import javax.xml.soap.SOAPElement;
38 import javax.xml.soap.SOAPException;
39
40 import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
41 import com.sun.xml.internal.messaging.saaj.soap.impl.FaultElementImpl;
42 import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
43
44 public class FaultElement1_1Impl extends FaultElementImpl {
45
46 public FaultElement1_1Impl(SOAPDocumentImpl ownerDoc, NameImpl qname) {
47 super(ownerDoc, qname);
48 }
49
50 public FaultElement1_1Impl(SOAPDocumentImpl ownerDoc, QName qname) {
51 super(ownerDoc, qname);
52 }
53
54 public FaultElement1_1Impl(SOAPDocumentImpl ownerDoc,
55 String localName) {
56 super(ownerDoc, NameImpl.createFaultElement1_1Name(localName));
57 }
58
59 public FaultElement1_1Impl(SOAPDocumentImpl ownerDoc,
60 String localName,
61 String prefix) {
62 super(ownerDoc,
63 NameImpl.createFaultElement1_1Name(localName, prefix));
64 }
65
66 protected boolean isStandardFaultElement() {
67 String localName = elementQName.getLocalPart();
68 if (localName.equalsIgnoreCase("faultcode") ||
69 localName.equalsIgnoreCase("faultstring") ||
70 localName.equalsIgnoreCase("faultactor")) {
71 return true;
72 }
73 return false;
74 }
75
76 public SOAPElement setElementQName(QName newName) throws SOAPException {
77 if (!isStandardFaultElement()) {
78 FaultElement1_1Impl copy =
79 new FaultElement1_1Impl((SOAPDocumentImpl) getOwnerDocument(), newName);
80 return replaceElementWithSOAPElement(this,copy);
81 } else {
82 return super.setElementQName(newName);
83 }
84 }
85 }