/*
Copyright (C) 2000-2010  Ministere de la culture et de la communication (France), AJLSM
See LICENCE file
*/
package fr.gouv.culture.sdx.sitemap.transformers;

import org.apache.avalon.excalibur.pool.Recyclable;
import org.apache.avalon.framework.parameters.ParameterException;
import org.apache.avalon.framework.parameters.Parameterizable;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.transformation.Transformer;
import org.xml.sax.SAXException;

import java.io.IOException;
import java.util.Map;

public class ElementFilter extends fr.gouv.culture.sdx.pipeline.ElementFilter implements Transformer, Parameterizable, Recyclable {


    public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException,
            SAXException, IOException {
        try {
            if (par.getNames().length > 0)
                this.parameterize(par);
            super.resetFields();//resetting class variables
        } catch (ParameterException e) {
            throw new ProcessingException(e);
        }
    }

    public void parameterize(Parameters parameters) throws ParameterException {
        super.setInternalParameters(parameters);

    }


}
