Index: topia-service/src/java/org/codelutin/topia/migration/kernel/ConfigurationHelper.java diff -u topia-service/src/java/org/codelutin/topia/migration/kernel/ConfigurationHelper.java:1.6 topia-service/src/java/org/codelutin/topia/migration/kernel/ConfigurationHelper.java:1.7 --- topia-service/src/java/org/codelutin/topia/migration/kernel/ConfigurationHelper.java:1.6 Fri Nov 2 15:20:51 2007 +++ topia-service/src/java/org/codelutin/topia/migration/kernel/ConfigurationHelper.java Thu Nov 15 14:43:49 2007 @@ -51,9 +51,9 @@ * @author Chevallereau Benjamin * @author Eon Sébastien * @author Trève Vincent - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * - * Last update : $Date: 2007-11-02 15:20:51 $ + * Last update : $Date: 2007-11-15 14:43:49 $ */ public class ConfigurationHelper { @@ -63,10 +63,20 @@ private static Log logger = LogFactory.getLog(ConfigurationHelper.class); /** + * Single instance + */ + protected static ConfigurationHelper instance = new ConfigurationHelper(); + + /** * Constructeur */ - public ConfigurationHelper() { - + protected ConfigurationHelper() {} + + /** + * Get single instance + */ + public static ConfigurationHelper getInstance() { + return instance; } /** @@ -131,7 +141,7 @@ * @param fichier le nom du fichier * @return le mapping en forme xml */ - public static String getEntityMappingFromFile(URL fichier) { + protected static String getEntityMappingFromFile(URL fichier) { String sXml = null; // charge le document en representation dom4j @@ -155,7 +165,7 @@ * @param dom4jdoc le document * @return un document mapping entite */ - private static Document transformAsValidHibernateMapConfigFile(Document dom4jdoc) { + protected static Document transformAsValidHibernateMapConfigFile(Document dom4jdoc) { Element rootElem = dom4jdoc.getRootElement(); List childElements = rootElem.elements("class"); @@ -187,7 +197,7 @@ * @param fichier le nom du fichier * @return un document dom4j */ - private static Document getDom4jDocument(URL fichier) { + protected static Document getDom4jDocument(URL fichier) { SAXReader reader = new SAXReader(); reader.setValidation(false); //DTDEntityResolver = celui d'hibernate @@ -208,7 +218,7 @@ /** * Construit un nouveau document a partir du flux */ - private static org.w3c.dom.Document getDocumentResolvedByHibernate(String xmlString) { + protected static org.w3c.dom.Document getDocumentResolvedByHibernate(String xmlString) { DocumentBuilder domBuild = ConfigurationHelper.getDocumentBuilder(); // resolver hibernate domBuild.setEntityResolver(new DTDEntityResolver()); @@ -229,7 +239,7 @@ * Recopie, elle est protected dans lutin xml * @return un DocumentBuilder */ - private static DocumentBuilder getDocumentBuilder() { + protected static DocumentBuilder getDocumentBuilder() { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();