/*
 * Created on 2004-6-23
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.store.factory;

import java.util.Hashtable;

import workflow.WorkflowException;
import workflow.wfmc.xpdl.parser.XPDLParser;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public abstract class XPDLParserFactory
{
	private boolean validating = false;

	protected XPDLParserFactory()
	{
	}

	public static XPDLParserFactory newInstance(Hashtable env) throws FactoryConfigurationError
	{
		try
		{
			return (XPDLParserFactory) FactoryFinder.find(
				(String) env.get(Constants.WORKFLOW_FACTORY_XPDL),
				"com.zosatapo.workflow.store.factory.XPDLParserFactoryImpl");
		}
		catch (FactoryFinder.ConfigurationError e)
		{
			throw new FactoryConfigurationError(e.getException(), e.getMessage());
		}
	}

	public abstract XPDLParser newXPDLParser() throws WorkflowException;

	/**
		* Specifies that the parser produced by this code will
		* validate package as they are parsed. By default the value of this
		* is set to <code>false</code>.
		*
		* @param validating true if the parser produced will validate package
		*                   as they are parsed; false otherwise.
		*/

	public void setValidating(boolean validating)
	
	{
		this.validating = validating;
	}

	/**
			* Indicates whether or not the factory is configured to produce
			* parsers which validate the package content during parse.
			*
			* @return  true if the factory is configured to produce parsers
			*          which validate the package content during parse; false otherwise.
			*/

	public boolean isValidating()
	{
		return validating;
	}
}
