You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2002/07/22 22:10:05 UTC

cvs commit: xml-axis/java/samples/encoding DataSer.java

gdaniels    2002/07/22 13:10:05

  Modified:    java/src/org/apache/axis/deployment/wsdd WSDDDeployment.java
               java/src/org/apache/axis/encoding/ser VectorSerializer.java
                        MapSerializer.java BeanSerializer.java
                        ArraySerializer.java
               java/test/encoding TestMultiRefIdentity.java DataSer.java
               java/src/org/apache/axis/encoding
                        SerializationContextImpl.java
                        SerializationContext.java
               java/src/org/apache/axis/message RPCParam.java
                        MessageElement.java
               java/samples/encoding DataSer.java
  Log:
  Refactoring for cleanliness and efficiency.
  
  Remove javaType arguments from serializationContext methods,
  since we're either a) passing null, in which case the sendNull argument
  tells us how to behave, or b) passing a value, in which case getClass()
  works just fine (and notice how many instances of getClass() are now
  unnecessary which were being used before).
  
  Still more cleanup to do, but this removes a bunch of code and passes
  all the tests.
  
  Revision  Changes    Path
  1.42      +0 -1      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java
  
  Index: WSDDDeployment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- WSDDDeployment.java	3 Jul 2002 17:50:33 -0000	1.41
  +++ WSDDDeployment.java	22 Jul 2002 20:10:04 -0000	1.42
  @@ -55,7 +55,6 @@
   package org.apache.axis.deployment.wsdd;
   
   import org.apache.axis.AxisEngine;
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.ConfigurationException;
   import org.apache.axis.Constants;
   import org.apache.axis.EngineConfiguration;
  
  
  
  1.11      +1 -10     xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializer.java
  
  Index: VectorSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- VectorSerializer.java	3 Jul 2002 17:50:22 -0000	1.10
  +++ VectorSerializer.java	22 Jul 2002 20:10:04 -0000	1.11
  @@ -56,26 +56,18 @@
   package org.apache.axis.encoding.ser;
   
   import org.xml.sax.Attributes;
  -import org.xml.sax.SAXException;
   
   import javax.xml.namespace.QName;
   
   import java.io.IOException;
   
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.wsdl.fromJava.Types;
   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 org.apache.axis.utils.JavaUtils;
   
   import java.io.IOException;
  -import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Vector;
   
  @@ -83,7 +75,6 @@
   import org.apache.commons.logging.Log;
   
   import org.w3c.dom.Element;
  -import org.w3c.dom.Document;
   
   /**
    * A <code>VectorSerializer</code> is be used to serialize and
  @@ -124,7 +115,7 @@
           for (Iterator i = vector.iterator(); i.hasNext(); )
           {
               Object item = i.next();
  -            context.serialize(Constants.QNAME_LITERAL_ITEM,  null, item, (item!=null ? item.getClass(): null) );
  +            context.serialize(Constants.QNAME_LITERAL_ITEM,  null, item);
           }
           context.endElement();
       }
  
  
  
  1.14      +2 -3      xml-axis/java/src/org/apache/axis/encoding/ser/MapSerializer.java
  
  Index: MapSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/MapSerializer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MapSerializer.java	3 Jul 2002 17:50:22 -0000	1.13
  +++ MapSerializer.java	22 Jul 2002 20:10:04 -0000	1.14
  @@ -55,7 +55,6 @@
   
   package org.apache.axis.encoding.ser;
   
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.Serializer;
  @@ -124,8 +123,8 @@
   
               context.startElement(QNAME_ITEM, null);
   
  -            context.serialize(QNAME_KEY,   null, key, (key!=null ? key.getClass(): null) );
  -            context.serialize(QNAME_VALUE, null, val, (val!=null ? val.getClass(): null));
  +            context.serialize(QNAME_KEY,   null, key);
  +            context.serialize(QNAME_VALUE, null, val);
   
               context.endElement();
           }
  
  
  
  1.44      +20 -29    xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializer.java
  
  Index: BeanSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializer.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- BeanSerializer.java	22 Jul 2002 12:43:49 -0000	1.43
  +++ BeanSerializer.java	22 Jul 2002 20:10:04 -0000	1.44
  @@ -137,13 +137,13 @@
   
           // Get the encoding style
           String encodingStyle = context.getMessageContext().getEncodingStyle();
  -        
  +
           // check whether we have and xsd:any namespace="##any" type
           boolean suppressElement = !context.getMessageContext().isEncoded() &&
  -                                  name.getNamespaceURI().equals("") && 
  +                                  name.getNamespaceURI().equals("") &&
                                     name.getLocalPart().equals("any");
   
  -        if (!suppressElement) 
  +        if (!suppressElement)
               context.startElement(name, beanAttrs);
   
           try {
  @@ -179,27 +179,21 @@
   
                   // Read the value from the property
                   if(propertyDescriptor[i].isReadable()) {
  -                    Class baseJavaType = propertyDescriptor[i].getType();
  -                    Class javaType;
                       if (!propertyDescriptor[i].isIndexed()) {
                           // Normal case: serialize the value
  -                        Object propValue = 
  +                        Object propValue =
                               propertyDescriptor[i].get(value);
                           // if meta data says minOccurs=0, then we can skip
                           // it if its value is null and we aren't doing SOAP
                           // encoding.
  -                        if (propValue == null && 
  +                        if (propValue == null &&
                                   isOmittable &&
                                   !Constants.isSOAP_ENC(encodingStyle))
                               continue;
  -                        
  -                        javaType = (propValue == null || 
  -                                    baseJavaType.isPrimitive())
  -                            ? baseJavaType : propValue.getClass();
  +
                           context.serialize(qname,
                                             null,
                                             propValue,
  -                                          javaType,
                                             context.getQNameForClass(javaType),
                                             true,
                                             null);
  @@ -209,18 +203,15 @@
                           while(j >= 0) {
                               Object propValue = null;
                               try {
  -                                propValue = 
  +                                propValue =
                                       propertyDescriptor[i].get(value, j);
                                   j++;
                               } catch (Exception e) {
                                   j = -1;
                               }
                               if (j >= 0) {
  -                                javaType = (propValue == null || 
  -                                            baseJavaType.isPrimitive())
  -                                    ? baseJavaType : propValue.getClass();
                                   context.serialize(qname, null,
  -                                                  propValue, javaType);
  +                                                  propValue);
                               }
                           }
                       }
  @@ -235,7 +226,7 @@
               throw new IOException(e.toString());
           }
   
  -        if (!suppressElement) 
  +        if (!suppressElement)
               context.endElement();
       }
   
  @@ -320,10 +311,10 @@
                           writeProperty = false;
                       }
                   }
  -            }            
  +            }
               if (!writeProperty) {
                   continue;
  -            }                
  +            }
   
               // If we have type metadata, check to see what we're doing
               // with this field.  If it's an attribute, skip it.  If it's
  @@ -352,8 +343,8 @@
                           writeField(types,
                                      propName,
                                      propertyDescriptor[i].getType(),
  -                                   propertyDescriptor[i].isIndexed(), 
  -                                   field.isMinOccursIs0(), 
  +                                   propertyDescriptor[i].isIndexed(),
  +                                   field.isMinOccursIs0(),
                                      all);
                       }
                   } else {
  @@ -464,7 +455,7 @@
                       qname = new QName("", propName);
                   }
   
  -                if (propertyDescriptor[i].isReadable() && 
  +                if (propertyDescriptor[i].isReadable() &&
                       !propertyDescriptor[i].isIndexed()) {
                       // add to our attributes
                       Object propValue = propertyDescriptor[i].get(value);
  @@ -474,7 +465,7 @@
                       // serialize if the attribute matches the default value.
                       if (propValue != null) {
                           setAttributeProperty(propValue, qname, attrs, context);
  -                    } 
  +                    }
                   }
               }
           } catch (Exception e) {
  @@ -485,15 +476,15 @@
           return attrs;
       }
   
  -    private void setAttributeProperty(Object propValue, 
  -                                      QName qname, 
  -                                      AttributesImpl attrs, 
  +    private void setAttributeProperty(Object propValue,
  +                                      QName qname,
  +                                      AttributesImpl attrs,
                                         SerializationContext context) throws Exception {
           StringWriter writer = new StringWriter();
           SerializationContext attributeContext = new AttributeSerializationContextImpl(writer, context);
           attributeContext.serialize(qname,
                                      null,
  -                                   propValue, propValue.getClass());
  +                                   propValue);
           writer.close();
           String propString = writer.getBuffer().toString();
           String namespace = qname.getNamespaceURI();
  @@ -504,5 +495,5 @@
                              context.attributeQName2String(qname),
                              "CDATA",
                              propString);
  -    } 
  +    }
   }
  
  
  
  1.28      +3 -7      xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
  
  Index: ArraySerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- ArraySerializer.java	22 Jul 2002 12:43:49 -0000	1.27
  +++ ArraySerializer.java	22 Jul 2002 20:10:04 -0000	1.28
  @@ -55,7 +55,6 @@
   
   package org.apache.axis.encoding.ser;
   
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.Serializer;
  @@ -278,10 +277,9 @@
               if (list == null) {
                   for (int index = 0; index < len; index++) {
                       Object aValue = Array.get(value, index);
  -                    Class aClass = (aValue == null) ? null : aValue.getClass();
   
                       // Serialize the element.
  -                    context.serialize(elementName, null, aValue, aClass,
  +                    context.serialize(elementName, null, aValue,
                                         componentQName, // prefered type QName
                                         true,   // Send null values
                                         Boolean.FALSE); // Don't send xsi:type if it matches preferred QName
  @@ -289,10 +287,9 @@
               } else {
                   for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                       Object aValue = (Object)iterator.next();
  -                    Class aClass = (aValue == null) ? null : aValue.getClass();
   
                       // Serialize the element.
  -                    context.serialize(elementName, null, aValue, aClass,
  +                    context.serialize(elementName, null, aValue,
                                         componentQName, // prefered type QName
                                         true,   // Send null values
                                         Boolean.FALSE); // Don't send xsi:type if it matches preferred QName
  @@ -304,8 +301,7 @@
               for (int index = 0; index < len; index++) {
                   for (int index2 = 0; index2 < dim2Len; index2++) {
                       Object aValue = Array.get(Array.get(value, index), index2);
  -                    Class aClass = (aValue == null) ? null : aValue.getClass();
  -                    context.serialize(elementName, null, aValue, aClass);
  +                    context.serialize(elementName, null, aValue);
                   }
               }
           }
  
  
  
  1.2       +12 -12    xml-axis/java/test/encoding/TestMultiRefIdentity.java
  
  Index: TestMultiRefIdentity.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestMultiRefIdentity.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestMultiRefIdentity.java	3 Jul 2002 22:28:13 -0000	1.1
  +++ TestMultiRefIdentity.java	22 Jul 2002 20:10:05 -0000	1.2
  @@ -109,8 +109,8 @@
           CharArrayWriter caw = new CharArrayWriter();
           SerializationContextImpl sci = new SerializationContextImpl(caw);
           sci.setDoMultiRefs(true);
  -        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanA.class);
  -        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanA.class);
  +        sci.serialize(new QName("someLocalPart"), null, tb1);
  +        sci.serialize(new QName("someOtherLocalPart"), null, tb2);
           
           String s = caw.toString();
           
  @@ -132,8 +132,8 @@
           CharArrayWriter caw = new CharArrayWriter();
           SerializationContextImpl sci = new SerializationContextImpl(caw);
           sci.setDoMultiRefs(true);
  -        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanB.class);
  -        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanB.class);
  +        sci.serialize(new QName("someLocalPart"), null, tb1);
  +        sci.serialize(new QName("someOtherLocalPart"), null, tb2);
           
           String s = caw.toString();
           
  @@ -156,8 +156,8 @@
           CharArrayWriter caw = new CharArrayWriter();
           SerializationContextImpl sci = new SerializationContextImpl(caw);
           sci.setDoMultiRefs(true);
  -        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanA.class);
  -        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanA.class);
  +        sci.serialize(new QName("someLocalPart"), null, tb1);
  +        sci.serialize(new QName("someOtherLocalPart"), null, tb2);
           
           String s = caw.toString();
           
  @@ -180,8 +180,8 @@
           CharArrayWriter caw = new CharArrayWriter();
           SerializationContextImpl sci = new SerializationContextImpl(caw);
           sci.setDoMultiRefs(true);
  -        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanA.class);
  -        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanA.class);
  +        sci.serialize(new QName("someLocalPart"), null, tb1);
  +        sci.serialize(new QName("someOtherLocalPart"), null, tb2);
           
           String s = caw.toString();
           
  @@ -204,8 +204,8 @@
           CharArrayWriter caw = new CharArrayWriter();
           SerializationContextImpl sci = new SerializationContextImpl(caw);
           sci.setDoMultiRefs(true);
  -        sci.serialize(new QName("someLocalPart"), null, tb1, TestBeanB.class);
  -        sci.serialize(new QName("someOtherLocalPart"), null, tb2, TestBeanB.class);
  +        sci.serialize(new QName("someLocalPart"), null, tb1);
  +        sci.serialize(new QName("someOtherLocalPart"), null, tb2);
           
           String s = caw.toString();
           
  
  
  
  1.14      +2 -5      xml-axis/java/test/encoding/DataSer.java
  
  Index: DataSer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/DataSer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DataSer.java	11 Jun 2002 14:54:02 -0000	1.13
  +++ DataSer.java	22 Jul 2002 20:10:05 -0000	1.14
  @@ -2,16 +2,13 @@
   
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.encoding.Serializer;
  -import org.apache.axis.message.SOAPHandler;
   import org.apache.axis.Constants;
   import org.xml.sax.Attributes;
  -import org.xml.sax.SAXException;
   import org.apache.axis.Constants;
   import org.apache.axis.wsdl.fromJava.Types;
   
   import javax.xml.namespace.QName;
   import java.io.IOException;
  -import java.util.Hashtable;
   
   public class DataSer implements Serializer
   {
  @@ -37,8 +34,8 @@
           Data data = (Data)value;
   
           context.startElement(name, attributes);
  -        context.serialize(new QName("", STRINGMEMBER), null, data.stringMember, String.class);
  -        context.serialize(new QName("", FLOATMEMBER), null, data.floatMember, float.class);
  +        context.serialize(new QName("", STRINGMEMBER), null, data.stringMember);
  +        context.serialize(new QName("", FLOATMEMBER), null, data.floatMember);
           context.endElement();
       }
       public String getMechanismType() { return Constants.AXIS_SAX; }
  
  
  
  1.46      +27 -37    xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
  
  Index: SerializationContextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- SerializationContextImpl.java	22 Jul 2002 12:43:49 -0000	1.45
  +++ SerializationContextImpl.java	22 Jul 2002 20:10:05 -0000	1.46
  @@ -88,7 +88,6 @@
   import javax.xml.rpc.JAXRPCException;
   import java.io.IOException;
   import java.io.Writer;
  -import java.lang.reflect.Modifier;
   import java.util.ArrayList;
   import java.util.Calendar;
   import java.util.Date;
  @@ -153,16 +152,13 @@
   
       class MultiRefItem {
           String id;
  -        Class javaType;
           QName xmlType;
           Boolean sendType;
           Object value;
           MultiRefItem(String id,
  -                     Class javaType,
                        QName xmlType,
                        Boolean sendType, Object value) {
               this.id = id;
  -            this.javaType = javaType;
               this.xmlType = xmlType;
               this.sendType = sendType;
               this.value = value;
  @@ -479,14 +475,14 @@
        * is serialized directly instead of using id/href pairs.  Thus
        * primitive serialization/deserialization is slightly faster.
        * @param value to be serialized
  -     * @param javaType is the "real" java type of value.  Used to distinguish
  -     * between java primitives and their wrapper classes.
        * @return true/false
        */
  -    public boolean isPrimitive(Object value, Class javaType)
  +    public boolean isPrimitive(Object value)
       {
           if (value == null) return true;
   
  +        Class javaType = value.getClass();
  +
           if (javaType.isPrimitive()) return true;
   
           if (javaType == String.class) return true;
  @@ -555,14 +551,12 @@
        * @param elemQName is the QName of the element
        * @param attributes are additional attributes
        * @param value is the object to serialize
  -     * @param javaType is the "real" type of the value.
        */
       public void serialize(QName elemQName,
                             Attributes attributes,
  -                          Object value,
  -                          Class javaType)
  +                          Object value)
           throws IOException {
  -        serialize(elemQName, attributes, value, javaType, null, true, null);
  +        serialize(elemQName, attributes, value, null, true, null);
       }
   
       /**
  @@ -583,7 +577,6 @@
        * @param elemQName is the QName of the element
        * @param attributes are additional attributes
        * @param value is the object to serialize
  -     * @param javaType is the "real" type of the value.
        * @param xmlType is the qname of the type or null.
        * @param sendNull determines whether to send null values.
        * @param sendType determines whether to set xsi:type attribute.
  @@ -591,7 +584,6 @@
       public void serialize(QName elemQName,
                             Attributes attributes,
                             Object value,
  -                          Class javaType,
                             QName xmlType,
                             boolean sendNull,
                             Boolean sendType)
  @@ -599,6 +591,7 @@
       {
           boolean shouldSendType = (sendType == null) ? shouldSendXSIType() :
               sendType.booleanValue();
  +
           if (value == null) {
               // If the value is null, the element is
               // passed with xsi:nil="true" to indicate that no object is present.
  @@ -626,7 +619,7 @@
                   //Attachment support and this is an object that should be treated as an attachment.
   
                   //Allow an the attachment to do its own serialization.
  -                serializeActual(elemQName, attributes, value, javaType,
  +                serializeActual(elemQName, attributes, value,
                                   xmlType, sendType);
   
                   //No need to add to mulitRefs. Attachment data stream handled by
  @@ -649,7 +642,7 @@
           // hashCode() and equals() methods have been overloaded to make two
           // Objects appear equal.
   
  -        if (doMultiRefs && (value != forceSer) && !isPrimitive(value, javaType)) {
  +        if (doMultiRefs && (value != forceSer) && !isPrimitive(value)) {
               if (multiRefIndex == -1)
                   multiRefValues = new HashMap();
   
  @@ -663,7 +656,7 @@
                   // it for next time.
                   multiRefIndex++;
                   id = "id" + multiRefIndex;
  -                mri = new MultiRefItem (id, javaType, xmlType, sendType, value);
  +                mri = new MultiRefItem (id, xmlType, sendType, value);
                   multiRefValues.put(getIdentityKey(value), mri);
   
                   /** If we're in the middle of writing out
  @@ -710,7 +703,7 @@
               forceSer = null;
   
           // Actually serialize the value.  (i.e. not an href like above)
  -        serializeActual(elemQName, attributes, value, javaType, xmlType, sendType);
  +        serializeActual(elemQName, attributes, value, xmlType, sendType);
       }
   
       /**
  @@ -778,7 +771,7 @@
                   // Some of the remote services do not know how to
                   // ascertain the type in these circumstances (though Axis does).
                   serialize(multirefQName, attrs, mri.value,
  -                          mri.javaType, mri.xmlType,
  +                          mri.xmlType,
                             true,
                             null);   // mri.sendType
               }
  @@ -1081,16 +1074,12 @@
        * @param elemQName is the QName of the element
        * @param attributes are additional attributes
        * @param value is the object to serialize
  -     * @param javaType is the "real" type of the value.  For primitives, the value is the
  -     * associated java.lang class.  So the javaType is needed to know that the value
  -     * is really a wrapped primitive.
        * @param xmlType (optional) is the desired type QName.
        * @param sendType indicates whether the xsi:type attribute should be set.
        */
       public void serializeActual(QName elemQName,
                                   Attributes attributes,
                                   Object value,
  -                                Class javaType,
                                   QName xmlType,
                                   Boolean sendType)
           throws IOException
  @@ -1099,6 +1088,7 @@
               sendType.booleanValue();
   
           if (value != null) {
  +            Class javaType = value.getClass();
               TypeMapping tm = getTypeMapping();
   
               if (tm == null) {
  @@ -1109,21 +1099,21 @@
               }
   
               SerializerInfo info = null;
  -            // If the javaType is abstract, try getting a
  -            // serializer that matches the value's class.
  -            if (javaType != null &&
  -                !javaType.isPrimitive() &&
  -                !javaType.isArray() &&
  -                !isPrimitive(value, javaType) &&
  -                Modifier.isAbstract(javaType.getModifiers())) {
  -                info = getSerializer(value.getClass(), value);
  -                if (info != null) {
  -                    // Successfully found a serializer for the derived object.
  -                    // Must serialize the type.
  -                    shouldSendType = true;
  -                    xmlType = null;
  -                }
  -            }
  +//            // If the javaType is abstract, try getting a
  +//            // serializer that matches the value's class.
  +//            if (javaType != null &&
  +//                !javaType.isPrimitive() &&
  +//                !javaType.isArray() &&
  +//                !isPrimitive(value, javaType) &&
  +//                Modifier.isAbstract(javaType.getModifiers())) {
  +//                info = getSerializer(value.getClass(), value);
  +//                if (info != null) {
  +//                    // Successfully found a serializer for the derived object.
  +//                    // Must serialize the type.
  +//                    shouldSendType = true;
  +//                    xmlType = null;
  +//                }
  +//            }
               // Try getting a serializer for the prefered xmlType
               if (info == null && xmlType != null) {
                   info = getSerializer(javaType, xmlType);
  
  
  
  1.79      +2 -14     xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- SerializationContext.java	22 Jul 2002 12:43:49 -0000	1.78
  +++ SerializationContext.java	22 Jul 2002 20:10:05 -0000	1.79
  @@ -90,12 +90,10 @@
        * @param elemQName is the QName of the element
        * @param attributes are additional attributes
        * @param value is the object to serialize
  -     * @param javaType is the "real" type of the value.
        */
       public void serialize(QName elemQName,
                             Attributes attributes,
  -                          Object value,
  -                          Class javaType)
  +                          Object value)
           throws IOException;
   
       /**
  @@ -104,8 +102,6 @@
        * The attributes are additional attribute to be serialized on the element.
        * The value is the object being serialized.  (It may be serialized
        * directly or serialized as an mult-ref'd item)
  -     * The value is an Object, which may be a wrapped primitive, the
  -     * javaType is the actual unwrapped object type.
        * The xmlType (if specified) is the QName of the type that is used to set
        * xsi:type.  If not specified, xsi:type is set by using the javaType to
        * find an appopriate xmlType from the TypeMappingRegistry.
  @@ -116,7 +112,6 @@
        * @param elemQName is the QName of the element
        * @param attributes are additional attributes
        * @param value is the object to serialize
  -     * @param javaType is the "real" type of the value.
        * @param xmlType is the qname of the type or null. (default is null)
        * @param sendNull determines whether to send null values. (default is true)
        * @param sendType determines whether to set xsi:type attribute. (default is true)
  @@ -124,7 +119,6 @@
       public void serialize(QName elemQName,
                             Attributes attributes,
                             Object value,
  -                          Class javaType,
                             QName xmlType,
                             boolean sendNull,
                             Boolean sendType)
  @@ -136,16 +130,12 @@
        * @param elemQName is the QName of the element
        * @param attributes are additional attributes
        * @param value is the object to serialize
  -     * @param javaType is the "real" type of the value.  For primitives, the value is the
  -     * associated java.lang class.  So the javaType is needed to know that the value
  -     * is really a wrapped primitive.
        * @param xmlType (optional) is the desired type QName.
        * @param sendType indicates whether the xsi:type attribute should be set.
        */
       public void serializeActual(QName elemQName, 
                                   Attributes attributes,
                                   Object value, 
  -                                Class javaType,
                                   QName xmlType,
                                   Boolean sendType)
           throws IOException;
  @@ -277,11 +267,9 @@
        * is serialized directly instead of using id/href pairs.  Thus 
        * primitive serialization/deserialization is slightly faster.
        * @param value to be serialized
  -     * @param javaType is the "real" java type of value.  Used to distinguish
  -     * between java primitives and their wrapper classes.
        * @return true/false
        */
  -    public boolean isPrimitive(Object value, Class javaType);
  +    public boolean isPrimitive(Object value);
   
       /**
        * The serialize method uses hrefs to reference all non-primitive
  
  
  
  1.47      +1 -1      xml-axis/java/src/org/apache/axis/message/RPCParam.java
  
  Index: RPCParam.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCParam.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- RPCParam.java	22 Jul 2002 12:43:49 -0000	1.46
  +++ RPCParam.java	22 Jul 2002 20:10:05 -0000	1.47
  @@ -224,7 +224,7 @@
           context.serialize(qname,  // element qname
                             null,   // no extra attrs
                             value,  // value
  -                          javaType, xmlType, // java/xml type
  +                          xmlType, // java/xml type
                             true, wantXSIType); 
       }
   
  
  
  
  1.117     +1 -3      xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- MessageElement.java	22 Jul 2002 12:28:47 -0000	1.116
  +++ MessageElement.java	22 Jul 2002 20:10:05 -0000	1.117
  @@ -55,7 +55,6 @@
   
   package org.apache.axis.message;
   
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.MessageContext;
   import org.apache.axis.soap.SOAPConstants;
  @@ -749,8 +748,7 @@
           if (objectValue != null) {
               context.serialize(new QName(namespaceURI, name),
                                 attributes,
  -                              objectValue,
  -                              objectValue.getClass());
  +                              objectValue);
               return;
           }
   
  
  
  
  1.17      +3 -3      xml-axis/java/samples/encoding/DataSer.java
  
  Index: DataSer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/encoding/DataSer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DataSer.java	11 Jun 2002 14:53:49 -0000	1.16
  +++ DataSer.java	22 Jul 2002 20:10:05 -0000	1.17
  @@ -39,9 +39,9 @@
           Data data = (Data)value;
   
           context.startElement(name, attributes);
  -        context.serialize(new QName("", STRINGMEMBER), null, data.stringMember, String.class);
  -        context.serialize(new QName("", FLOATMEMBER), null, data.floatMember, float.class);
  -        context.serialize(new QName("", DATAMEMBER), null, data.dataMember, Data.class);
  +        context.serialize(new QName("", STRINGMEMBER), null, data.stringMember);
  +        context.serialize(new QName("", FLOATMEMBER), null, data.floatMember);
  +        context.serialize(new QName("", DATAMEMBER), null, data.dataMember);
           context.endElement();
       }
       public String getMechanismType() { return Constants.AXIS_SAX; }