KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > remote > soap > LZDefaultSOAPEncodingTypeMapping


1 /* *****************************************************************************
2  * LZDefaultSOAPEncodingTypeMapping.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

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

25
26 package org.openlaszlo.remote.soap;
27
28 import org.apache.axis.Constants;
29 import org.apache.axis.encoding.TypeMapping;
30 import org.apache.axis.encoding.ser.Base64SerializerFactory;
31 import org.apache.axis.encoding.ser.Base64DeserializerFactory;
32
33 /**
34  * @author Rich Scheuerle (scheu@us.ibm.com)
35  *
36  * This is the implementation of the axis Default JAX-RPC SOAP 1.2 TypeMapping
37  * See DefaultTypeMapping for more information.
38  *
39  */

40 public class LZDefaultSOAPEncodingTypeMapping extends LZDefaultTypeMapping {
41     
42     private static LZDefaultSOAPEncodingTypeMapping tm = null;
43     /**
44      * Construct TypeMapping
45      */

46     public static TypeMapping create() {
47         if (tm == null) {
48             tm = new LZDefaultSOAPEncodingTypeMapping();
49         }
50         return tm;
51     }
52     
53     public static TypeMapping createWithDelegate() {
54         TypeMapping ret = new LZDefaultSOAPEncodingTypeMapping();
55         ret.setDelegate(LZDefaultTypeMapping.getSingleton());
56         return ret;
57     }
58
59     protected LZDefaultSOAPEncodingTypeMapping() {
60         registerSOAPTypes();
61     }
62
63     /**
64      * Register the SOAP encoding data types. This is split out into a
65      * method so it can happen either before or after the XSD mappings.
66      */

67     private void registerSOAPTypes() {
68         // SOAP Encoded strings are treated as primitives.
69
// Everything else is not.
70
myRegisterSimple(Constants.SOAP_STRING, java.lang.String JavaDoc.class);
71         myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean JavaDoc.class);
72         myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double JavaDoc.class);
73         myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float JavaDoc.class);
74         myRegisterSimple(Constants.SOAP_INT, java.lang.Integer JavaDoc.class);
75         myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger JavaDoc.class);
76         myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal JavaDoc.class);
77         myRegisterSimple(Constants.SOAP_LONG, java.lang.Long JavaDoc.class);
78         myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short JavaDoc.class);
79         myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte JavaDoc.class);
80 // myRegister(Constants.SOAP_BASE64, byte[].class,
81
// new Base64SerializerFactory(byte[].class,
82
// Constants.SOAP_BASE64 ),
83
// new Base64DeserializerFactory(byte[].class,
84
// Constants.SOAP_BASE64)
85
// );
86
// myRegister(Constants.SOAP_BASE64BINARY,
87
// byte[].class,
88
// new Base64SerializerFactory(byte[].class, Constants.SOAP_BASE64 ),
89
// new Base64DeserializerFactory(byte[].class, Constants.SOAP_BASE64) );
90
}
91 }
92
Popular Tags