axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/encoding ElementSerializer.java SOAPTypeMappingRegistry.java XMLType.java
Date Tue, 11 Dec 2001 18:40:33 GMT
dug         01/12/11 10:40:33

  Modified:    java/src/org/apache/axis/encoding ElementSerializer.java
                        SOAPTypeMappingRegistry.java XMLType.java
  Log:
  Add support for DOM's Element as a parameter type on an RPC call.
  
  Revision  Changes    Path
  1.3       +24 -1     xml-axis/java/src/org/apache/axis/encoding/ElementSerializer.java
  
  Index: ElementSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ElementSerializer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ElementSerializer.java	2001/11/06 21:52:28	1.2
  +++ ElementSerializer.java	2001/12/11 18:40:33	1.3
  @@ -61,6 +61,9 @@
   import org.xml.sax.SAXException;
   import org.w3c.dom.Element;
   
  +import org.apache.axis.message.MessageElement ;
  +import org.apache.axis.message.SOAPHandler ;
  +
   import javax.xml.rpc.namespace.QName;
   import java.io.IOException;
   
  @@ -69,7 +72,7 @@
    *
    * @author Glen Daniels (gdaniels@macromedia.com)
    */
  -public class ElementSerializer implements Serializer {
  +public class ElementSerializer extends Deserializer implements Serializer {
       /** 
        * Serialize a DOM Element
        */
  @@ -81,5 +84,25 @@
               throw new IOException(JavaUtils.getMessage("cantSerialize01"));
           
           context.writeDOMElement((Element)value);
  +    }
  +
  +    // Our static deserializer factory
  +    public static class Factory implements DeserializerFactory {
  +        public Deserializer getDeserializer(Class cls) {
  +            return new ElementSerializer();
  +        }
  +    }
  +    public static DeserializerFactory factory = new Factory();
  +
  +    public final void onEndElement(String namespace, String localName,
  +                           DeserializationContext context)
  +                               throws SAXException
  +    {
  +        try {
  +            value = context.getCurElement().getAsDOM();
  +        }
  +        catch( Exception exp ) {
  +            throw new SAXException( exp );
  +        }
       }
   }
  
  
  
  1.50      +4 -3      xml-axis/java/src/org/apache/axis/encoding/SOAPTypeMappingRegistry.java
  
  Index: SOAPTypeMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SOAPTypeMappingRegistry.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- SOAPTypeMappingRegistry.java	2001/12/10 17:28:03	1.49
  +++ SOAPTypeMappingRegistry.java	2001/12/11 18:40:33	1.50
  @@ -97,6 +97,7 @@
       public static final QName SOAP_ARRAY = new QName(Constants.URI_SOAP_ENC, "Array");
   
       public static final QName TYPE_MAP = new QName("http://xml.apache.org/xml-soap", "Map");
  +    public static final QName TYPE_ELEMENT = new QName("http://xml.apache.org/xml-soap",
"Element");
       public static final QName TYPE_VECTOR = new QName("http://xml.apache.org/xml-soap",
"Vector");
   
       public static       QName XSD_DATE;
  @@ -315,10 +316,10 @@
                         new MapSerializer());
           addDeserializerFactory(TYPE_MAP, java.util.HashMap.class,
                                  MapSerializer.factory);
  -        
  -        // only serializer
  -        addSerializer(org.w3c.dom.Element.class, null,
  +        addSerializer(org.w3c.dom.Element.class, TYPE_ELEMENT,
                         new ElementSerializer());
  +        addDeserializerFactory(TYPE_ELEMENT, org.w3c.dom.Element.class,
  +                               ElementSerializer.factory);
   
           // only deserializer
           addDeserializerFactory(TYPE_VECTOR, java.util.Vector.class,
  
  
  
  1.11      +1 -0      xml-axis/java/src/org/apache/axis/encoding/XMLType.java
  
  Index: XMLType.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/XMLType.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- XMLType.java	2001/10/30 16:46:37	1.10
  +++ XMLType.java	2001/12/11 18:40:33	1.11
  @@ -93,6 +93,7 @@
       public static final XMLType SOAP_ARRAY = new XMLType(new QName(Constants.URI_SOAP_ENC,
"Array"));
   
       public static final XMLType TYPE_MAP = new XMLType(new QName("http://xml.apache.org/xml-soap",
"Map"));
  +    public static final XMLType TYPE_ELEMENT = new XMLType(new QName("http://xml.apache.org/xml-soap",
"Element"));
   
       public static       XMLType XSD_DATE;
       
  
  
  

Mime
View raw message