KickJava   Java API By Example, From Geeks To Geeks.

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


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.SOAPFault;
6 import org.apache.axis2.soap.SOAPFaultText;
7 import org.apache.axis2.soap.impl.llom.SOAPFaultReasonImpl;
8 import org.apache.axis2.soap.impl.llom.SOAPProcessingException;
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 SOAP12FaultReasonImpl extends SOAPFaultReasonImpl{
27     /**
28      * Eran Chinthaka (chinthaka@apache.org)
29      */

30     public SOAP12FaultReasonImpl(SOAPFault parent, OMXMLParserWrapper builder) {
31         super(parent, builder);
32     }
33
34     /**
35      * @param parent
36      */

37     public SOAP12FaultReasonImpl(SOAPFault parent) throws SOAPProcessingException {
38         super(parent, true);
39     }
40
41     public void setSOAPText(SOAPFaultText soapFaultText) throws SOAPProcessingException {
42         if (!(soapFaultText instanceof SOAP12FaultTextImpl)) {
43             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Text. But received some other implementation");
44         }
45         super.setSOAPText(soapFaultText);
46     }
47
48     protected void checkParent(OMElement parent) throws SOAPProcessingException {
49         if (!(parent instanceof SOAP12FaultImpl)) {
50             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault as the parent. But received some other implementation");
51         }
52     }
53 }
54
Popular Tags