gdaniels 2002/09/26 10:04:02 Modified: java/src/org/apache/axis/encoding DefaultSOAP12TypeMappingImpl.java DefaultTypeMappingImpl.java TypeMappingImpl.java java/src/org/apache/axis/encoding/ser ArraySerializerFactory.java Base64SerializerFactory.java BaseSerializerFactory.java BeanSerializerFactory.java CalendarSerializerFactory.java DateSerializerFactory.java ElementSerializerFactory.java EnumSerializerFactory.java HexSerializerFactory.java JAFDataHandlerSerializerFactory.java MapSerializerFactory.java QNameSerializerFactory.java VectorSerializerFactory.java java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java JavaStubWriter.java java/test/encoding TestAttributes.java Added: java/src/org/apache/axis/encoding/ser SimpleSerializerFactory.java Removed: java/src/org/apache/axis/encoding/ser SimpleNonPrimitiveSerializerFactory.java SimplePrimitiveSerializerFactory.java Log: Simplify by removing the "primitive"/"nonprimitive" distinction, since serializers are always required to be thread-safe anyway, and it wasn't needed. Fix TCK problem by adding an internalRegister() API to our TypeMappingImpl which gets used when we're initializing. This method allows null/null serializer/deserializer factories, and the normal register() JAX-RPC API does not. Revision Changes Path 1.6 +11 -13 xml-axis/java/src/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java Index: DefaultSOAP12TypeMappingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DefaultSOAP12TypeMappingImpl.java 25 Sep 2002 16:29:47 -0000 1.5 +++ DefaultSOAP12TypeMappingImpl.java 26 Sep 2002 17:04:00 -0000 1.6 @@ -98,19 +98,17 @@ // SOAP Encoded strings are treated as primitives. // Everything else is not. - myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class, true); - myRegisterSimple(Constants.SOAP_BOOLEAN, - java.lang.Boolean.class, false); - myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class, false); - myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class, false); - myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class, false); - myRegisterSimple(Constants.SOAP_INTEGER, - java.math.BigInteger.class, false); - myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class, - false); - myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class, false); - myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class, false); - myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class, false); + myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class); + myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean.class); + myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class); + myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class); + myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class); + myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger.class); + myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class + ); + myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class); + myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class); + myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class); // SOAP 1.2 // byte[] -ser-> SOAP_BASE64 1.58 +57 -71 xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java Index: DefaultTypeMappingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- DefaultTypeMappingImpl.java 25 Sep 2002 18:27:03 -0000 1.57 +++ DefaultTypeMappingImpl.java 26 Sep 2002 17:04:00 -0000 1.58 @@ -75,8 +75,7 @@ import org.apache.axis.encoding.ser.QNameDeserializerFactory; import org.apache.axis.encoding.ser.QNameSerializerFactory; import org.apache.axis.encoding.ser.SimpleDeserializerFactory; -import org.apache.axis.encoding.ser.SimpleNonPrimitiveSerializerFactory; -import org.apache.axis.encoding.ser.SimplePrimitiveSerializerFactory; +import org.apache.axis.encoding.ser.SimpleSerializerFactory; import org.apache.axis.encoding.ser.VectorDeserializerFactory; import org.apache.axis.encoding.ser.VectorSerializerFactory; import org.apache.axis.utils.JavaUtils; @@ -154,19 +153,16 @@ // SOAP Encoded strings are treated as primitives. // Everything else is not. - myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class, true); - myRegisterSimple(Constants.SOAP_BOOLEAN, - java.lang.Boolean.class, false); - myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class, false); - myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class, false); - myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class, false); - myRegisterSimple(Constants.SOAP_INTEGER, - java.math.BigInteger.class, false); - myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class, - false); - myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class, false); - myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class, false); - myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class, false); + myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class); + myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean.class); + myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class); + myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class); + myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class); + myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger.class); + myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class); + myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class); + myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class); + myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class); // HexBinary binary data needs to use the hex binary serializer/deserializer myRegister(Constants.XSD_HEXBIN, HexBinary.class, @@ -242,27 +238,27 @@ */ // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives. - myRegisterSimple(Constants.XSD_STRING, java.lang.String.class, true); - myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class, true); - myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class, true); - myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class, true); - myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class, true); - myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class, - true); - myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class, - true); - myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class, true); - myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class, true); - myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class, true); + myRegisterSimple(Constants.XSD_STRING, java.lang.String.class); + myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class); + myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class); + myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class); + myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class); + myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class + ); + myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class + ); + myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class); + myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class); + myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class); // The XSD Primitives are mapped to java primitives. - myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class, true); - myRegisterSimple(Constants.XSD_DOUBLE, double.class, true); - myRegisterSimple(Constants.XSD_FLOAT, float.class, true); - myRegisterSimple(Constants.XSD_INT, int.class, true); - myRegisterSimple(Constants.XSD_LONG, long.class, true); - myRegisterSimple(Constants.XSD_SHORT, short.class, true); - myRegisterSimple(Constants.XSD_BYTE, byte.class, true); + myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class); + myRegisterSimple(Constants.XSD_DOUBLE, double.class); + myRegisterSimple(Constants.XSD_FLOAT, float.class); + myRegisterSimple(Constants.XSD_INT, int.class); + myRegisterSimple(Constants.XSD_LONG, long.class); + myRegisterSimple(Constants.XSD_SHORT, short.class); + myRegisterSimple(Constants.XSD_BYTE, byte.class); // Map QNAME to the jax rpc QName class myRegister(Constants.XSD_QNAME, @@ -288,38 +284,38 @@ // Mapping for xsd:time. Map to Axis type Time myRegister(Constants.XSD_TIME, org.apache.axis.types.Time.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Time.class, + new SimpleSerializerFactory(org.apache.axis.types.Time.class, Constants.XSD_TIME), new SimpleDeserializerFactory(org.apache.axis.types.Time.class, Constants.XSD_TIME) ); // These are the g* types (gYearMonth, etc) which map to Axis types myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.YearMonth.class, + new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class, Constants.XSD_YEARMONTH), new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class, Constants.XSD_YEARMONTH) ); myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Year.class, + new SimpleSerializerFactory(org.apache.axis.types.Year.class, Constants.XSD_YEAR), new SimpleDeserializerFactory(org.apache.axis.types.Year.class, Constants.XSD_YEAR) ); myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Month.class, + new SimpleSerializerFactory(org.apache.axis.types.Month.class, Constants.XSD_MONTH), new SimpleDeserializerFactory(org.apache.axis.types.Month.class, Constants.XSD_MONTH) ); myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Day.class, + new SimpleSerializerFactory(org.apache.axis.types.Day.class, Constants.XSD_DAY), new SimpleDeserializerFactory(org.apache.axis.types.Day.class, Constants.XSD_DAY) ); myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.MonthDay.class, + new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class, Constants.XSD_MONTHDAY), new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class, Constants.XSD_MONTHDAY) @@ -386,7 +382,7 @@ // xsd:token myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Token.class, + new SimpleSerializerFactory(org.apache.axis.types.Token.class, Constants.XSD_TOKEN), new SimpleDeserializerFactory(org.apache.axis.types.Token.class, Constants.XSD_TOKEN) @@ -394,7 +390,7 @@ // a xsd:normalizedString myRegister(Constants.XSD_NORMALIZEDSTRING, org.apache.axis.types.NormalizedString.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.NormalizedString.class, + new SimpleSerializerFactory(org.apache.axis.types.NormalizedString.class, Constants.XSD_NORMALIZEDSTRING), new SimpleDeserializerFactory(org.apache.axis.types.NormalizedString.class, Constants.XSD_NORMALIZEDSTRING) @@ -402,7 +398,7 @@ // a xsd:unsignedLong myRegister(Constants.XSD_UNSIGNEDLONG, org.apache.axis.types.UnsignedLong.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.UnsignedLong.class, + new SimpleSerializerFactory(org.apache.axis.types.UnsignedLong.class, Constants.XSD_UNSIGNEDLONG), new SimpleDeserializerFactory(org.apache.axis.types.UnsignedLong.class, Constants.XSD_UNSIGNEDLONG) @@ -410,7 +406,7 @@ // a xsd:unsignedInt myRegister(Constants.XSD_UNSIGNEDINT, org.apache.axis.types.UnsignedInt.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.UnsignedInt.class, + new SimpleSerializerFactory(org.apache.axis.types.UnsignedInt.class, Constants.XSD_UNSIGNEDINT), new SimpleDeserializerFactory(org.apache.axis.types.UnsignedInt.class, Constants.XSD_UNSIGNEDINT) @@ -418,7 +414,7 @@ // a xsd:unsignedShort myRegister(Constants.XSD_UNSIGNEDSHORT, org.apache.axis.types.UnsignedShort.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.UnsignedShort.class, + new SimpleSerializerFactory(org.apache.axis.types.UnsignedShort.class, Constants.XSD_UNSIGNEDSHORT), new SimpleDeserializerFactory(org.apache.axis.types.UnsignedShort.class, Constants.XSD_UNSIGNEDSHORT) @@ -426,7 +422,7 @@ // a xsd:unsignedByte myRegister(Constants.XSD_UNSIGNEDBYTE, org.apache.axis.types.UnsignedByte.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.UnsignedByte.class, + new SimpleSerializerFactory(org.apache.axis.types.UnsignedByte.class, Constants.XSD_UNSIGNEDBYTE), new SimpleDeserializerFactory(org.apache.axis.types.UnsignedByte.class, Constants.XSD_UNSIGNEDBYTE) @@ -434,7 +430,7 @@ // a xsd:nonNegativeInteger myRegister(Constants.XSD_NONNEGATIVEINTEGER, org.apache.axis.types.NonNegativeInteger.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.NonNegativeInteger.class, + new SimpleSerializerFactory(org.apache.axis.types.NonNegativeInteger.class, Constants.XSD_NONNEGATIVEINTEGER), new SimpleDeserializerFactory(org.apache.axis.types.NonNegativeInteger.class, Constants.XSD_NONNEGATIVEINTEGER) @@ -442,7 +438,7 @@ // a xsd:negativeInteger myRegister(Constants.XSD_NEGATIVEINTEGER, org.apache.axis.types.NegativeInteger.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.NegativeInteger.class, + new SimpleSerializerFactory(org.apache.axis.types.NegativeInteger.class, Constants.XSD_NEGATIVEINTEGER), new SimpleDeserializerFactory(org.apache.axis.types.NegativeInteger.class, Constants.XSD_NEGATIVEINTEGER) @@ -450,7 +446,7 @@ // a xsd:positiveInteger myRegister(Constants.XSD_POSITIVEINTEGER, org.apache.axis.types.PositiveInteger.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.PositiveInteger.class, + new SimpleSerializerFactory(org.apache.axis.types.PositiveInteger.class, Constants.XSD_POSITIVEINTEGER), new SimpleDeserializerFactory(org.apache.axis.types.PositiveInteger.class, Constants.XSD_POSITIVEINTEGER) @@ -458,7 +454,7 @@ // a xsd:nonPositiveInteger myRegister(Constants.XSD_NONPOSITIVEINTEGER, org.apache.axis.types.NonPositiveInteger.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.NonPositiveInteger.class, + new SimpleSerializerFactory(org.apache.axis.types.NonPositiveInteger.class, Constants.XSD_NONPOSITIVEINTEGER), new SimpleDeserializerFactory(org.apache.axis.types.NonPositiveInteger.class, Constants.XSD_NONPOSITIVEINTEGER) @@ -466,7 +462,7 @@ // a xsd:Name myRegister(Constants.XSD_NAME, org.apache.axis.types.Name.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Name.class, + new SimpleSerializerFactory(org.apache.axis.types.Name.class, Constants.XSD_NAME), new SimpleDeserializerFactory(org.apache.axis.types.Name.class, Constants.XSD_NAME) @@ -474,7 +470,7 @@ // a xsd:NCName myRegister(Constants.XSD_NCNAME, org.apache.axis.types.NCName.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.NCName.class, + new SimpleSerializerFactory(org.apache.axis.types.NCName.class, Constants.XSD_NCNAME), new SimpleDeserializerFactory(org.apache.axis.types.NCName.class, Constants.XSD_NCNAME) @@ -482,7 +478,7 @@ // a xsd:NmToken myRegister(Constants.XSD_NMTOKEN, org.apache.axis.types.NMToken.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.NMToken.class, + new SimpleSerializerFactory(org.apache.axis.types.NMToken.class, Constants.XSD_NMTOKEN), new SimpleDeserializerFactory(org.apache.axis.types.NMToken.class, Constants.XSD_NMTOKEN) @@ -490,7 +486,7 @@ // a xsd:Duration myRegister(Constants.XSD_DURATION, org.apache.axis.types.Duration.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.Duration.class, + new SimpleSerializerFactory(org.apache.axis.types.Duration.class, Constants.XSD_DURATION), new SimpleDeserializerFactory(org.apache.axis.types.Duration.class, Constants.XSD_DURATION) @@ -498,7 +494,7 @@ // a xsd:anyURI myRegister(Constants.XSD_ANYURI, org.apache.axis.types.URI.class, - new SimplePrimitiveSerializerFactory(org.apache.axis.types.URI.class, + new SimpleSerializerFactory(org.apache.axis.types.URI.class, Constants.XSD_ANYURI), new SimpleDeserializerFactory(org.apache.axis.types.URI.class, Constants.XSD_ANYURI) @@ -537,20 +533,10 @@ * Register a "simple" type mapping - in other words, a * @param xmlType * @param javaType - * @param primitive - */ - protected void myRegisterSimple(QName xmlType, - Class javaType, - boolean primitive) { - SerializerFactory sf; + */ + protected void myRegisterSimple(QName xmlType, Class javaType) { + SerializerFactory sf = new SimpleSerializerFactory(javaType, xmlType); DeserializerFactory df = null; - if (primitive) { - sf = new SimplePrimitiveSerializerFactory(javaType, - xmlType); - } else { - sf = new SimpleNonPrimitiveSerializerFactory(javaType, - xmlType); - } if (javaType != java.lang.Object.class) { df = new SimpleDeserializerFactory(javaType, xmlType); } @@ -579,7 +565,7 @@ for (int i=0; i < Constants.URIS_SCHEMA_XSD.length; i++) { QName qName = new QName(Constants.URIS_SCHEMA_XSD[i], xmlType.getLocalPart()); - super.register(javaType, qName, sf, df); + super.internalRegister(javaType, qName, sf, df); } } else if (xmlType.getNamespaceURI().equals( @@ -587,12 +573,12 @@ for (int i=0; i < Constants.URIS_SOAP_ENC.length; i++) { QName qName = new QName(Constants.URIS_SOAP_ENC[i], xmlType.getLocalPart()); - super.register(javaType, qName, sf, df); + super.internalRegister(javaType, qName, sf, df); } } // Register with the specified xmlType. // This is the prefered mapping and the last registed one wins - super.register(javaType, xmlType, sf, df); + super.internalRegister(javaType, xmlType, sf, df); } catch (JAXRPCException e) { } } 1.35 +20 -1 xml-axis/java/src/org/apache/axis/encoding/TypeMappingImpl.java Index: TypeMappingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMappingImpl.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- TypeMappingImpl.java 25 Sep 2002 16:29:47 -0000 1.34 +++ TypeMappingImpl.java 26 Sep 2002 17:04:00 -0000 1.35 @@ -58,7 +58,6 @@ import org.apache.axis.Constants; import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.encoding.ser.BeanDeserializerFactory; -import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.ClassUtils; import org.apache.axis.utils.Messages; @@ -245,7 +244,27 @@ javax.xml.rpc.encoding.SerializerFactory sf, javax.xml.rpc.encoding.DeserializerFactory dsf) throws JAXRPCException { + // At least a serializer or deserializer factory must be specified. + if (sf == null && dsf == null) { + throw new JAXRPCException(Messages.getMessage("badSerFac")); + } + + internalRegister(javaType, xmlType, sf, dsf); + } + /** + * Internal version of register(), which allows null factories. + * + * @param javaType + * @param xmlType + * @param sf + * @param dsf + * @throws JAXRPCException + */ + protected void internalRegister(Class javaType, QName xmlType, + javax.xml.rpc.encoding.SerializerFactory sf, + javax.xml.rpc.encoding.DeserializerFactory dsf) + throws JAXRPCException { // Both javaType and xmlType must be specified. if (javaType == null || xmlType == null) { throw new JAXRPCException( 1.6 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializerFactory.java Index: ArraySerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializerFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ArraySerializerFactory.java 11 Jun 2002 14:53:55 -0000 1.5 +++ ArraySerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.6 @@ -76,6 +76,6 @@ */ public class ArraySerializerFactory extends BaseSerializerFactory { public ArraySerializerFactory() { - super(ArraySerializer.class, false); + super(ArraySerializer.class); } } 1.7 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/Base64SerializerFactory.java Index: Base64SerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/Base64SerializerFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Base64SerializerFactory.java 11 Jun 2002 14:53:55 -0000 1.6 +++ Base64SerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.7 @@ -76,6 +76,6 @@ */ public class Base64SerializerFactory extends BaseSerializerFactory { public Base64SerializerFactory(Class javaType, QName xmlType) { - super(Base64Serializer.class, true, xmlType, javaType); // Share Base64Serializer instance + super(Base64Serializer.class, xmlType, javaType); // Share Base64Serializer instance } } 1.19 +5 -22 xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java Index: BaseSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- BaseSerializerFactory.java 26 Sep 2002 00:24:50 -0000 1.18 +++ BaseSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.19 @@ -55,27 +55,17 @@ package org.apache.axis.encoding.ser; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - import javax.xml.namespace.QName; import javax.xml.rpc.JAXRPCException; -import java.io.IOException; import java.util.Vector; import java.util.Iterator; import org.apache.axis.Constants; import org.apache.axis.utils.ClassUtils; -import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.Messages; import org.apache.axis.encoding.Serializer; import org.apache.axis.encoding.SerializerFactory; -import org.apache.axis.encoding.SerializationContext; -import org.apache.axis.encoding.Deserializer; -import org.apache.axis.encoding.DeserializerFactory; -import org.apache.axis.encoding.DeserializationContext; -import org.apache.axis.encoding.Deserializer; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -92,7 +82,6 @@ static Vector mechanisms = null; protected Class serClass = null; - protected boolean share = false; protected Serializer ser = null; protected QName xmlType = null; protected Class javaType = null; @@ -102,17 +91,14 @@ /** * Constructor * @param serClass is the class of the Serializer - * @param share indicates if serializers can be shared. getSerializerAs - * will always return the same serializer object if share is true. * Sharing is only valid for xml primitives. */ - public BaseSerializerFactory(Class serClass, boolean share) { + public BaseSerializerFactory(Class serClass) { this.serClass = serClass; - this.share = share; } - public BaseSerializerFactory(Class serClass, boolean share, + public BaseSerializerFactory(Class serClass, QName xmlType, Class javaType) { - this(serClass, share); + this(serClass); this.xmlType = xmlType; this.javaType = javaType; this.serClassConstructor = getConstructor(serClass); @@ -122,9 +108,6 @@ public javax.xml.rpc.encoding.Serializer getSerializerAs(String mechanismType) throws JAXRPCException { - if (!share) { - return getSerializerAsInternal(mechanismType); - } synchronized (this) { if (ser==null) { ser = getSerializerAsInternal(mechanismType); @@ -275,8 +258,8 @@ * public <constructor>(Class javaType, QName xmlType) * public <constructor>() * @param factory class - * @param QName xmlType - * @param Class javaType + * @param xmlType + * @param javaType */ public static SerializerFactory createFactory(Class factory, Class javaType, 1.7 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializerFactory.java Index: BeanSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializerFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BeanSerializerFactory.java 17 Sep 2002 22:55:47 -0000 1.6 +++ BeanSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.7 @@ -85,7 +85,7 @@ protected BeanPropertyDescriptor[] propertyDescriptor = null; public BeanSerializerFactory(Class javaType, QName xmlType) { - super(BeanSerializer.class, false, xmlType, javaType); + super(BeanSerializer.class, xmlType, javaType); // Sometimes an Enumeration class is registered as a Bean. // If this is the case, silently switch to the EnumSerializer if (JavaUtils.isEnumClass(javaType)) { 1.3 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/CalendarSerializerFactory.java Index: CalendarSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/CalendarSerializerFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CalendarSerializerFactory.java 11 Jun 2002 14:53:55 -0000 1.2 +++ CalendarSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.3 @@ -63,6 +63,6 @@ */ public class CalendarSerializerFactory extends BaseSerializerFactory { public CalendarSerializerFactory(Class javaType, QName xmlType) { - super(CalendarSerializer.class, true, xmlType, javaType); // true indicates shared class + super(CalendarSerializer.class, xmlType, javaType); // true indicates shared class } } 1.4 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/DateSerializerFactory.java Index: DateSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/DateSerializerFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DateSerializerFactory.java 11 Jun 2002 14:53:55 -0000 1.3 +++ DateSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.4 @@ -76,6 +76,6 @@ */ public class DateSerializerFactory extends BaseSerializerFactory { public DateSerializerFactory(Class javaType, QName xmlType) { - super(DateSerializer.class, true, xmlType, javaType); // true indicates shared class + super(DateSerializer.class, xmlType, javaType); // true indicates shared class } } 1.4 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/ElementSerializerFactory.java Index: ElementSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ElementSerializerFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ElementSerializerFactory.java 11 Jun 2002 14:53:55 -0000 1.3 +++ ElementSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.4 @@ -76,6 +76,6 @@ */ public class ElementSerializerFactory extends BaseSerializerFactory { public ElementSerializerFactory() { - super(ElementSerializer.class, true); // Share ElementSerializer instance + super(ElementSerializer.class); // Share ElementSerializer instance } } 1.4 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/EnumSerializerFactory.java Index: EnumSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/EnumSerializerFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- EnumSerializerFactory.java 11 Jun 2002 14:53:55 -0000 1.3 +++ EnumSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.4 @@ -76,6 +76,6 @@ */ public class EnumSerializerFactory extends BaseSerializerFactory { public EnumSerializerFactory(Class javaType, QName xmlType) { - super(EnumSerializer.class, true, xmlType, javaType); // Share EnumSerializer instance + super(EnumSerializer.class, xmlType, javaType); // Share EnumSerializer instance } } 1.5 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializerFactory.java Index: HexSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializerFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HexSerializerFactory.java 11 Jun 2002 14:53:56 -0000 1.4 +++ HexSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.5 @@ -76,6 +76,6 @@ */ public class HexSerializerFactory extends BaseSerializerFactory { public HexSerializerFactory(Class javaType, QName xmlType) { - super(HexSerializer.class, true, xmlType, javaType); // Share HexSerializer instance + super(HexSerializer.class, xmlType, javaType); // Share HexSerializer instance } } 1.5 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializerFactory.java Index: JAFDataHandlerSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializerFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JAFDataHandlerSerializerFactory.java 26 Aug 2002 13:10:21 -0000 1.4 +++ JAFDataHandlerSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.5 @@ -71,10 +71,10 @@ public class JAFDataHandlerSerializerFactory extends BaseSerializerFactory { public JAFDataHandlerSerializerFactory(Class javaType, QName xmlType) { - super(getSerializerClass(javaType, xmlType), false, xmlType, javaType); + super(getSerializerClass(javaType, xmlType), xmlType, javaType); } public JAFDataHandlerSerializerFactory() { - super(JAFDataHandlerSerializer.class, false); + super(JAFDataHandlerSerializer.class); } private static Class getSerializerClass(Class javaType, QName xmlType) { 1.6 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/MapSerializerFactory.java Index: MapSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/MapSerializerFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MapSerializerFactory.java 11 Jun 2002 14:53:56 -0000 1.5 +++ MapSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.6 @@ -86,6 +86,6 @@ public class MapSerializerFactory extends BaseSerializerFactory { public MapSerializerFactory(Class javaType, QName xmlType) { - super(MapSerializer.class, false, xmlType, javaType); + super(MapSerializer.class, xmlType, javaType); } } 1.3 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/QNameSerializerFactory.java Index: QNameSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/QNameSerializerFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- QNameSerializerFactory.java 11 Jun 2002 14:53:56 -0000 1.2 +++ QNameSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.3 @@ -62,6 +62,6 @@ */ public class QNameSerializerFactory extends BaseSerializerFactory { public QNameSerializerFactory(Class javaType, QName xmlType) { - super(QNameSerializer.class, true, xmlType, javaType); // true indicates shared class + super(QNameSerializer.class, xmlType, javaType); // true indicates shared class } } 1.6 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializerFactory.java Index: VectorSerializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializerFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- VectorSerializerFactory.java 11 Jun 2002 14:53:56 -0000 1.5 +++ VectorSerializerFactory.java 26 Sep 2002 17:04:01 -0000 1.6 @@ -86,6 +86,6 @@ public class VectorSerializerFactory extends BaseSerializerFactory { public VectorSerializerFactory(Class javaType, QName xmlType) { - super(VectorSerializer.class, false, xmlType, javaType); + super(VectorSerializer.class, xmlType, javaType); } } 1.1 xml-axis/java/src/org/apache/axis/encoding/ser/SimpleSerializerFactory.java Index: SimpleSerializerFactory.java =================================================================== /* * The Apache Software License, Version 1.1 * * * Copyright (c) 2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Axis" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ /** * @author Glen Daniels ([EMAIL PROTECTED]) */ package org.apache.axis.encoding.ser; import javax.xml.namespace.QName; public class SimpleSerializerFactory extends BaseSerializerFactory { /** * Note that the factory is constructed with the QName and xmlType. This is important * to allow distinction between primitive values and java.lang wrappers. **/ public SimpleSerializerFactory(Class javaType, QName xmlType) { super(SimpleSerializer.class, xmlType, javaType); } } 1.65 +2 -2 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java Index: JavaDeployWriter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- JavaDeployWriter.java 22 Sep 2002 06:13:42 -0000 1.64 +++ JavaDeployWriter.java 26 Sep 2002 17:04:02 -0000 1.65 @@ -241,10 +241,10 @@ serializerFactory = "org.apache.axis.encoding.ser.EnumSerializerFactory"; deserializerFactory = "org.apache.axis.encoding.ser.EnumDeserializerFactory"; } else if (type.isSimpleType()) { - serializerFactory = "org.apache.axis.encoding.ser.SimpleNonPrimitiveSerializerFactory"; + serializerFactory = "org.apache.axis.encoding.ser.SimpleSerializerFactory"; deserializerFactory = "org.apache.axis.encoding.ser.SimpleDeserializerFactory"; } else if (type.getBaseType() != null) { - serializerFactory = "org.apache.axis.encoding.ser.SimplePrimitiveSerializerFactory"; + serializerFactory = "org.apache.axis.encoding.ser.SimpleSerializerFactory"; deserializerFactory = "org.apache.axis.encoding.ser.SimpleDeserializerFactory"; } else { serializerFactory = "org.apache.axis.encoding.ser.BeanSerializerFactory"; 1.97 +1 -1 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java Index: JavaStubWriter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- JavaStubWriter.java 18 Sep 2002 16:10:36 -0000 1.96 +++ JavaStubWriter.java 26 Sep 2002 17:04:02 -0000 1.97 @@ -409,7 +409,7 @@ pw.println(" java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;"); pw.println(" java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;"); pw.println(" java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;"); - pw.println(" java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleNonPrimitiveSerializerFactory.class;"); + pw.println(" java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;"); pw.println(" java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;"); if (hasMIME) { 1.19 +2 -2 xml-axis/java/test/encoding/TestAttributes.java Index: TestAttributes.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/encoding/TestAttributes.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- TestAttributes.java 24 Sep 2002 14:40:20 -0000 1.18 +++ TestAttributes.java 26 Sep 2002 17:04:02 -0000 1.19 @@ -12,7 +12,7 @@ import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.encoding.ser.SimpleDeserializerFactory; -import org.apache.axis.encoding.ser.SimpleNonPrimitiveSerializerFactory; +import org.apache.axis.encoding.ser.SimpleSerializerFactory; import org.apache.axis.message.RPCElement; import org.apache.axis.message.RPCParam; import org.apache.axis.message.SOAPEnvelope; @@ -147,7 +147,7 @@ QName beanQName = new QName("typeNS", "Bean"); tm.register(SimpleBean.class, beanQName, - new SimpleNonPrimitiveSerializerFactory(SimpleBean.class, beanQName), + new SimpleSerializerFactory(SimpleBean.class, beanQName), new SimpleDeserializerFactory(SimpleBean.class, beanQName)); // Serialize the bean in to XML