/*
 * Copyright
 *   2007 axYus - www.axyus.com
 *   2007 C.Marchand - christophe.marchand@axyus.com
 *
 * This file is part of XEMELIOS.
 *
 * XEMELIOS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * XEMELIOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with XEMELIOS; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package fr.gouv.finances.cp.xemelios.data.impl.sqlconfig;

import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import fr.gouv.finances.cp.utils.xml.marshal.XmlMarshalParser;

public class PersistenceConfigParser extends XmlMarshalParser {
	private String baseDirectory = null;
	
	public PersistenceConfigParser(String baseDir) throws SAXException, ParserConfigurationException {
		super(new Mapping(),true);
		baseDirectory = baseDir;
	}

	private static class Mapping extends HashMap<String,Class> {
		/**
		 * 
		 */
		private static final long serialVersionUID = -493173118670817467L;

		public Mapping() {
			put(TCriteria.TAG,TCriteria.class);
			put(TDocument.TAG,TDocument.class);
			put(TElement.TAG,TElement.class);
			put(TEtat.TAG,TEtat.class);
			put("key1",TKey.class);
			put("key2",TKey.class);
			put("key3",TKey.class);
			put("key4",TKey.class);
			put("key5",TKey.class);
			put("key6",TKey.class);
			put("key7",TKey.class);
			put("key8",TKey.class);
			put("key9",TKey.class);
			put("key10",TKey.class);
			put(TLayer.TAG,TLayer.class);
			put(TPatch.TAG,TPatch.class);
			put(TPersistenceConfig.TAG,TPersistenceConfig.class);
			put(TSqlIndex.TAG,TSqlIndex.class);
			put(TTable.TAG,TTable.class);
                        put(TSql.TAG,TSql.class);
			put("sql-count",XsString.class);
			put("special-cond",XsString.class);
			put("path",XsString.class);
			put("where-clause",XsString.class);
		}
	}

}
