
net.sf.wcfart.wcf.convert.ConverterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wcf-art Show documentation
Show all versions of wcf-art Show documentation
jpivot-wcf code used by the ART reporting tool
The newest version!
/*
* ====================================================================
* This software is subject to the terms of the Common Public License
* Agreement, available at the following URL:
* http://www.opensource.org/licenses/cpl.html .
* Copyright (C) 2003-2004 TONBELLER AG.
* All Rights Reserved.
* You must accept the terms of that agreement to use this software.
* ====================================================================
*
*
*/
package net.sf.wcfart.wcf.convert;
import java.io.IOException;
import java.net.URL;
import org.apache.log4j.Logger;
import org.xml.sax.SAXException;
import net.sf.wcfart.wcf.format.Formatter;
import net.sf.wcfart.wcf.utils.ObjectFactory;
import net.sf.wcfart.wcf.utils.SoftException;
/**
* Created on 05.11.2002
*
* @author av
*/
public class ConverterFactory {
private ConverterFactory() {
}
private static Logger logger = Logger.getLogger(ConverterFactory.class);
/**
* returns a new instance w/o caching
*/
public static Converter instance(Formatter formatter) {
URL configXml = ConverterFactory.class.getResource("config.xml");
return instance(formatter, configXml);
}
public static Converter instance(Formatter formatter, URL configXml) {
try {
URL rulesXml = ConverterFactory.class.getResource("rules.xml");
Converter conv = (Converter) ObjectFactory.instance(rulesXml, configXml);
conv.setFormatter(formatter);
return conv;
} catch (SAXException e) {
logger.error("?", e);
throw new SoftException(e);
} catch (IOException e) {
logger.error("?", e);
throw new SoftException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy