1 16 17 package org.apache.axis.encoding; 18 19 import org.apache.axis.Constants; 20 import org.apache.axis.encoding.ser.CalendarDeserializerFactory; 21 import org.apache.axis.encoding.ser.CalendarSerializerFactory; 22 import org.apache.axis.encoding.ser.DateDeserializerFactory; 23 import org.apache.axis.encoding.ser.DateSerializerFactory; 24 import org.apache.axis.encoding.ser.TimeDeserializerFactory; 25 import org.apache.axis.encoding.ser.TimeSerializerFactory; 26 27 31 public class DefaultJAXRPC11TypeMappingImpl extends DefaultTypeMappingImpl { 32 33 private static DefaultJAXRPC11TypeMappingImpl tm = null; 34 35 38 public static synchronized TypeMappingImpl getSingleton() { 39 if (tm == null) { 40 tm = new DefaultJAXRPC11TypeMappingImpl(); 41 } 42 return tm; 43 } 44 45 protected DefaultJAXRPC11TypeMappingImpl() { 46 registerXSDTypes(); 47 } 48 49 52 private void registerXSDTypes() { 53 myRegisterSimple(Constants.XSD_UNSIGNEDINT, Long .class); 55 myRegisterSimple(Constants.XSD_UNSIGNEDINT, long.class); 56 myRegisterSimple(Constants.XSD_UNSIGNEDSHORT, Integer .class); 57 myRegisterSimple(Constants.XSD_UNSIGNEDSHORT, int.class); 58 myRegisterSimple(Constants.XSD_UNSIGNEDBYTE, Short .class); 59 myRegisterSimple(Constants.XSD_UNSIGNEDBYTE, short.class); 60 myRegister(Constants.XSD_DATETIME, java.util.Calendar .class, 61 new CalendarSerializerFactory(java.util.Calendar .class, 62 Constants.XSD_DATETIME), 63 new CalendarDeserializerFactory(java.util.Calendar .class, 64 Constants.XSD_DATETIME)); 65 myRegister(Constants.XSD_DATE, java.util.Calendar .class, 66 new DateSerializerFactory(java.util.Calendar .class, 67 Constants.XSD_DATE), 68 new DateDeserializerFactory(java.util.Calendar .class, 69 Constants.XSD_DATE)); 70 myRegister(Constants.XSD_TIME, java.util.Calendar .class, 71 new TimeSerializerFactory(java.util.Calendar .class, 72 Constants.XSD_TIME), 73 new TimeDeserializerFactory(java.util.Calendar .class, 74 Constants.XSD_TIME)); 75 try { 76 myRegisterSimple(Constants.XSD_ANYURI, 77 Class.forName("java.net.URI")); 78 } catch (ClassNotFoundException e) { 79 myRegisterSimple(Constants.XSD_ANYURI, java.lang.String .class); 80 } 81 82 myRegisterSimple(Constants.XSD_DURATION, java.lang.String .class); 84 myRegisterSimple(Constants.XSD_YEARMONTH, java.lang.String .class); 85 myRegisterSimple(Constants.XSD_YEAR, java.lang.String .class); 86 myRegisterSimple(Constants.XSD_MONTHDAY, java.lang.String .class); 87 myRegisterSimple(Constants.XSD_DAY, java.lang.String .class); 88 myRegisterSimple(Constants.XSD_MONTH, java.lang.String .class); 89 myRegisterSimple(Constants.XSD_NORMALIZEDSTRING, 90 java.lang.String .class); 91 myRegisterSimple(Constants.XSD_TOKEN, java.lang.String .class); 92 myRegisterSimple(Constants.XSD_LANGUAGE, java.lang.String .class); 93 myRegisterSimple(Constants.XSD_NAME, java.lang.String .class); 94 myRegisterSimple(Constants.XSD_NCNAME, java.lang.String .class); 95 myRegisterSimple(Constants.XSD_ID, java.lang.String .class); 96 myRegisterSimple(Constants.XSD_NMTOKEN, java.lang.String .class); 97 myRegisterSimple(Constants.XSD_NMTOKENS, java.lang.String .class); 98 myRegisterSimple(Constants.XSD_STRING, java.lang.String .class); 99 myRegisterSimple(Constants.XSD_NONPOSITIVEINTEGER, 100 java.math.BigInteger .class); 101 myRegisterSimple(Constants.XSD_NEGATIVEINTEGER, 102 java.math.BigInteger .class); 103 myRegisterSimple(Constants.XSD_NONNEGATIVEINTEGER, 104 java.math.BigInteger .class); 105 myRegisterSimple(Constants.XSD_UNSIGNEDLONG, 106 java.math.BigInteger .class); 107 myRegisterSimple(Constants.XSD_POSITIVEINTEGER, 108 java.math.BigInteger .class); 109 } 110 } | Popular Tags |