package org.flymine.dataconversion;

/*
 * 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.
 *
 */

 /**
 * Abstract parent class of all DataConverters
 * @author Mark Woodbridge
 */
 public abstract class DataConverter
{
    protected ItemWriter writer;

    /**
    * Constructor that should be called by children
    * @param writer an ItemWriter used to handle the resultant Items
    */
    public DataConverter(ItemWriter writer) {
        this.writer = writer;
    }

    /**
    * Perform the data conversion
    * @throws Exception if an error occurs during processing
    */
    public abstract void process() throws Exception;
}

@@ -328,17 +328,66 @@
  *%0A */%0A%0A
- 
+import java.util.Map;%0Aimport java.util.HashMap;%0A %0A
 /**%0A * A
@@ -531,16 +531,92 @@
  writer;
+%0A    protected Map aliases = new HashMap();%0A    protected int nextClsId = 0;
 %0A%0A    /*
@@ -930,32 +930,32 @@
 ocessing%0A    */%0A
-
     public abstr
@@ -990,11 +990,416 @@
 ception;
+%0A%0A    /**%0A     * Uniquely alias a className%0A     * @param className the class name%0A     * @return the alias%0A     */%0A    protected String alias(String className) %7B%0A        String alias = (String) aliases.get(className);%0A        if (alias != null) %7B%0A            return alias;%0A        %7D%0A        String nextIndex = %22%22 + (nextClsId++);%0A        aliases.put(className, nextIndex);%0A        return nextIndex;%0A    %7D
 %0A%7D%0A

Add functionality to alias classes