/*
 * Copyright
 *   2007 axYus - www.axyus.com
 *   2005 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.common.config;

import java.util.HashMap;

import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

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

/**
 * Parser de definition de document
 * @author chm
 */
public class DocumentsParser extends XmlMarshalParser {
    public DocumentsParser() throws SAXException, ParserConfigurationException, FactoryConfigurationError {
        super(new Mapping(),true);
    }
    
    private static class Mapping extends HashMap<String,Class> {
        /**
         * Comment for <code>serialVersionUID</code>
         */
        private static final long serialVersionUID = 3617293411154145847L;
        
        public Mapping() {
            put(ChampModel.TAG,ChampModel.class);
            put(CritereModel.TAG,CritereModel.class);
            put(DocumentModel.TAG,DocumentModel.class);
            put(DocumentsModel.TAG,DocumentsModel.class);
            put(ElementModel.TAG,ElementModel.class);
            put(EtatModel.TAG,EtatModel.class);
            put(InputModel.TAG, InputModel.class);
            put(ListeResultatModel.TAG,ListeResultatModel.class);
            put(OptionModel.TAG,OptionModel.class);
            put(SelectModel.TAG,SelectModel.class);
            put(EnteteModel.TAG,EnteteModel.class);
            put(PropertyModel.TAG,PropertyModel.class);
            put(PluginModel.TAG,PluginModel.class);
            put(SpecialKeyModel.TAG,SpecialKeyModel.class);
            put(SpecialKeyEntryModel.TAG,SpecialKeyEntryModel.class);
            put(BlankModel.TAG,BlankModel.class);
            put(NamespaceModel.TAG,NamespaceModel.class);
            put(NSModel.TAG,NSModel.class);
            put(DeleteFilterModel.TAG,DeleteFilterModel.class);
            put("recherche-paire",RecherchePaireModel.class);
            put("collectivite-path",RecherchePaireModel.class);
            put("budget-path",RecherchePaireModel.class);
            put("valeur",XPathModel.class);
            put("path",XPathModel.class);
            put("code-path",XPathModel.class);
            put("libelle-path",XPathModel.class);
            put("libelles",IgnoredModel.class);
            put("tag",IgnoredModel.class);
            put("enum",IgnoredModel.class);
            put("champ-optionnel",ChampModel.class);
            put("default-budget",OptionModel.class);
            put("desc",OptionModel.class);
            put("header",OptionModel.class);
            put("liste-export",ListeResultatModel.class);
            put("key1",TextModel.class);
            put("key2",TextModel.class);
            put(ReferenceModel.TAG,ReferenceModel.class);
            put(VariableModel.TAG,VariableModel.class);
            put(EnvironmentModel.TAG,EnvironmentModel.class);
            put("libelle",TextModel.class);
            put(HiddenModel.TAG,HiddenModel.class);
            put(ParametersModel.TAG,ParametersModel.class);
            put(ParameterModel.TAG,ParameterModel.class);
            put("parent",SimpleElement.class);
            put("enfants",EnfantModel.class);
            put("enfant",SimpleElement.class);
            put(WidgetModel.TAG,WidgetModel.class);
        }
    }
}
