//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/willow
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : willow@lists.sourceforge.net 
 */
//----------------------------END  LICENSE----------------------------

package org.huihoo.workflow.xpdl.serializer;

import java.util.Hashtable;

import org.huihoo.workflow.WorkflowException;
import org.huihoo.workflow.WorkflowGlobals;

public abstract class XPDLSerializerFactory
{
	protected XPDLSerializerFactory()
	{
	}

	public static XPDLSerializerFactory newInstance(Hashtable env) throws FactoryConfigurationError
	{
		try
		{
			return (XPDLSerializerFactory) FactoryFinder.find(
				(String) env.get(WorkflowGlobals.XPDL_SERIALIZER_FACTORY_KEY),
				"org.huihoo.workflow.coreImpl.xpdl.serializer.XPDLSerializerFactoryImpl");
		}
		catch (FactoryFinder.ConfigurationError e)
		{
			throw new FactoryConfigurationError(e.getException(), e.getMessage());
		}
	}

	public abstract XPDLSerializer newXPDLSerializer() throws WorkflowException;
}
