1 16 17 package org.apache.axis.encoding; 18 19 import org.apache.axis.Constants; 20 import org.apache.axis.MessageContext; 21 import org.apache.axis.encoding.ser.Base64SerializerFactory; 22 import org.apache.axis.encoding.ser.Base64DeserializerFactory; 23 import org.apache.axis.encoding.ser.ArraySerializerFactory; 24 import org.apache.axis.encoding.ser.ArrayDeserializerFactory; 25 26 33 public class DefaultSOAPEncodingTypeMappingImpl extends DefaultTypeMappingImpl { 34 private static DefaultSOAPEncodingTypeMappingImpl tm = null; 35 38 public static synchronized TypeMappingImpl getSingleton() { 39 if (tm == null) { 40 tm = new DefaultSOAPEncodingTypeMappingImpl(); 41 } 42 return tm; 43 } 44 45 public static TypeMappingDelegate createWithDelegate() { 46 TypeMappingDelegate ret = new TypeMappingDelegate(new DefaultSOAPEncodingTypeMappingImpl()); 47 MessageContext mc = MessageContext.getCurrentContext(); 48 TypeMappingDelegate tm = null; 49 if (mc != null) { 50 tm = (TypeMappingDelegate)mc.getTypeMappingRegistry().getDefaultTypeMapping(); 51 } else { 52 tm = DefaultTypeMappingImpl.getSingletonDelegate(); 53 } 54 ret.setNext(tm); 55 return ret; 56 } 57 58 protected DefaultSOAPEncodingTypeMappingImpl() { 59 super(true); 60 registerSOAPTypes(); 61 } 62 63 67 private void registerSOAPTypes() { 68 myRegisterSimple(Constants.SOAP_STRING, java.lang.String .class); 71 myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean .class); 72 myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double .class); 73 myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float .class); 74 myRegisterSimple(Constants.SOAP_INT, java.lang.Integer .class); 75 myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger .class); 76 myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal .class); 77 myRegisterSimple(Constants.SOAP_LONG, java.lang.Long .class); 78 myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short .class); 79 myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte .class); 80 81 myRegister(Constants.SOAP_BASE64, byte[].class, 82 new Base64SerializerFactory(byte[].class, 83 Constants.SOAP_BASE64), 84 new Base64DeserializerFactory(byte[].class, 85 Constants.SOAP_BASE64) 86 ); 87 myRegister(Constants.SOAP_BASE64BINARY, byte[].class, 88 new Base64SerializerFactory(byte[].class, 89 Constants.SOAP_BASE64BINARY), 90 new Base64DeserializerFactory(byte[].class, 91 Constants.SOAP_BASE64BINARY) 92 ); 93 94 myRegister(Constants.SOAP_ARRAY12, java.util.Collection .class, 95 new ArraySerializerFactory(), 96 new ArrayDeserializerFactory() 97 ); 98 myRegister(Constants.SOAP_ARRAY12, java.util.ArrayList .class, 99 new ArraySerializerFactory(), 100 new ArrayDeserializerFactory() 101 ); 102 103 myRegister(Constants.SOAP_ARRAY12, Object [].class, 104 new ArraySerializerFactory(), 105 new ArrayDeserializerFactory() 106 ); 107 108 myRegister(Constants.SOAP_ARRAY, java.util.ArrayList .class, 109 new ArraySerializerFactory(), 110 new ArrayDeserializerFactory() 111 ); 112 113 myRegister(Constants.SOAP_ARRAY, java.util.Collection .class, 121 new ArraySerializerFactory(), 122 new ArrayDeserializerFactory() 123 ); 124 125 myRegister(Constants.SOAP_ARRAY, Object [].class, 126 new ArraySerializerFactory(), 127 new ArrayDeserializerFactory() 128 ); 129 130 131 } 132 } 133 | Popular Tags |