package org.flymine.objectstore.webservice.ser;
 
/*
 * Copyright (C) 2002-2003 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import org.apache.axis.Constants;
import org.apache.axis.encoding.DeserializerFactory;
import javax.xml.rpc.encoding.Deserializer;

import java.util.Iterator;
import java.util.ArrayList;

/**
 * Produce DefaultDeserializers
 *
 * @author Mark Woodbridge
 */
public class DefaultDeserializerFactory implements DeserializerFactory
{
    private ArrayList mechanisms;

    /**
     * @see DeserializerFactory#getDeserializerAs
     */
    public Deserializer getDeserializerAs(String mechanismType) {
        return new DefaultDeserializer();
    }

    /**
     * @see DeserializerFactory#getSupportedMechanismTypes
     */
    public Iterator getSupportedMechanismTypes() {
        if (mechanisms == null) {
            mechanisms = new ArrayList();
            mechanisms.add(Constants.AXIS_SAX);
        }
        return mechanisms.iterator();
    }
}

@@ -352,34 +352,35 @@
 ort 
-org.apache.axis.Constants;
+javax.xml.namespace.QName;%0A
 %0Aimp
@@ -400,32 +400,40 @@
 e.axis.encoding.
+ser.Base
 DeserializerFact
@@ -439,108 +439,8 @@
 tory
-;%0Aimport javax.xml.rpc.encoding.Deserializer;%0A%0Aimport java.util.Iterator;%0Aimport java.util.ArrayList
 ;%0A%0A/
@@ -552,19 +552,20 @@
 ory 
-implement
+extend
 s 
+Base
 Dese
@@ -590,240 +590,189 @@
     
-private ArrayList mechanisms;%0A%0A    /**%0A     * @see DeserializerFactory#getDeserializerAs%0A     */%0A    public Deserializer getDeserializerAs(String mechanismType) %7B%0A        return new DefaultDeserializer();%0A    %7D%0A%0A
+/**%0A     * Constructor%0A     * @param javaType the type of the object to instantiate%0A     * @param xmlType the qname (tag) of the xml version of the object%0A 
     
-/*
 *
+/
 %0A    
- * @see 
+public Default
 Dese
@@ -790,91 +790,38 @@
 tory
-#getSupportedMechanismTypes%0A     */%0A    public Iterator getSupportedMechanism
+(Class javaType, QName xml
 Type
-s(
 ) %7B%0A
@@ -832,169 +832,58 @@
     
-if (mechanisms == null) %7B%0A            mechanisms = new ArrayList();%0A            mechanisms.add(Constants.AXIS_SAX);%0A        %7D%0A        return mechanisms.iterator(
+super(DefaultDeserializer.class, xmlType, javaType
 );%0A 

extend BaseDeserializerFactory so that we know which class to construct