KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > soap > impl > llom > soap11 > SOAP11FaultImpl


1 package org.apache.axis2.soap.impl.llom.soap11;
2
3 import org.apache.axis2.om.OMElement;
4 import org.apache.axis2.om.OMOutput;
5 import org.apache.axis2.om.OMXMLParserWrapper;
6 import org.apache.axis2.soap.*;
7 import org.apache.axis2.soap.impl.llom.SOAPFaultImpl;
8 import org.apache.axis2.soap.impl.llom.SOAPProcessingException;
9
10 import javax.xml.stream.XMLStreamException;
11
12
13 /**
14  * Copyright 2001-2004 The Apache Software Foundation.
15  * <p/>
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
17  * use this file except in compliance with the License. You may obtain a copy of
18  * the License at
19  * <p/>
20  * http://www.apache.org/licenses/LICENSE-2.0
21  * <p/>
22  * Unless required by applicable law or agreed to in writing, software
23  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25  * License for the specific language governing permissions and limitations under
26  * the License.
27  * <p/>
28  */

29 public class SOAP11FaultImpl extends SOAPFaultImpl {
30     /**
31      * Eran Chinthaka (chinthaka@apache.org)
32      */

33
34     public SOAP11FaultImpl(SOAPBody parent, Exception JavaDoc e) throws SOAPProcessingException {
35         super(parent, e);
36     }
37
38     public SOAP11FaultImpl(SOAPBody parent, OMXMLParserWrapper builder) {
39         super(parent, builder);
40     }
41
42     /**
43      * This is a convenience method for the SOAP Fault Impl.
44      *
45      * @param parent
46      * @param e
47      */

48     public SOAP11FaultImpl(SOAPBody parent) throws SOAPProcessingException {
49         super(parent);
50
51     }
52
53     protected SOAPFaultDetail getNewSOAPFaultDetail(SOAPFault fault) throws SOAPProcessingException {
54         return new SOAP11FaultDetailImpl(fault);
55     }
56
57     public void serializeWithCache(OMOutput omOutput) throws XMLStreamException {
58         super.serializeWithCache(omOutput);
59     }
60
61     public void serialize(OMOutput omOutput) throws XMLStreamException {
62         super.serialize(omOutput);
63     }
64
65     public void setCode(SOAPFaultCode soapFaultCode) throws SOAPProcessingException {
66         if (!(soapFaultCode instanceof SOAP11FaultCodeImpl)) {
67             throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Code. But received some other implementation");
68         }
69         super.setCode(soapFaultCode);
70     }
71     public void setReason(SOAPFaultReason reason) throws SOAPProcessingException {
72         if (!(reason instanceof SOAP11FaultReasonImpl)) {
73             throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Reason. But received some other implementation");
74         }
75         super.setReason(reason);
76     }
77 //
78
public void setNode(SOAPFaultNode node) throws SOAPProcessingException {
79         if (!(node instanceof SOAP11FaultNodeImpl)) {
80             throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Node. But received some other implementation");
81         }
82         super.setNode(node);
83     }
84     public void setRole(SOAPFaultRole role) throws SOAPProcessingException {
85         if (!(role instanceof SOAP11FaultRoleImpl)) {
86             throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Role. But received some other implementation");
87         }
88         super.setRole(role);
89     }
90
91     protected void checkParent(OMElement parent) throws SOAPProcessingException {
92         if (!(parent instanceof SOAP11BodyImpl)) {
93             throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Body as the parent. But received some other implementation");
94         }
95     }
96
97     public void setDetail(SOAPFaultDetail detail) throws SOAPProcessingException {
98         if (!(detail instanceof SOAP11FaultDetailImpl)) {
99             throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Detail. But received some other implementation");
100         }
101         super.setDetail(detail);
102     }
103
104 }
105
Popular Tags