KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > soap > impl > llom > soap12 > SOAP12FaultImpl


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

26 public class SOAP12FaultImpl extends SOAPFaultImpl {
27     /**
28      * Eran Chinthaka (chinthaka@apache.org)
29      */

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

45     public SOAP12FaultImpl(SOAPBody parent) throws SOAPProcessingException {
46         super(parent);
47     }
48
49     protected SOAPFaultDetail getNewSOAPFaultDetail(SOAPFault fault) {
50         return new SOAP12FaultDetailImpl(fault);
51
52     }
53
54     public void setCode(SOAPFaultCode soapFaultCode) throws SOAPProcessingException {
55         if (!(soapFaultCode instanceof SOAP12FaultCodeImpl)) {
56             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Code. But received some other implementation");
57         }
58         super.setCode(soapFaultCode);
59     }
60
61
62     public void setReason(SOAPFaultReason reason) throws SOAPProcessingException {
63         if (!(reason instanceof SOAP12FaultReasonImpl)) {
64             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Reason. But received some other implementation");
65         }
66         super.setReason(reason);
67     }
68
69     public void setNode(SOAPFaultNode node) throws SOAPProcessingException {
70         if (!(node instanceof SOAP12FaultNodeImpl)) {
71             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Node. But received some other implementation");
72         }
73         super.setNode(node);
74     }
75
76     public void setRole(SOAPFaultRole role) throws SOAPProcessingException {
77         if (!(role instanceof SOAP12FaultRoleImpl)) {
78             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Role. But received some other implementation");
79         }
80         super.setRole(role);
81     }
82
83     public void setDetail(SOAPFaultDetail detail) throws SOAPProcessingException {
84         if (!(detail instanceof SOAP12FaultDetailImpl)) {
85             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Detail. But received some other implementation");
86         }
87         super.setDetail(detail);
88     }
89
90     protected void checkParent(OMElement parent) throws SOAPProcessingException {
91         if (!(parent instanceof SOAP12BodyImpl)) {
92             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Body as the parent. But received some other implementation");
93         }
94     }
95 }
96
Popular Tags