KickJava   Java API By Example, From Geeks To Geeks.

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


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.SOAPFaultCode;
6 import org.apache.axis2.soap.SOAPFaultSubCode;
7 import org.apache.axis2.soap.SOAPFaultValue;
8 import org.apache.axis2.soap.impl.llom.SOAPFaultSubCodeImpl;
9 import org.apache.axis2.soap.impl.llom.SOAPProcessingException;
10
11 /*
12  * Copyright 2004,2005 The Apache Software Foundation.
13  *
14  * Licensed under the Apache License, Version 2.0 (the "License");
15  * you may not use this file except in compliance with the License.
16  * You may obtain a copy of the License at
17  *
18  * http://www.apache.org/licenses/LICENSE-2.0
19  *
20  * Unless required by applicable law or agreed to in writing, software
21  * distributed under the License is distributed on an "AS IS" BASIS,
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  * See the License for the specific language governing permissions and
24  * limitations under the License.
25  *
26  * author : Eran Chinthaka (chinthaka@apache.org)
27  */

28
29 public class SOAP12FaultSubCodeImpl extends SOAPFaultSubCodeImpl{
30     //changed
31
public SOAP12FaultSubCodeImpl(SOAPFaultCode parent) throws SOAPProcessingException {
32         super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME);
33     }
34
35     //changed
36
public SOAP12FaultSubCodeImpl(SOAPFaultCode parent, OMXMLParserWrapper builder) {
37         super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder);
38     }
39
40     public SOAP12FaultSubCodeImpl(SOAPFaultSubCode parent) throws SOAPProcessingException {
41         super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME);
42     }
43
44     public SOAP12FaultSubCodeImpl(SOAPFaultSubCode parent, OMXMLParserWrapper builder) {
45         super(parent, SOAP12Constants.SOAP_FAULT_SUB_CODE_LOCAL_NAME, builder);
46     }
47
48     protected void checkParent(OMElement parent) throws SOAPProcessingException {
49         if (!((parent instanceof SOAP12FaultSubCodeImpl) || (parent instanceof SOAP12FaultCodeImpl))) {
50             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP FaultSubCode or SOAP FaultCodeValue as the parent. But received some other implementation");
51         }
52     }
53
54     public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException {
55         if (!(subCode instanceof SOAP12FaultSubCodeImpl)) {
56             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Sub Code. But received some other implementation");
57         }
58         super.setSubCode(subCode);
59     }
60
61     public void setValue(SOAPFaultValue soapFaultSubCodeValue) throws SOAPProcessingException {
62         if (!(soapFaultSubCodeValue instanceof SOAP12FaultValueImpl)) {
63             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Value. But received some other implementation");
64         }
65         super.setValue(soapFaultSubCodeValue);
66     }
67 }
68
Popular Tags