KickJava   Java API By Example, From Geeks To Geeks.

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


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

27 public class SOAP12FaultCodeImpl extends SOAPFaultCodeImpl{
28     /**
29      * Eran Chinthaka (chinthaka@apache.org)
30      */

31     /**
32      * Constructor OMElementImpl
33      *
34      * @param localName
35      * @param ns
36      * @param parent
37      * @param builder
38      */

39     public SOAP12FaultCodeImpl(SOAPFault parent, OMXMLParserWrapper builder) {
40         super(parent, builder);
41     }
42
43     /**
44      * @param parent
45      * @param parent
46      */

47     public SOAP12FaultCodeImpl(SOAPFault parent) throws SOAPProcessingException {
48         super(parent, true);
49     }
50
51    
52
53     public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException {
54         if (!(subCode instanceof SOAP12FaultSubCodeImpl)) {
55             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Sub Code. But received some other implementation");
56         }
57         super.setSubCode(subCode);
58     }
59
60     public void setValue(SOAPFaultValue value) throws SOAPProcessingException {
61         if (!(value instanceof SOAP12FaultValueImpl)) {
62             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault Value. But received some other implementation");
63         }
64         super.setValue(value);
65     }
66
67      protected void checkParent(OMElement parent) throws SOAPProcessingException {
68         if (!(parent instanceof SOAP12FaultImpl)) {
69             throw new SOAPProcessingException("Expecting SOAP 1.2 implementation of SOAP Fault as the parent. But received some other implementation");
70         }
71     }
72 }
73
Popular Tags